Point Cloud Library (PCL)  1.9.1-dev
List of all members | Public Member Functions | Protected Member Functions
pcl::io::LZFImageWriter Class Referenceabstract

PCL-LZF image format writer. More...

#include <pcl/io/lzf_image_io.h>

+ Inheritance diagram for pcl::io::LZFImageWriter:

Public Member Functions

 LZFImageWriter ()
 Empty constructor. More...
 
virtual ~LZFImageWriter ()
 Empty destructor. More...
 
virtual bool write (const char *data, uint32_t width, uint32_t height, const std::string &filename)=0
 Save an image into PCL-LZF format. More...
 
virtual bool writeParameters (const CameraParameters &parameters, const std::string &filename)=0
 Write camera parameters to disk. More...
 
virtual bool write (const char *data, uint32_t width, uint32_t height, const CameraParameters &parameters, const std::string &filename_data, const std::string &filename_xml)
 Save an image and its camera parameters into PCL-LZF format. More...
 
bool writeParameter (const double &parameter, const std::string &tag, const std::string &filename)
 Write a single image/camera parameter to file, given an XML tag. More...
 

Protected Member Functions

bool saveImageBlob (const char *data, size_t data_size, const std::string &filename)
 Save a compressed image array to disk. More...
 
uint32_t compress (const char *input, uint32_t input_size, uint32_t width, uint32_t height, const std::string &image_type, char *output)
 Realtime LZF compression. More...
 

Detailed Description

PCL-LZF image format writer.

The PCL-LZF image format is nothing else but a LZF-modified compression over an existing file type (e.g., PNG). However, in certain situations, like RGB data for example, an [RGBRGB...RGB] array will be first reordered into [RR...RGG...GBB...B] in order to ensure better compression.

The current list of compressors/decompressors include:

Please note that files found using the above mentioned extensions will be treated as such. Inherit from this class and overwrite the I/O methods if you plan to change this behavior.

The main advantage of using the PCL-LZF image I/O routines is a very good file size versus I/O speed ratio. Tests performed using LZF, Snappy, ZIP, GZ2, BZIP2, as well as PNG, JPEG, and TIFF compression have shown that the internal PCL LZF methods provide the best score for the types of applications PCL is suited for.

Author
Radu B. Rusu

Definition at line 377 of file lzf_image_io.h.

Constructor & Destructor Documentation

pcl::io::LZFImageWriter::LZFImageWriter ( )
inline

Empty constructor.

Definition at line 381 of file lzf_image_io.h.

virtual pcl::io::LZFImageWriter::~LZFImageWriter ( )
inlinevirtual

Empty destructor.

Definition at line 383 of file lzf_image_io.h.

References pcl::write().

Member Function Documentation

uint32_t pcl::io::LZFImageWriter::compress ( const char *  input,
uint32_t  input_size,
uint32_t  width,
uint32_t  height,
const std::string &  image_type,
char *  output 
)
protected

Realtime LZF compression.

Parameters
[in]inputthe array to compress
[in]input_sizethe size of the array to compress
[in]widththe with of the data array
[in]heightthe height of the data array
[in]image_typethe type of the image to save. This should be an up to 16 characters string describing the data type. Examples are: "bayer8", "rgb24", "yuv422", "depth16".
[out]outputthe compressed output array (must be pre-allocated!)
Returns
the number of bytes in the output array
bool pcl::io::LZFImageWriter::saveImageBlob ( const char *  data,
size_t  data_size,
const std::string &  filename 
)
protected

Save a compressed image array to disk.

Parameters
[in]datathe data to save
[in]data_sizethe size of the data
[in]filenamethe file name to write the data to
Returns
true if operation successful, false otherwise
virtual bool pcl::io::LZFImageWriter::write ( const char *  data,
uint32_t  width,
uint32_t  height,
const std::string &  filename 
)
pure virtual

Save an image into PCL-LZF format.

Virtual.

Parameters
[in]datathe array holding the image
[in]widththe with of the data array
[in]heightthe height of the data array
[in]filenamethe file name to write
Returns
true if operation successful, false otherwise

Implemented in pcl::io::LZFBayer8ImageWriter, pcl::io::LZFYUV422ImageWriter, pcl::io::LZFRGB24ImageWriter, and pcl::io::LZFDepth16ImageWriter.

virtual bool pcl::io::LZFImageWriter::write ( const char *  data,
uint32_t  width,
uint32_t  height,
const CameraParameters parameters,
const std::string &  filename_data,
const std::string &  filename_xml 
)
inlinevirtual

Save an image and its camera parameters into PCL-LZF format.

Parameters
[in]datathe array holding the image
[in]widththe with of the data array
[in]heightthe height of the data array
[in]parametersthe camera parameters
[in]filename_datathe file name to write the data to
[in]filename_xmlthe file name to write the parameters to
Returns
true if operation successful, false otherwise

Definition at line 416 of file lzf_image_io.h.

References pcl::write().

bool pcl::io::LZFImageWriter::writeParameter ( const double &  parameter,
const std::string &  tag,
const std::string &  filename 
)

Write a single image/camera parameter to file, given an XML tag.

Parameters
[in]parameterthe value of the parameter to write
[in]tagthe value of the XML tag
[in]filenamethe file name to write
Returns
true if operation successful, false otherwise Example:
pcl::io::LZFDepthImageWriter w;
w.writeParameter (0.001, "depth.multiplication_factor", "parameters.xml");
virtual bool pcl::io::LZFImageWriter::writeParameters ( const CameraParameters parameters,
const std::string &  filename 
)
pure virtual

Write camera parameters to disk.

Virtual.

Parameters
[in]parametersthe camera parameters
[in]filenamethe file name to write
Returns
true if operation successful, false otherwise

Implemented in pcl::io::LZFRGB24ImageWriter, and pcl::io::LZFDepth16ImageWriter.


The documentation for this class was generated from the following file: