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> 46 #include <pcl/console/print.h> 49 #include <pcl/io/point_cloud_image_extractors.h> 64 saveCharPNGFile (
const std::string& file_name,
const unsigned char *mono_image,
int width,
int height,
int channels);
75 saveShortPNGFile (
const std::string& file_name,
const unsigned short *short_image,
int width,
int height,
int channels);
85 saveRgbPNGFile (
const std::string& file_name,
const unsigned char *rgb_image,
int width,
int height);
118 template <
typename Po
intT>
void 122 PointCloudImageExtractorPtr pcie;
123 if (field_name ==
"normal")
127 else if (field_name ==
"rgb")
131 else if (field_name ==
"label")
135 else if (field_name ==
"z")
139 else if (field_name ==
"curvature")
143 else if (field_name ==
"intensity")
149 PCL_ERROR (
"[pcl::io::savePNGFile] Unsupported field \"%s\".\n", field_name.c_str ());
153 if (pcie->extract (cloud, image))
159 PCL_ERROR (
"[pcl::io::savePNGFile] Failed to extract an image from \"%s\" field.\n", field_name.c_str());
166 #endif //#ifndef PCL_IO_PNG_IO_H_
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.
This file defines compatibility wrappers for low level I/O functions.
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.
Defines all the PCL implemented PointT point type structures.
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.