40 #ifndef PCL_IO_PNG_IO_H_
41 #define PCL_IO_PNG_IO_H_
43 #include <pcl/pcl_macros.h>
44 #include <pcl/point_cloud.h>
45 #include <pcl/point_types.h>
62 saveCharPNGFile (
const std::string& file_name,
const unsigned char *mono_image,
int width,
int height,
int channels);
73 saveShortPNGFile (
const std::string& file_name,
const unsigned short *short_image,
int width,
int height,
int channels);
83 saveRgbPNGFile (
const std::string& file_name,
const unsigned char *rgb_image,
int width,
int height)
116 template <
typename T>
void
119 std::vector<unsigned char> data(cloud.
width * cloud.
height * 3);
121 for (
size_t i = 0; i < cloud.
points.size (); ++i)
123 data[i*3 + 0] = cloud.
points[i].r;
124 data[i*3 + 1] = cloud.
points[i].g;
125 data[i*3 + 2] = cloud.
points[i].b;
139 std::vector<unsigned short> data(cloud.
width * cloud.
height);
141 for (
size_t i = 0; i < cloud.
points.size (); ++i)
143 data[i] =
static_cast<unsigned short> (cloud.
points[i].label);
150 #endif //#ifndef PCL_IO_PNG_IO_H_