42 #include <pcl/pcl_macros.h>
43 #include <pcl/point_cloud.h>
44 #include <pcl/point_types.h>
45 #include <pcl/console/print.h>
48 #include <pcl/io/point_cloud_image_extractors.h>
63 saveCharPNGFile (
const std::string& file_name,
const unsigned char *mono_image,
int width,
int height,
int channels);
74 saveShortPNGFile (
const std::string& file_name,
const unsigned short *short_image,
int width,
int height,
int channels);
84 saveRgbPNGFile (
const std::string& file_name,
const unsigned char *rgb_image,
int width,
int height);
117 template <
typename Po
intT>
void
121 PointCloudImageExtractorPtr pcie;
122 if (field_name ==
"normal")
126 else if (field_name ==
"rgb")
130 else if (field_name ==
"label")
134 else if (field_name ==
"z")
138 else if (field_name ==
"curvature")
142 else if (field_name ==
"intensity")
148 PCL_ERROR (
"[pcl::io::savePNGFile] Unsupported field \"%s\".\n", field_name.c_str ());
152 if (pcie->extract (cloud, image))
158 PCL_ERROR (
"[pcl::io::savePNGFile] Failed to extract an image from \"%s\" field.\n", field_name.c_str());
PCL_EXPORTS void saveCharPNGFile(const std::string &file_name, const unsigned char *mono_image, int width, int height, int channels)
Saves 8-bit encoded image to PNG file.
PCL_EXPORTS void saveShortPNGFile(const std::string &file_name, const unsigned short *short_image, int width, int height, int channels)
Saves 16-bit encoded image to PNG file.
PCL_EXPORTS void savePNGFile(const std::string &file_name, const pcl::PointCloud< unsigned char > &cloud)
Saves 8-bit grayscale cloud as image to PNG file.
PCL_EXPORTS void saveRgbPNGFile(const std::string &file_name, const unsigned char *rgb_image, int width, int height)
Saves 8-bit encoded RGB image to PNG file.