9 #ifndef YARP_SIG_POINTCLOUDUTILS_INL_H
10 #define YARP_SIG_POINTCLOUDUTILS_INL_H
12 #include <type_traits>
19 std::enable_if_t<std::is_same<T1, yarp::sig::DataXYZRGBA>::value &&
20 (std::is_same<T2, yarp::sig::PixelRgb>::value ||
21 std::is_same<T2, yarp::sig::PixelBgr>::value),
int> = 0
28 pointCloud(u,v).r = color.
pixel(u,v).r;
29 pointCloud(u,v).g = color.
pixel(u,v).g;
30 pointCloud(u,v).b = color.
pixel(u,v).b;
35 std::enable_if_t<std::is_same<T1, yarp::sig::DataXYZRGBA>::value &&
36 (std::is_same<T2, yarp::sig::PixelRgba>::value ||
37 std::is_same<T2, yarp::sig::PixelBgra>::value),
int> = 0
44 pointCloud(u,v).r = color.
pixel(u,v).r;
45 pointCloud(u,v).g = color.
pixel(u,v).g;
46 pointCloud(u,v).b = color.
pixel(u,v).b;
47 pointCloud(u,v).a = color.
pixel(u,v).a;
52 std::enable_if_t<!std::is_same<T1, yarp::sig::DataXYZRGBA>::value ||
53 (!std::is_same<T2, yarp::sig::PixelRgb>::value &&
54 !std::is_same<T2, yarp::sig::PixelBgr>::value &&
55 !std::is_same<T2, yarp::sig::PixelRgba>::value &&
56 !std::is_same<T2, yarp::sig::PixelBgra>::value),
int> = 0
67 template<
typename T1,
typename T2>
74 yAssert(depth.width() == color.width());
75 yAssert(depth.height() == color.height());
76 size_t w = depth.width();
77 size_t h = depth.height();
81 for (
size_t u = 0; u < w; ++u) {
82 for (
size_t v = 0; v < h; ++v) {
90 pointCloud(u,v).z = depth.
pixel(u,v);
92 copyColorData(pointCloud, color, u, v);
98 #endif // YARP_SIG_POINTCLOUDUTILS_INL_H