14 kernel::r3 nukleiKernelFromPclPoint(
const pcl::PointXYZ& p)
17 k.loc_ = Vector3(p.x, p.y, p.z);
21 kernel::r3 nukleiKernelFromPclPoint(
const pcl::PointXYZRGB& p)
24 k.loc_ = Vector3(p.x, p.y, p.z);
26 #ifdef NUKLEI_USE_SHIFT_PCL_COLOR_ACCESS
27 const uint32_t rgb = *
reinterpret_cast<const int*
>(&p.rgb);
28 uint8_t r = (rgb >> 16) & 0x0000ff;
29 uint8_t g = (rgb >> 8) & 0x0000ff;
30 uint8_t b = (rgb) & 0x0000ff;
31 RGBColor c(
double(r)/255,
double(g)/255,
double(b)/255);
33 RGBColor c(
double(p.r)/255,
double(p.g)/255,
double(p.b)/255);
48 k.loc_ = Vector3(p.x, p.y, p.z);
49 k.dir_ = la::normalized(Vector3(p.normal_x, p.normal_y, p.normal_z));
58 kernel::r3xs2p nukleiKernelFromPclPoint(
const pcl::PointXYZRGBNormal& p)
61 k.loc_ = Vector3(p.x, p.y, p.z);
62 k.dir_ = la::normalized(Vector3(p.normal_x, p.normal_y, p.normal_z));
64 #ifdef NUKLEI_USE_SHIFT_PCL_COLOR_ACCESS
65 const uint32_t rgb = *
reinterpret_cast<const int*
>(&p.rgb);
66 uint8_t r = (rgb >> 16) & 0x0000ff;
67 uint8_t g = (rgb >> 8) & 0x0000ff;
68 uint8_t b = (rgb) & 0x0000ff;
69 RGBColor c(
double(r)/255,
double(g)/255,
double(b)/255);
71 RGBColor c(
double(p.r)/255,
double(p.g)/255,
double(p.b)/255);
78 void pclPointFromNukleiKernel(pcl::PointXYZ& p,
const kernel::r3& k)
85 void pclPointFromNukleiKernel(pcl::PointXYZ& p,
const kernel::base& k)
87 pclPointFromNukleiKernel(p,
dynamic_cast<const kernel::r3&
>(k));
91 void pclPointFromNukleiKernel(pcl::PointXYZRGB& p,
const kernel::r3& k)
96 const ColorDescriptor& d =
dynamic_cast<const ColorDescriptor&
>(k.getDescriptor());
97 const RGBColor c(d.getColor());
98 uint8_t r = std::min(c.R()*255, 255.);
99 uint8_t g = std::min(c.G()*255, 255.);
100 uint8_t b = std::min(c.B()*255, 255.);
101 #ifdef NUKLEI_USE_SHIFT_PCL_COLOR_ACCESS
102 uint32_t rgb = ((uint32_t)r << 16 | (uint32_t)g << 8 | (uint32_t)b);
103 p.rgb = *
reinterpret_cast<float*
>(&rgb);
111 void pclPointFromNukleiKernel(pcl::PointXYZRGB& p,
const kernel::base& k)
113 pclPointFromNukleiKernel(p,
dynamic_cast<const kernel::r3&
>(k));
122 void pclPointFromNukleiKernel(pcl::PointNormal& p,
const kernel::r3xs2p& k)
127 p.normal_x = k.dir_.X();
128 p.normal_y = k.dir_.Y();
129 p.normal_z = k.dir_.Z();
132 void pclPointFromNukleiKernel(pcl::PointNormal& p,
const kernel::base& k)
134 pclPointFromNukleiKernel(p,
dynamic_cast<const kernel::r3xs2p&
>(k));
143 void pclPointFromNukleiKernel(pcl::PointXYZRGBNormal& p,
const kernel::r3xs2p& k)
148 p.normal_x = k.dir_.X();
149 p.normal_y = k.dir_.Y();
150 p.normal_z = k.dir_.Z();
151 const ColorDescriptor& d =
dynamic_cast<const ColorDescriptor&
>(k.getDescriptor());
152 const RGBColor c(d.getColor());
153 uint8_t r = std::min(c.R()*255, 255.);
154 uint8_t g = std::min(c.G()*255, 255.);
155 uint8_t b = std::min(c.B()*255, 255.);
156 #ifdef NUKLEI_USE_SHIFT_PCL_COLOR_ACCESS
157 uint32_t rgb = ((uint32_t)r << 16 | (uint32_t)g << 8 | (uint32_t)b);
158 p.rgb = *
reinterpret_cast<float*
>(&rgb);
166 void pclPointFromNukleiKernel(pcl::PointXYZRGBNormal& p,
const kernel::base& k)
168 pclPointFromNukleiKernel(p,
dynamic_cast<const kernel::r3xs2p&
>(k));