Image Component Library (ICL)
|
00001 /******************************************************************** 00002 ** Image Component Library (ICL) ** 00003 ** ** 00004 ** Copyright (C) 2006-2013 CITEC, University of Bielefeld ** 00005 ** Neuroinformatics Group ** 00006 ** Website: www.iclcv.org and ** 00007 ** http://opensource.cit-ec.de/projects/icl ** 00008 ** ** 00009 ** File : ICLGeom/src/ICLGeom/PointCloudCreatorCL.h ** 00010 ** Module : ICLGeom ** 00011 ** Authors: Andre Ueckermann ** 00012 ** ** 00013 ** ** 00014 ** GNU LESSER GENERAL PUBLIC LICENSE ** 00015 ** This file may be used under the terms of the GNU Lesser General ** 00016 ** Public License version 3.0 as published by the ** 00017 ** ** 00018 ** Free Software Foundation and appearing in the file LICENSE.LGPL ** 00019 ** included in the packaging of this file. Please review the ** 00020 ** following information to ensure the license requirements will ** 00021 ** be met: http://www.gnu.org/licenses/lgpl-3.0.txt ** 00022 ** ** 00023 ** The development of this software was supported by the ** 00024 ** Excellence Cluster EXC 277 Cognitive Interaction Technology. ** 00025 ** The Excellence Cluster EXC 277 is a grant of the Deutsche ** 00026 ** Forschungsgemeinschaft (DFG) in the context of the German ** 00027 ** Excellence Initiative. ** 00028 ** ** 00029 ********************************************************************/ 00030 00031 #pragma once 00032 00033 #include <ICLUtils/CompatMacros.h> 00034 #include <ICLGeom/PointCloudObjectBase.h> 00035 #include <ICLCore/Img.h> 00036 #include <ICLMath/FixedVector.h> 00037 00038 #ifdef ICL_HAVE_OPENCL 00039 #include <ICLUtils/CLProgram.h> 00040 #include <ICLUtils/CLKernel.h> 00041 #include <ICLUtils/CLBuffer.h> 00042 #endif 00043 00044 namespace icl{ 00045 namespace geom{ 00048 class PointCloudCreatorCL{ 00049 00050 public: 00052 00055 ICLGeom_API PointCloudCreatorCL(utils::Size size, const utils::Array2D<Vec> &dirs); 00056 00058 ICLGeom_API ~PointCloudCreatorCL(); 00059 00061 00062 ICLGeom_API void setDirectionVectors(const utils::Array2D<Vec> &dirs) throw (utils::ICLException); 00063 00065 ICLGeom_API void create(bool NEEDS_RAW_TO_MM_MAPPING,const core::Img32f *depthValues, 00066 const Vec O, const int DEPTH_DIM, 00067 core::DataSegment<float,3> xyz, const utils::Array2D<Vec> &dirs, float depthScaling); 00068 00070 ICLGeom_API void createRGB(bool NEEDS_RAW_TO_MM_MAPPING, const core::Img32f *depthValues, const Mat M, 00071 const Vec O, const unsigned int COLOR_W, const unsigned int COLOR_H, const int DEPTH_DIM, 00072 core::DataSegment<float,3> xyz, core::DataSegment<float,4> rgba, 00073 const core::Img8u *rgbIn,const utils::Array2D<Vec> &dirs, float depthScaling); 00074 00076 00077 ICLGeom_API bool isCLReady(); 00078 00079 private: 00080 bool clReady; 00081 utils::Size size; 00082 #ifdef ICL_HAVE_OPENCL 00083 //OpenCL data 00084 00085 //float* depthValuesArray; 00086 // unsigned char* rInArray; 00087 //unsigned char* gInArray; 00088 //unsigned char* bInArray; 00089 float* xyzData; 00090 math::FixedColVector<float, 4>* rgbaData; 00091 00092 //OpenCL 00093 utils::CLProgram program; 00094 00095 utils::CLKernel kernelCreate; 00096 utils::CLKernel kernelCreateRGB; 00097 00098 utils::CLBuffer depthValuesBuffer; 00099 utils::CLBuffer matrixBuffer; 00100 utils::CLBuffer xyzBuffer; 00101 utils::CLBuffer rgbaBuffer; 00102 utils::CLBuffer rInBuffer; 00103 utils::CLBuffer gInBuffer; 00104 utils::CLBuffer bInBuffer; 00105 utils::CLBuffer dirsBuffer; 00106 00107 #endif 00108 }; 00109 } // namespace geom 00110 }