29 #ifndef OCLSLAM_HELPERFUNCS_HPP
30 #define OCLSLAM_HELPERFUNCS_HPP
35 #include <RBC/data_types.hpp>
37 #if defined(__APPLE__) || defined(__MACOSX)
38 #include <OpenCL/cl.hpp>
65 for (pow = 1; pow < (uint64_t) num; pow <<= 1) ;
82 std::cout << title << std::endl;
84 for (
int row = 0; row <
height; ++row)
86 for (
int col = 0; col <
width; ++col)
88 std::cout << std::setw (3 *
sizeof (T)) << +ptr[row * width + col] <<
" ";
90 std::cout << std::endl;
93 std::cout << std::endl;
106 template <
typename T>
109 std::ios::fmtflags f (std::cout.flags ());
110 std::cout << title << std::endl;
111 std::cout << std::fixed << std::setprecision (prec);
113 for (
int row = 0; row <
height; ++row)
115 for (
int col = 0; col <
width; ++col)
117 std::cout << std::setw (5 + prec) << ptr[row * width + col] <<
" ";
119 std::cout << std::endl;
122 std::cout << std::endl;
136 template <
typename T>
139 for (uint k = 0; k < n; ++k)
141 cl_float *point = pc8d + (k << 3);
143 for (uint j = 0; j < 3; ++j)
145 pc3d[3 * k + j] = point[j] * 0.001;
146 rgb[3 * k + j] = (cl_uchar) (point[4 + j] * 255);
153 #endif // OCLSLAM_HELPERFUNCS_HPP
void printBuffer(const char *title, T *ptr, uint32_t width, uint32_t height)
Prints an array of an integer type to standard output.
Definition: helper_funcs.hpp:80
const int width
Definition: glut_viewer.cpp:53
uint64_t nextPow2(T num)
Returns the first power of 2 greater than or equal to the input.
Definition: helper_funcs.hpp:60
bool setProfilingFlag(int argc, char **argv)
Checks the command line arguments for the profiling flag, --profiling.
Definition: helper_funcs.cpp:66
Offers functions that are serial CPU implementations of the relevant algorithms in the OCLSLAM pipeli...
Definition: helper_funcs.hpp:47
void cpuSplitPC8D(T *pc8d, T *pc3d, cl_uchar *rgb, uint32_t n)
Splits an 8-D point cloud into 3-D coordinates (in meters) and 8-bit RGB values.
Definition: helper_funcs.hpp:137
const int height
Definition: glut_viewer.cpp:54
void printBufferF(const char *title, T *ptr, uint32_t width, uint32_t height, uint32_t prec)
Prints an array of floating-point type to standard output.
Definition: helper_funcs.hpp:107