Point Cloud Library (PCL)
1.7.0
|
00001 /* 00002 * Software License Agreement (BSD License) 00003 * 00004 * Point Cloud Library (PCL) - www.pointclouds.org 00005 * Copyright (c) 2012-, Open Perception, Inc. 00006 * 00007 * All rights reserved. 00008 * 00009 * Redistribution and use in source and binary forms, with or without 00010 * modification, are permitted provided that the following conditions 00011 * are met: 00012 * 00013 * * Redistributions of source code must retain the above copyright 00014 * notice, this list of conditions and the following disclaimer. 00015 * * Redistributions in binary form must reproduce the above 00016 * copyright notice, this list of conditions and the following 00017 * disclaimer in the documentation and/or other materials provided 00018 * with the distribution. 00019 * * Neither the name of the copyright holder(s) nor the names of its 00020 * contributors may be used to endorse or promote products derived 00021 * from this software without specific prior written permission. 00022 * 00023 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 00024 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 00025 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 00026 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 00027 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 00028 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 00029 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 00030 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 00031 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 00032 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 00033 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 00034 * POSSIBILITY OF SUCH DAMAGE. 00035 * 00036 */ 00037 00038 #ifndef PCL_LZF_IMAGE_IO_H_ 00039 #define PCL_LZF_IMAGE_IO_H_ 00040 00041 #include <pcl/pcl_macros.h> 00042 #include <pcl/point_cloud.h> 00043 #include <vector> 00044 00045 namespace pcl 00046 { 00047 namespace io 00048 { 00049 /** \brief Basic camera parameters placeholder. */ 00050 struct CameraParameters 00051 { 00052 /** fx */ 00053 double focal_length_x; 00054 /** fy */ 00055 double focal_length_y; 00056 /** cx */ 00057 double principal_point_x; 00058 /** cy */ 00059 double principal_point_y; 00060 }; 00061 00062 /** \brief PCL-LZF image format reader. 00063 * The PCL-LZF image format is nothing else but a LZF-modified compression over 00064 * an existing file type (e.g., PNG). However, in certain situations, like RGB data for 00065 * example, an [RGBRGB...RGB] array will be first reordered into [RR...RGG...GBB...B] 00066 * in order to ensure better compression. 00067 * 00068 * The current list of compressors/decompressors include: 00069 * * LZF compressed 24-bit [RR...RGG...GBB...B] data 00070 * * LZF compressed 8-bit Bayer data 00071 * * LZF compressed 16-bit YUV422 data 00072 * * LZF compressed 16-bit depth data 00073 * 00074 * Please note that files found using the above mentioned extensions will be treated 00075 * as such. Inherit from this class and overwrite the I/O methods if you plan to change 00076 * this behavior. 00077 * 00078 * The main advantage of using the PCL-LZF image I/O routines is a very good file size 00079 * versus I/O speed ratio. Tests performed using LZF, Snappy, ZIP, GZ2, BZIP2, as well 00080 * as PNG, JPEG, and TIFF compression have shown that the internal PCL LZF methods 00081 * provide the best score for the types of applications PCL is suited for. 00082 * 00083 * \author Radu B. Rusu 00084 * \ingroup io 00085 */ 00086 class PCL_EXPORTS LZFImageReader 00087 { 00088 public: 00089 /** Empty constructor */ 00090 LZFImageReader (); 00091 /** Empty destructor */ 00092 virtual ~LZFImageReader () {} 00093 00094 /** \brief Read camera parameters from a given file and store them internally. 00095 * \return true if operation successful, false otherwise 00096 */ 00097 bool 00098 readParameters (const std::string &filename); 00099 00100 /** \brief Read the parameters from a struct instead 00101 * \param[in] parameters Camera parameters to use */ 00102 inline void 00103 setParameters (const CameraParameters ¶meters) 00104 { 00105 parameters_ = parameters; 00106 } 00107 00108 /** \brief Get the camera parameters currently being used 00109 * returns a CameraParameters struct */ 00110 inline CameraParameters 00111 getParameters () const 00112 { 00113 return parameters_; 00114 } 00115 00116 /** \brief Get the image width as read from disk. */ 00117 inline uint32_t 00118 getWidth () const 00119 { 00120 return (width_); 00121 } 00122 00123 /** \brief Get the image height as read from disk. */ 00124 inline uint32_t 00125 getHeight () const 00126 { 00127 return (height_); 00128 } 00129 00130 /** \brief Get the type of the image read from disk. */ 00131 inline std::string 00132 getImageType () const 00133 { 00134 return (image_type_identifier_); 00135 } 00136 00137 protected: 00138 /** \brief Read camera parameters from a given stream and store them internally. 00139 * \return true if operation successful, false otherwise 00140 */ 00141 virtual bool 00142 readParameters (std::istream&) { return (false); } 00143 00144 /** \brief Load a compressed image array from disk 00145 * \param[in] filename the file name to load the data from 00146 * \param[out] data_size the size of the data 00147 * \return an array filled with the data loaded from disk, NULL if error 00148 */ 00149 bool 00150 loadImageBlob (const std::string &filename, 00151 std::vector<char> &data, 00152 uint32_t &uncompressed_size); 00153 00154 /** \brief Realtime LZF decompression. 00155 * \param[in] input the array to decompress 00156 * \param[out] output the decompressed array 00157 * \return true if operation successful, false otherwise 00158 */ 00159 bool 00160 decompress (const std::vector<char> &input, 00161 std::vector<char> &output); 00162 00163 /** \brief The image width, as read from the file. */ 00164 uint32_t width_; 00165 00166 /** \brief The image height, as read from the file. */ 00167 uint32_t height_; 00168 00169 /** \brief The image type string, as read from the file. */ 00170 std::string image_type_identifier_; 00171 00172 /** \brief Internal set of camera parameters. */ 00173 CameraParameters parameters_; 00174 }; 00175 00176 /** \brief PCL-LZF 16-bit depth image format reader. 00177 * 00178 * The main advantage of using the PCL-LZF image I/O routines is a very good file size 00179 * versus I/O speed ratio. Tests performed using LZF, Snappy, ZIP, GZ2, BZIP2, as well 00180 * as PNG, JPEG, and TIFF compression have shown that the internal PCL LZF methods 00181 * provide the best score for the types of applications PCL is suited for. 00182 * 00183 * \author Radu B. Rusu 00184 * \ingroup io 00185 */ 00186 class PCL_EXPORTS LZFDepth16ImageReader : public LZFImageReader 00187 { 00188 public: 00189 using LZFImageReader::readParameters; 00190 00191 /** Empty constructor */ 00192 LZFDepth16ImageReader () 00193 : LZFImageReader () 00194 , z_multiplication_factor_ (0.001) // Set default multiplication factor 00195 {} 00196 00197 /** Empty destructor */ 00198 virtual ~LZFDepth16ImageReader () {} 00199 00200 /** \brief Read the data stored in a PCLZF depth file and convert it to a pcl::PointCloud type. 00201 * \param[in] filename the file name to read the data from 00202 * \param[out] cloud the resultant output point cloud 00203 */ 00204 template <typename PointT> bool 00205 read (const std::string &filename, pcl::PointCloud<PointT> &cloud); 00206 00207 /** \brief Read the data stored in a PCLZF depth file and convert it to a pcl::PointCloud type. 00208 * \param[in] filename the file name to read the data from 00209 * \param[in] num_threads The number of threads to use. 0 indicates OpenMP is free to choose. 00210 * \param[out] cloud the resultant output point cloud 00211 */ 00212 template <typename PointT> bool 00213 readOMP (const std::string &filename, pcl::PointCloud<PointT> &cloud, 00214 unsigned int num_threads=0); 00215 00216 /** \brief Read camera parameters from a given stream and store them internally. 00217 * The parameters will be read from the <depth> ... </depth> tag. 00218 * \return true if operation successful, false otherwise 00219 */ 00220 virtual bool 00221 readParameters (std::istream& is); 00222 00223 protected: 00224 /** \brief Z-value depth multiplication factor 00225 * (i.e., if raw data is in [mm] and we want [m], we need to multiply with 0.001) 00226 */ 00227 double z_multiplication_factor_; 00228 }; 00229 00230 /** \brief PCL-LZF 24-bit RGB image format reader. 00231 * 00232 * The main advantage of using the PCL-LZF image I/O routines is a very good file size 00233 * versus I/O speed ratio. Tests performed using LZF, Snappy, ZIP, GZ2, BZIP2, as well 00234 * as PNG, JPEG, and TIFF compression have shown that the internal PCL LZF methods 00235 * provide the best score for the types of applications PCL is suited for. 00236 * 00237 * \author Radu B. Rusu 00238 * \ingroup io 00239 */ 00240 class PCL_EXPORTS LZFRGB24ImageReader : public LZFImageReader 00241 { 00242 public: 00243 using LZFImageReader::readParameters; 00244 00245 /** Empty constructor */ 00246 LZFRGB24ImageReader () : LZFImageReader () {} 00247 /** Empty destructor */ 00248 virtual ~LZFRGB24ImageReader () {} 00249 00250 /** \brief Read the data stored in a PCLZF RGB file and convert it to a pcl::PointCloud type. 00251 * \param[in] filename the file name to read the data from 00252 * \param[out] cloud the resultant output point cloud 00253 */ 00254 template<typename PointT> bool 00255 read (const std::string &filename, pcl::PointCloud<PointT> &cloud); 00256 00257 /** \brief Read the data stored in a PCLZF RGB file and convert it to a pcl::PointCloud type. 00258 * Note that, unless massively multithreaded, this will likely not result in a significant speedup and may even slow performance. 00259 * \param[in] filename the file name to read the data from 00260 * \param[in] num_threads The number of threads to use 00261 * \param[out] cloud the resultant output point cloud 00262 */ 00263 template <typename PointT> bool 00264 readOMP (const std::string &filename, pcl::PointCloud<PointT> &cloud, 00265 unsigned int num_threads=0); 00266 00267 /** \brief Read camera parameters from a given stream and store them internally. 00268 * The parameters will be read from the <rgb> ... </rgb> tag. 00269 * \return true if operation successful, false otherwise 00270 */ 00271 virtual bool 00272 readParameters (std::istream& is); 00273 00274 protected: 00275 }; 00276 00277 /** \brief PCL-LZF 8-bit Bayer image format reader. 00278 * 00279 * The main advantage of using the PCL-LZF image I/O routines is a very good file size 00280 * versus I/O speed ratio. Tests performed using LZF, Snappy, ZIP, GZ2, BZIP2, as well 00281 * as PNG, JPEG, and TIFF compression have shown that the internal PCL LZF methods 00282 * provide the best score for the types of applications PCL is suited for. 00283 * 00284 * \author Radu B. Rusu 00285 * \ingroup io 00286 */ 00287 class PCL_EXPORTS LZFYUV422ImageReader : public LZFRGB24ImageReader 00288 { 00289 public: 00290 using LZFRGB24ImageReader::readParameters; 00291 00292 /** Empty constructor */ 00293 LZFYUV422ImageReader () : LZFRGB24ImageReader () {} 00294 /** Empty destructor */ 00295 ~LZFYUV422ImageReader () {} 00296 00297 /** \brief Read the data stored in a PCLZF YUV422 16bit file and convert it to a pcl::PointCloud type. 00298 * \param[in] filename the file name to read the data from 00299 * \param[out] cloud the resultant output point cloud 00300 */ 00301 template<typename PointT> bool 00302 read (const std::string &filename, pcl::PointCloud<PointT> &cloud); 00303 00304 /** \brief Read the data stored in a PCLZF YUV422 file and convert it to a pcl::PointCloud type. 00305 * Note that, unless massively multithreaded, this will likely not result in a significant speedup 00306 * \param[in] filename the file name to read the data from 00307 * \param[in] num_threads The number of threads to use 00308 * \param[out] cloud the resultant output point cloud 00309 */ 00310 template <typename PointT> bool 00311 readOMP (const std::string &filename, pcl::PointCloud<PointT> &cloud, 00312 unsigned int num_threads=0); 00313 }; 00314 00315 /** \brief PCL-LZF 8-bit Bayer image format reader. 00316 * 00317 * The main advantage of using the PCL-LZF image I/O routines is a very good file size 00318 * versus I/O speed ratio. Tests performed using LZF, Snappy, ZIP, GZ2, BZIP2, as well 00319 * as PNG, JPEG, and TIFF compression have shown that the internal PCL LZF methods 00320 * provide the best score for the types of applications PCL is suited for. 00321 * 00322 * \author Radu B. Rusu 00323 * \ingroup io 00324 */ 00325 class PCL_EXPORTS LZFBayer8ImageReader : public LZFRGB24ImageReader 00326 { 00327 public: 00328 using LZFRGB24ImageReader::readParameters; 00329 00330 /** Empty constructor */ 00331 LZFBayer8ImageReader () : LZFRGB24ImageReader () {} 00332 /** Empty destructor */ 00333 ~LZFBayer8ImageReader () {} 00334 00335 /** \brief Read the data stored in a PCLZF Bayer 8bit file and convert it to a pcl::PointCloud type. 00336 * \param[in] filename the file name to read the data from 00337 * \param[out] cloud the resultant output point cloud 00338 */ 00339 template<typename PointT> bool 00340 read (const std::string &filename, pcl::PointCloud<PointT> &cloud); 00341 00342 /** \brief Read the data stored in a PCLZF Bayer 8bit file and convert it to a pcl::PointCloud type. 00343 * Note that, unless massively multithreaded, this will likely not result in a significant speedup and may even slow performance. 00344 * \param[in] filename the file name to read the data from 00345 * \param[in] num_threads The number of threads to use 00346 * \param[out] cloud the resultant output point cloud 00347 */ 00348 template <typename PointT> bool 00349 readOMP (const std::string &filename, pcl::PointCloud<PointT> &cloud, 00350 unsigned int num_threads=0); 00351 }; 00352 00353 /** \brief PCL-LZF image format writer. 00354 * The PCL-LZF image format is nothing else but a LZF-modified compression over 00355 * an existing file type (e.g., PNG). However, in certain situations, like RGB data for 00356 * example, an [RGBRGB...RGB] array will be first reordered into [RR...RGG...GBB...B] 00357 * in order to ensure better compression. 00358 * 00359 * The current list of compressors/decompressors include: 00360 * * LZF compressed 24-bit [RR...RGG...GBB...B] data 00361 * * LZF compressed 8-bit Bayer data 00362 * * LZF compressed 16-bit YUV422 data 00363 * * LZF compressed 16-bit depth data 00364 * 00365 * Please note that files found using the above mentioned extensions will be treated 00366 * as such. Inherit from this class and overwrite the I/O methods if you plan to change 00367 * this behavior. 00368 * 00369 * The main advantage of using the PCL-LZF image I/O routines is a very good file size 00370 * versus I/O speed ratio. Tests performed using LZF, Snappy, ZIP, GZ2, BZIP2, as well 00371 * as PNG, JPEG, and TIFF compression have shown that the internal PCL LZF methods 00372 * provide the best score for the types of applications PCL is suited for. 00373 * 00374 * \author Radu B. Rusu 00375 * \ingroup io 00376 */ 00377 class PCL_EXPORTS LZFImageWriter 00378 { 00379 public: 00380 /** Empty constructor */ 00381 LZFImageWriter () {} 00382 /** Empty destructor */ 00383 virtual ~LZFImageWriter () {} 00384 00385 /** \brief Save an image into PCL-LZF format. Virtual. 00386 * \param[in] data the array holding the image 00387 * \param[in] width the with of the data array 00388 * \param[in] height the height of the data array 00389 * \param[in] filename the file name to write 00390 * \return true if operation successful, false otherwise 00391 */ 00392 virtual bool 00393 write (const char* data, 00394 uint32_t width, uint32_t height, 00395 const std::string &filename) = 0; 00396 00397 /** \brief Write camera parameters to disk. Virtual. 00398 * \param[in] parameters the camera parameters 00399 * \param[in] filename the file name to write 00400 * \return true if operation successful, false otherwise 00401 */ 00402 virtual bool 00403 writeParameters (const CameraParameters ¶meters, 00404 const std::string &filename) = 0; 00405 00406 /** \brief Save an image and its camera parameters into PCL-LZF format. 00407 * \param[in] data the array holding the image 00408 * \param[in] width the with of the data array 00409 * \param[in] height the height of the data array 00410 * \param[in] parameters the camera parameters 00411 * \param[in] filename_data the file name to write the data to 00412 * \param[in] filename_xml the file name to write the parameters to 00413 * \return true if operation successful, false otherwise 00414 */ 00415 virtual bool 00416 write (const char* data, 00417 uint32_t width, uint32_t height, 00418 const CameraParameters ¶meters, 00419 const std::string &filename_data, 00420 const std::string &filename_xml) 00421 { 00422 bool res1 = write (data, width, height, filename_data); 00423 bool res2 = writeParameters (parameters, filename_xml); 00424 return (res1 && res2); 00425 } 00426 00427 /** \brief Write a single image/camera parameter to file, given an XML tag 00428 * \param[in] parameter the value of the parameter to write 00429 * \param[in] tag the value of the XML tag 00430 * \param[in] filename the file name to write 00431 * \return true if operation successful, false otherwise 00432 * Example: 00433 * \code 00434 * pcl::io::LZFDepthImageWriter w; 00435 * w.writeParameter (0.001, "depth.multiplication_factor", "parameters.xml"); 00436 * \endcode 00437 */ 00438 bool 00439 writeParameter (const double ¶meter, const std::string &tag, 00440 const std::string &filename); 00441 protected: 00442 /** \brief Save a compressed image array to disk 00443 * \param[in] data the data to save 00444 * \param[in] data_size the size of the data 00445 * \param[in] filename the file name to write the data to 00446 * \return true if operation successful, false otherwise 00447 */ 00448 bool 00449 saveImageBlob (const char* data, size_t data_size, 00450 const std::string &filename); 00451 00452 /** \brief Realtime LZF compression. 00453 * \param[in] input the array to compress 00454 * \param[in] input_size the size of the array to compress 00455 * \param[in] width the with of the data array 00456 * \param[in] height the height of the data array 00457 * \param[in] image_type the type of the image to save. This should be an up to 00458 * 16 characters string describing the data type. Examples are: "bayer8", "rgb24", 00459 * "yuv422", "depth16". 00460 * \param[out] output the compressed output array (must be pre-allocated!) 00461 * \return the number of bytes in the output array 00462 */ 00463 uint32_t 00464 compress (const char* input, uint32_t input_size, 00465 uint32_t width, uint32_t height, 00466 const std::string &image_type, 00467 char *output); 00468 }; 00469 00470 /** \brief PCL-LZF 16-bit depth image format writer. 00471 * 00472 * The main advantage of using the PCL-LZF image I/O routines is a very good file size 00473 * versus I/O speed ratio. Tests performed using LZF, Snappy, ZIP, GZ2, BZIP2, as well 00474 * as PNG, JPEG, and TIFF compression have shown that the internal PCL LZF methods 00475 * provide the best score for the types of applications PCL is suited for. 00476 * 00477 * \author Radu B. Rusu 00478 * \ingroup io 00479 */ 00480 class PCL_EXPORTS LZFDepth16ImageWriter : public LZFImageWriter 00481 { 00482 public: 00483 /** Empty constructor */ 00484 LZFDepth16ImageWriter () 00485 : LZFImageWriter () 00486 , z_multiplication_factor_ (0.001) // Set default multiplication factor 00487 {} 00488 00489 /** Empty destructor */ 00490 virtual ~LZFDepth16ImageWriter () {} 00491 00492 /** \brief Save a 16-bit depth image into PCL-LZF format. 00493 * \param[in] data the array holding the depth image 00494 * \param[in] width the with of the data array 00495 * \param[in] height the height of the data array 00496 * \param[in] filename the file name to write (preferred extension: .pclzf) 00497 * \return true if operation successful, false otherwise 00498 */ 00499 virtual bool 00500 write (const char* data, 00501 uint32_t width, uint32_t height, 00502 const std::string &filename); 00503 00504 /** \brief Write camera parameters to disk. 00505 * \param[in] parameters the camera parameters 00506 * \param[in] filename the file name to write 00507 * \return true if operation successful, false otherwise 00508 * This overwrites the following parameters in the xml file, under the 00509 * <depth> tag: 00510 * <focal_length_x>...</focal_length_x> 00511 * <focal_length_y>...</focal_length_y> 00512 * <principal_point_x>...</principal_point_x> 00513 * <principal_point_y>...</principal_point_y> 00514 * <z_multiplication_factor>...</z_multiplication_factor> 00515 */ 00516 virtual bool 00517 writeParameters (const CameraParameters ¶meters, 00518 const std::string &filename); 00519 00520 protected: 00521 /** \brief Z-value depth multiplication factor 00522 * (i.e., if raw data is in [mm] and we want [m], we need to multiply with 0.001) 00523 */ 00524 double z_multiplication_factor_; 00525 }; 00526 00527 /** \brief PCL-LZF 24-bit RGB image format writer. 00528 * 00529 * The main advantage of using the PCL-LZF image I/O routines is a very good file size 00530 * versus I/O speed ratio. Tests performed using LZF, Snappy, ZIP, GZ2, BZIP2, as well 00531 * as PNG, JPEG, and TIFF compression have shown that the internal PCL LZF methods 00532 * provide the best score for the types of applications PCL is suited for. 00533 * 00534 * \author Radu B. Rusu 00535 * \ingroup io 00536 */ 00537 class PCL_EXPORTS LZFRGB24ImageWriter : public LZFImageWriter 00538 { 00539 public: 00540 /** Empty constructor */ 00541 LZFRGB24ImageWriter () : LZFImageWriter () {} 00542 /** Empty destructor */ 00543 virtual ~LZFRGB24ImageWriter () {} 00544 00545 /** \brief Save a 24-bit RGB image into PCL-LZF format. 00546 * \param[in] data the array holding the RGB image (as [RGB..RGB] or [BGR..BGR]) 00547 * \param[in] width the with of the data array 00548 * \param[in] height the height of the data array 00549 * \param[in] filename the file name to write (preferred extension: .pclzf) 00550 * \return true if operation successful, false otherwise 00551 */ 00552 virtual bool 00553 write (const char *data, 00554 uint32_t width, uint32_t height, 00555 const std::string &filename); 00556 00557 /** \brief Write camera parameters to disk. 00558 * \param[in] parameters the camera parameters 00559 * \param[in] filename the file name to write 00560 * \return true if operation successful, false otherwise 00561 */ 00562 virtual bool 00563 writeParameters (const CameraParameters ¶meters, 00564 const std::string &filename); 00565 00566 protected: 00567 }; 00568 00569 /** \brief PCL-LZF 16-bit YUV422 image format writer. 00570 * 00571 * The main advantage of using the PCL-LZF image I/O routines is a very good file size 00572 * versus I/O speed ratio. Tests performed using LZF, Snappy, ZIP, GZ2, BZIP2, as well 00573 * as PNG, JPEG, and TIFF compression have shown that the internal PCL LZF methods 00574 * provide the best score for the types of applications PCL is suited for. 00575 * 00576 * \author Radu B. Rusu 00577 * \ingroup io 00578 */ 00579 class PCL_EXPORTS LZFYUV422ImageWriter : public LZFRGB24ImageWriter 00580 { 00581 public: 00582 /** Empty constructor */ 00583 LZFYUV422ImageWriter () : LZFRGB24ImageWriter () {} 00584 /** Empty destructor */ 00585 virtual ~LZFYUV422ImageWriter () {} 00586 00587 /** \brief Save a 16-bit YUV422 image into PCL-LZF format. 00588 * \param[in] data the array holding the YUV422 image (as [YUYV...YUYV]) 00589 * \param[in] width the with of the data array 00590 * \param[in] height the height of the data array 00591 * \param[in] filename the file name to write (preferred extension: .pclzf) 00592 * \return true if operation successful, false otherwise 00593 */ 00594 virtual bool 00595 write (const char *data, 00596 uint32_t width, uint32_t height, 00597 const std::string &filename); 00598 }; 00599 00600 /** \brief PCL-LZF 8-bit Bayer image format writer. 00601 * 00602 * The main advantage of using the PCL-LZF image I/O routines is a very good file size 00603 * versus I/O speed ratio. Tests performed using LZF, Snappy, ZIP, GZ2, BZIP2, as well 00604 * as PNG, JPEG, and TIFF compression have shown that the internal PCL LZF methods 00605 * provide the best score for the types of applications PCL is suited for. 00606 * 00607 * \author Radu B. Rusu 00608 * \ingroup io 00609 */ 00610 class PCL_EXPORTS LZFBayer8ImageWriter : public LZFRGB24ImageWriter 00611 { 00612 public: 00613 /** Empty constructor */ 00614 LZFBayer8ImageWriter () : LZFRGB24ImageWriter () {} 00615 /** Empty destructor */ 00616 virtual ~LZFBayer8ImageWriter () {} 00617 00618 /** \brief Save a 8-bit Bayer image into PCL-LZF format. 00619 * \param[in] data the array holding the 8-bit Bayer array 00620 * \param[in] width the with of the data array 00621 * \param[in] height the height of the data array 00622 * \param[in] filename the file name to write (preferred extension: .pclzf) 00623 * \return true if operation successful, false otherwise 00624 */ 00625 virtual bool 00626 write (const char *data, 00627 uint32_t width, uint32_t height, 00628 const std::string &filename); 00629 }; 00630 } 00631 } 00632 00633 #include <pcl/io/impl/lzf_image_io.hpp> 00634 00635 #endif //#ifndef PCL_LZF_IMAGE_IO_H_