23 #include <fvutils/adapters/pcl.h> 24 #include <fvutils/ipc/shm_image.h> 25 #include <fvutils/color/colorspaces.h> 26 #include <fvutils/base/types.h> 27 #include <core/exception.h> 37 convert_buffer_to_pcl(
const SharedMemoryImageBuffer *buffer,
40 if (buffer->colorspace() != CARTESIAN_3D_FLOAT) {
41 throw Exception(
"Invalid colorspace, expected CARTESIAN_3D_FLOAT");
44 const pcl_point_t *pclbuf = (
const pcl_point_t*)buffer->buffer();
46 const unsigned int width = buffer->width();
47 const unsigned int height = buffer->height();
52 pcl.points.resize(width * height);
54 for (
unsigned int i = 0; i < width * height; ++i) {
55 pcl::PointXYZ &p = pcl.points[i];
56 const pcl_point_t &pt = pclbuf[i];
66 convert_buffer_to_pcl(
const SharedMemoryImageBuffer *buffer,
69 if (buffer->colorspace() != CARTESIAN_3D_FLOAT) {
70 throw Exception(
"Invalid colorspace, expected CARTESIAN_3D_FLOAT");
73 const pcl_point_t *pclbuf = (
const pcl_point_t*)buffer->buffer();
75 const unsigned int width = buffer->width();
76 const unsigned int height = buffer->height();
81 pcl.points.resize(width * height);
83 for (
unsigned int i = 0; i < width * height; ++i) {
84 pcl::PointXYZRGB &p = pcl.points[i];
85 const pcl_point_t &pt = pclbuf[i];
89 p.r = p.g = p.b = 255;
Fawkes library namespace.
Base class for exceptions in Fawkes.