lzf_image_io.h
/*
* Software License Agreement (BSD License)
*
* Point Cloud Library (PCL) - www.pointclouds.org
* Copyright (c) 2012-, Open Perception, Inc.
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
* * Neither the name of the copyright holder(s) nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
#pragma once
#include <pcl/pcl_macros.h>
#include <pcl/point_cloud.h>
#include <vector>
namespace pcl
{
namespace io
{
/** \brief Basic camera parameters placeholder. */
struct CameraParameters
{
/** fx */
double focal_length_x;
/** fy */
double focal_length_y;
/** cx */
double principal_point_x;
/** cy */
double principal_point_y;
};
/** \brief PCL-LZF image format reader.
* 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:
* * LZF compressed 24-bit [RR...RGG...GBB...B] data
* * LZF compressed 8-bit Bayer data
* * LZF compressed 16-bit YUV422 data
* * LZF compressed 16-bit depth data
*
* 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
* \ingroup io
*/
class PCL_EXPORTS LZFImageReader
{
public:
/** Empty constructor */
LZFImageReader ();
/** Empty destructor */
virtual ~LZFImageReader () {}
/** \brief Read camera parameters from a given file and store them internally.
* \return true if operation successful, false otherwise
*/
bool
readParameters (const std::string &filename);
/** \brief Read the parameters from a struct instead
* \param[in] parameters Camera parameters to use */
inline void
setParameters (const CameraParameters &parameters)
{
parameters_ = parameters;
}
/** \brief Get the camera parameters currently being used
* returns a CameraParameters struct */
inline CameraParameters
getParameters () const
{
return parameters_;
}
/** \brief Get the image width as read from disk. */
inline std::uint32_t
getWidth () const
{
return (width_);
}
/** \brief Get the image height as read from disk. */
inline std::uint32_t
getHeight () const
{
return (height_);
}
/** \brief Get the type of the image read from disk. */
inline std::string
getImageType () const
{
return (image_type_identifier_);
}
protected:
/** \brief Read camera parameters from a given stream and store them internally.
* \return true if operation successful, false otherwise
*/
virtual bool
readParameters (std::istream&) { return (false); }
/** \brief Load a compressed image array from disk
* \param[in] filename the file name to load the data from
* \param[out] data the size of the data
* \param uncompressed_size
* \return an array filled with the data loaded from disk, NULL if error
*/
bool
loadImageBlob (const std::string &filename,
std::vector<char> &data,
std::uint32_t &uncompressed_size);
/** \brief Realtime LZF decompression.
* \param[in] input the array to decompress
* \param[out] output the decompressed array
* \return true if operation successful, false otherwise
*/
bool
decompress (const std::vector<char> &input,
std::vector<char> &output);
/** \brief The image width, as read from the file. */
std::uint32_t width_;
/** \brief The image height, as read from the file. */
std::uint32_t height_;
/** \brief The image type string, as read from the file. */
std::string image_type_identifier_;
/** \brief Internal set of camera parameters. */
CameraParameters parameters_;
};
/** \brief PCL-LZF 16-bit depth image format reader.
*
* 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
* \ingroup io
*/
class PCL_EXPORTS LZFDepth16ImageReader : public LZFImageReader
{
public:
using LZFImageReader::readParameters;
/** Empty constructor */
LZFDepth16ImageReader ()
: z_multiplication_factor_ (0.001) // Set default multiplication factor
{}
/** Empty destructor */
~LZFDepth16ImageReader () {}
/** \brief Read the data stored in a PCLZF depth file and convert it to a pcl::PointCloud type.
* \param[in] filename the file name to read the data from
* \param[out] cloud the resultant output point cloud
*/
template <typename PointT> bool
read (const std::string &filename, pcl::PointCloud<PointT> &cloud);
/** \brief Read the data stored in a PCLZF depth file and convert it to a pcl::PointCloud type.
* \param[in] filename the file name to read the data from
* \param[in] num_threads The number of threads to use. 0 indicates OpenMP is free to choose.
* \param[out] cloud the resultant output point cloud
*/
template <typename PointT> bool
readOMP (const std::string &filename, pcl::PointCloud<PointT> &cloud,
unsigned int num_threads=0);
/** \brief Read camera parameters from a given stream and store them internally.
* The parameters will be read from the <depth> ... </depth> tag.
* \return true if operation successful, false otherwise
*/
bool
readParameters (std::istream& is) override;
protected:
/** \brief Z-value depth multiplication factor
* (i.e., if raw data is in [mm] and we want [m], we need to multiply with 0.001)
*/
double z_multiplication_factor_;
};
/** \brief PCL-LZF 24-bit RGB image format reader.
*
* 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
* \ingroup io
*/
class PCL_EXPORTS LZFRGB24ImageReader : public LZFImageReader
{
public:
using LZFImageReader::readParameters;
/** Empty constructor */
LZFRGB24ImageReader () {}
/** Empty destructor */
~LZFRGB24ImageReader () {}
/** \brief Read the data stored in a PCLZF RGB file and convert it to a pcl::PointCloud type.
* \param[in] filename the file name to read the data from
* \param[out] cloud the resultant output point cloud
*/
template<typename PointT> bool
read (const std::string &filename, pcl::PointCloud<PointT> &cloud);
/** \brief Read the data stored in a PCLZF RGB file and convert it to a pcl::PointCloud type.
* Note that, unless massively multithreaded, this will likely not result in a significant speedup and may even slow performance.
* \param[in] filename the file name to read the data from
* \param[in] num_threads The number of threads to use
* \param[out] cloud the resultant output point cloud
*/
template <typename PointT> bool
readOMP (const std::string &filename, pcl::PointCloud<PointT> &cloud,
unsigned int num_threads=0);
/** \brief Read camera parameters from a given stream and store them internally.
* The parameters will be read from the <rgb> ... </rgb> tag.
* \return true if operation successful, false otherwise
*/
bool
readParameters (std::istream& is) override;
protected:
};
/** \brief PCL-LZF 8-bit Bayer image format reader.
*
* 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
* \ingroup io
*/
class PCL_EXPORTS LZFYUV422ImageReader : public LZFRGB24ImageReader
{
public:
using LZFRGB24ImageReader::readParameters;
/** Empty constructor */
LZFYUV422ImageReader () {}
/** Empty destructor */
~LZFYUV422ImageReader () {}
/** \brief Read the data stored in a PCLZF YUV422 16bit file and convert it to a pcl::PointCloud type.
* \param[in] filename the file name to read the data from
* \param[out] cloud the resultant output point cloud
*/
template<typename PointT> bool
read (const std::string &filename, pcl::PointCloud<PointT> &cloud);
/** \brief Read the data stored in a PCLZF YUV422 file and convert it to a pcl::PointCloud type.
* Note that, unless massively multithreaded, this will likely not result in a significant speedup
* \param[in] filename the file name to read the data from
* \param[in] num_threads The number of threads to use
* \param[out] cloud the resultant output point cloud
*/
template <typename PointT> bool
readOMP (const std::string &filename, pcl::PointCloud<PointT> &cloud,
unsigned int num_threads=0);
};
/** \brief PCL-LZF 8-bit Bayer image format reader.
*
* 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
* \ingroup io
*/
class PCL_EXPORTS LZFBayer8ImageReader : public LZFRGB24ImageReader
{
public:
using LZFRGB24ImageReader::readParameters;
/** Empty constructor */
LZFBayer8ImageReader () {}
/** Empty destructor */
~LZFBayer8ImageReader () {}
/** \brief Read the data stored in a PCLZF Bayer 8bit file and convert it to a pcl::PointCloud type.
* \param[in] filename the file name to read the data from
* \param[out] cloud the resultant output point cloud
*/
template<typename PointT> bool
read (const std::string &filename, pcl::PointCloud<PointT> &cloud);
/** \brief Read the data stored in a PCLZF Bayer 8bit file and convert it to a pcl::PointCloud type.
* Note that, unless massively multithreaded, this will likely not result in a significant speedup and may even slow performance.
* \param[in] filename the file name to read the data from
* \param[in] num_threads The number of threads to use
* \param[out] cloud the resultant output point cloud
*/
template <typename PointT> bool
readOMP (const std::string &filename, pcl::PointCloud<PointT> &cloud,
unsigned int num_threads=0);
};
/** \brief 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:
* * LZF compressed 24-bit [RR...RGG...GBB...B] data
* * LZF compressed 8-bit Bayer data
* * LZF compressed 16-bit YUV422 data
* * LZF compressed 16-bit depth data
*
* 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
* \ingroup io
*/
class PCL_EXPORTS LZFImageWriter
{
public:
/** Empty constructor */
LZFImageWriter () {}
/** Empty destructor */
virtual ~LZFImageWriter () {}
/** \brief Save an image into PCL-LZF format. Virtual.
* \param[in] data the array holding the image
* \param[in] width the with of the data array
* \param[in] height the height of the data array
* \param[in] filename the file name to write
* \return true if operation successful, false otherwise
*/
virtual bool
write (const char* data,
std::uint32_t width, std::uint32_t height,
const std::string &filename) = 0;
/** \brief Write camera parameters to disk. Virtual.
* \param[in] parameters the camera parameters
* \param[in] filename the file name to write
* \return true if operation successful, false otherwise
*/
virtual bool
writeParameters (const CameraParameters &parameters,
const std::string &filename) = 0;
/** \brief Save an image and its camera parameters into PCL-LZF format.
* \param[in] data the array holding the image
* \param[in] width the with of the data array
* \param[in] height the height of the data array
* \param[in] parameters the camera parameters
* \param[in] filename_data the file name to write the data to
* \param[in] filename_xml the file name to write the parameters to
* \return true if operation successful, false otherwise
*/
virtual bool
write (const char* data,
std::uint32_t width, std::uint32_t height,
const CameraParameters &parameters,
const std::string &filename_data,
const std::string &filename_xml)
{
bool res1 = write (data, width, height, filename_data);
bool res2 = writeParameters (parameters, filename_xml);
return (res1 && res2);
}
/** \brief Write a single image/camera parameter to file, given an XML tag
* \param[in] parameter the value of the parameter to write
* \param[in] tag the value of the XML tag
* \param[in] filename the file name to write
* \return true if operation successful, false otherwise
* Example:
* \code
* pcl::io::LZFDepthImageWriter w;
* w.writeParameter (0.001, "depth.multiplication_factor", "parameters.xml");
* \endcode
*/
bool
writeParameter (const double &parameter, const std::string &tag,
const std::string &filename);
protected:
/** \brief Save a compressed image array to disk
* \param[in] data the data to save
* \param[in] data_size the size of the data
* \param[in] filename the file name to write the data to
* \return true if operation successful, false otherwise
*/
bool
saveImageBlob (const char* data, std::size_t data_size,
const std::string &filename);
/** \brief Realtime LZF compression.
* \param[in] input the array to compress
* \param[in] input_size the size of the array to compress
* \param[in] width the with of the data array
* \param[in] height the height of the data array
* \param[in] image_type the 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".
* \param[out] output the compressed output array (must be pre-allocated!)
* \return the number of bytes in the output array
*/
std::uint32_t
compress (const char* input, std::uint32_t input_size,
std::uint32_t width, std::uint32_t height,
const std::string &image_type,
char *output);
};
/** \brief PCL-LZF 16-bit depth image format writer.
*
* 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
* \ingroup io
*/
class PCL_EXPORTS LZFDepth16ImageWriter : public LZFImageWriter
{
public:
/** Empty constructor */
LZFDepth16ImageWriter ()
: z_multiplication_factor_ (0.001) // Set default multiplication factor
{}
/** Empty destructor */
~LZFDepth16ImageWriter () {}
/** \brief Save a 16-bit depth image into PCL-LZF format.
* \param[in] data the array holding the depth image
* \param[in] width the with of the data array
* \param[in] height the height of the data array
* \param[in] filename the file name to write (preferred extension: .pclzf)
* \return true if operation successful, false otherwise
*/
bool
write (const char* data,
std::uint32_t width, std::uint32_t height,
const std::string &filename) override;
/** \brief Write camera parameters to disk.
* \param[in] parameters the camera parameters
* \param[in] filename the file name to write
* \return true if operation successful, false otherwise
* This overwrites the following parameters in the xml file, under the
* <depth> tag:
* <focal_length_x>...</focal_length_x>
* <focal_length_y>...</focal_length_y>
* <principal_point_x>...</principal_point_x>
* <principal_point_y>...</principal_point_y>
* <z_multiplication_factor>...</z_multiplication_factor>
*/
bool
writeParameters (const CameraParameters &parameters,
const std::string &filename) override;
protected:
/** \brief Z-value depth multiplication factor
* (i.e., if raw data is in [mm] and we want [m], we need to multiply with 0.001)
*/
double z_multiplication_factor_;
};
/** \brief PCL-LZF 24-bit RGB image format writer.
*
* 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
* \ingroup io
*/
class PCL_EXPORTS LZFRGB24ImageWriter : public LZFImageWriter
{
public:
/** Empty constructor */
LZFRGB24ImageWriter () {}
/** Empty destructor */
~LZFRGB24ImageWriter () {}
/** \brief Save a 24-bit RGB image into PCL-LZF format.
* \param[in] data the array holding the RGB image (as [RGB..RGB] or [BGR..BGR])
* \param[in] width the with of the data array
* \param[in] height the height of the data array
* \param[in] filename the file name to write (preferred extension: .pclzf)
* \return true if operation successful, false otherwise
*/
bool
write (const char *data,
std::uint32_t width, std::uint32_t height,
const std::string &filename) override;
/** \brief Write camera parameters to disk.
* \param[in] parameters the camera parameters
* \param[in] filename the file name to write
* \return true if operation successful, false otherwise
*/
bool
writeParameters (const CameraParameters &parameters,
const std::string &filename) override;
protected:
};
/** \brief PCL-LZF 16-bit YUV422 image format writer.
*
* 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
* \ingroup io
*/
class PCL_EXPORTS LZFYUV422ImageWriter : public LZFRGB24ImageWriter
{
public:
/** Empty constructor */
LZFYUV422ImageWriter () {}
/** Empty destructor */
~LZFYUV422ImageWriter () {}
/** \brief Save a 16-bit YUV422 image into PCL-LZF format.
* \param[in] data the array holding the YUV422 image (as [YUYV...YUYV])
* \param[in] width the with of the data array
* \param[in] height the height of the data array
* \param[in] filename the file name to write (preferred extension: .pclzf)
* \return true if operation successful, false otherwise
*/
bool
write (const char *data,
std::uint32_t width, std::uint32_t height,
const std::string &filename) override;
};
/** \brief PCL-LZF 8-bit Bayer image format writer.
*
* 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
* \ingroup io
*/
class PCL_EXPORTS LZFBayer8ImageWriter : public LZFRGB24ImageWriter
{
public:
/** Empty constructor */
LZFBayer8ImageWriter () {}
/** Empty destructor */
~LZFBayer8ImageWriter () {}
/** \brief Save a 8-bit Bayer image into PCL-LZF format.
* \param[in] data the array holding the 8-bit Bayer array
* \param[in] width the with of the data array
* \param[in] height the height of the data array
* \param[in] filename the file name to write (preferred extension: .pclzf)
* \return true if operation successful, false otherwise
*/
bool
write (const char *data,
std::uint32_t width, std::uint32_t height,
const std::string &filename) override;
};
}
}
#include <pcl/io/impl/lzf_image_io.hpp>
pcl::PointCloud
PointCloud represents the base class in PCL for storing collections of 3D points.
Definition: point_cloud.h:173
pcl::io::LZFBayer8ImageReader
PCL-LZF 8-bit Bayer image format reader.
Definition: lzf_image_io.h:325
pcl::io::LZFBayer8ImageReader::~LZFBayer8ImageReader
~LZFBayer8ImageReader()
Empty destructor.
Definition: lzf_image_io.h:332
pcl::io::LZFBayer8ImageReader::LZFBayer8ImageReader
LZFBayer8ImageReader()
Empty constructor.
Definition: lzf_image_io.h:330
pcl::io::LZFBayer8ImageWriter
PCL-LZF 8-bit Bayer image format writer.
Definition: lzf_image_io.h:609
pcl::io::LZFBayer8ImageWriter::LZFBayer8ImageWriter
LZFBayer8ImageWriter()
Empty constructor.
Definition: lzf_image_io.h:612
pcl::io::LZFBayer8ImageWriter::~LZFBayer8ImageWriter
~LZFBayer8ImageWriter()
Empty destructor.
Definition: lzf_image_io.h:614
pcl::io::LZFBayer8ImageWriter::write
bool write(const char *data, std::uint32_t width, std::uint32_t height, const std::string &filename) override
Save a 8-bit Bayer image into PCL-LZF format.
pcl::io::LZFDepth16ImageReader
PCL-LZF 16-bit depth image format reader.
Definition: lzf_image_io.h:187
pcl::io::LZFDepth16ImageReader::LZFDepth16ImageReader
LZFDepth16ImageReader()
Empty constructor.
Definition: lzf_image_io.h:192
pcl::io::LZFDepth16ImageReader::~LZFDepth16ImageReader
~LZFDepth16ImageReader()
Empty destructor.
Definition: lzf_image_io.h:197
pcl::io::LZFDepth16ImageReader::readParameters
bool readParameters(std::istream &is) override
Read camera parameters from a given stream and store them internally.
pcl::io::LZFDepth16ImageReader::z_multiplication_factor_
double z_multiplication_factor_
Z-value depth multiplication factor (i.e., if raw data is in [mm] and we want [m],...
Definition: lzf_image_io.h:226
pcl::io::LZFDepth16ImageWriter
PCL-LZF 16-bit depth image format writer.
Definition: lzf_image_io.h:480
pcl::io::LZFDepth16ImageWriter::write
bool write(const char *data, std::uint32_t width, std::uint32_t height, const std::string &filename) override
Save a 16-bit depth image into PCL-LZF format.
pcl::io::LZFDepth16ImageWriter::z_multiplication_factor_
double z_multiplication_factor_
Z-value depth multiplication factor (i.e., if raw data is in [mm] and we want [m],...
Definition: lzf_image_io.h:522
pcl::io::LZFDepth16ImageWriter::writeParameters
bool writeParameters(const CameraParameters &parameters, const std::string &filename) override
Write camera parameters to disk.
pcl::io::LZFDepth16ImageWriter::LZFDepth16ImageWriter
LZFDepth16ImageWriter()
Empty constructor.
Definition: lzf_image_io.h:483
pcl::io::LZFDepth16ImageWriter::~LZFDepth16ImageWriter
~LZFDepth16ImageWriter()
Empty destructor.
Definition: lzf_image_io.h:488
pcl::io::LZFImageReader
PCL-LZF image format reader.
Definition: lzf_image_io.h:86
pcl::io::LZFImageReader::getWidth
std::uint32_t getWidth() const
Get the image width as read from disk.
Definition: lzf_image_io.h:117
pcl::io::LZFImageReader::image_type_identifier_
std::string image_type_identifier_
The image type string, as read from the file.
Definition: lzf_image_io.h:170
pcl::io::LZFImageReader::setParameters
void setParameters(const CameraParameters &parameters)
Read the parameters from a struct instead.
Definition: lzf_image_io.h:102
pcl::io::LZFImageReader::readParameters
bool readParameters(const std::string &filename)
Read camera parameters from a given file and store them internally.
pcl::io::LZFImageReader::readParameters
virtual bool readParameters(std::istream &)
Read camera parameters from a given stream and store them internally.
Definition: lzf_image_io.h:141
pcl::io::LZFImageReader::decompress
bool decompress(const std::vector< char > &input, std::vector< char > &output)
Realtime LZF decompression.
pcl::io::LZFImageReader::loadImageBlob
bool loadImageBlob(const std::string &filename, std::vector< char > &data, std::uint32_t &uncompressed_size)
Load a compressed image array from disk.
pcl::io::LZFImageReader::LZFImageReader
LZFImageReader()
Empty constructor.
pcl::io::LZFImageReader::~LZFImageReader
virtual ~LZFImageReader()
Empty destructor.
Definition: lzf_image_io.h:91
pcl::io::LZFImageReader::getParameters
CameraParameters getParameters() const
Get the camera parameters currently being used returns a CameraParameters struct.
Definition: lzf_image_io.h:110
pcl::io::LZFImageReader::getHeight
std::uint32_t getHeight() const
Get the image height as read from disk.
Definition: lzf_image_io.h:124
pcl::io::LZFImageReader::width_
std::uint32_t width_
The image width, as read from the file.
Definition: lzf_image_io.h:164
pcl::io::LZFImageReader::getImageType
std::string getImageType() const
Get the type of the image read from disk.
Definition: lzf_image_io.h:131
pcl::io::LZFImageReader::parameters_
CameraParameters parameters_
Internal set of camera parameters.
Definition: lzf_image_io.h:173
pcl::io::LZFImageReader::height_
std::uint32_t height_
The image height, as read from the file.
Definition: lzf_image_io.h:167
pcl::io::LZFImageWriter
PCL-LZF image format writer.
Definition: lzf_image_io.h:377
pcl::io::LZFImageWriter::saveImageBlob
bool saveImageBlob(const char *data, std::size_t data_size, const std::string &filename)
Save a compressed image array to disk.
pcl::io::LZFImageWriter::writeParameters
virtual bool writeParameters(const CameraParameters &parameters, const std::string &filename)=0
Write camera parameters to disk.
pcl::io::LZFImageWriter::write
virtual bool write(const char *data, std::uint32_t width, std::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.
Definition: lzf_image_io.h:415
pcl::io::LZFImageWriter::writeParameter
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.
pcl::io::LZFImageWriter::write
virtual bool write(const char *data, std::uint32_t width, std::uint32_t height, const std::string &filename)=0
Save an image into PCL-LZF format.
pcl::io::LZFImageWriter::~LZFImageWriter
virtual ~LZFImageWriter()
Empty destructor.
Definition: lzf_image_io.h:382
pcl::io::LZFImageWriter::compress
std::uint32_t compress(const char *input, std::uint32_t input_size, std::uint32_t width, std::uint32_t height, const std::string &image_type, char *output)
Realtime LZF compression.
pcl::io::LZFImageWriter::LZFImageWriter
LZFImageWriter()
Empty constructor.
Definition: lzf_image_io.h:380
pcl::io::LZFRGB24ImageReader
PCL-LZF 24-bit RGB image format reader.
Definition: lzf_image_io.h:240
pcl::io::LZFRGB24ImageReader::LZFRGB24ImageReader
LZFRGB24ImageReader()
Empty constructor.
Definition: lzf_image_io.h:245
pcl::io::LZFRGB24ImageReader::~LZFRGB24ImageReader
~LZFRGB24ImageReader()
Empty destructor.
Definition: lzf_image_io.h:247
pcl::io::LZFRGB24ImageReader::readParameters
bool readParameters(const std::string &filename)
Read camera parameters from a given file and store them internally.
pcl::io::LZFRGB24ImageReader::readParameters
bool readParameters(std::istream &is) override
Read camera parameters from a given stream and store them internally.
pcl::io::LZFRGB24ImageWriter
PCL-LZF 24-bit RGB image format writer.
Definition: lzf_image_io.h:536
pcl::io::LZFRGB24ImageWriter::LZFRGB24ImageWriter
LZFRGB24ImageWriter()
Empty constructor.
Definition: lzf_image_io.h:539
pcl::io::LZFRGB24ImageWriter::write
bool write(const char *data, std::uint32_t width, std::uint32_t height, const std::string &filename) override
Save a 24-bit RGB image into PCL-LZF format.
pcl::io::LZFRGB24ImageWriter::~LZFRGB24ImageWriter
~LZFRGB24ImageWriter()
Empty destructor.
Definition: lzf_image_io.h:541
pcl::io::LZFRGB24ImageWriter::writeParameters
bool writeParameters(const CameraParameters &parameters, const std::string &filename) override
Write camera parameters to disk.
pcl::io::LZFYUV422ImageReader
PCL-LZF 8-bit Bayer image format reader.
Definition: lzf_image_io.h:287
pcl::io::LZFYUV422ImageReader::LZFYUV422ImageReader
LZFYUV422ImageReader()
Empty constructor.
Definition: lzf_image_io.h:292
pcl::io::LZFYUV422ImageReader::~LZFYUV422ImageReader
~LZFYUV422ImageReader()
Empty destructor.
Definition: lzf_image_io.h:294
pcl::io::LZFYUV422ImageWriter
PCL-LZF 16-bit YUV422 image format writer.
Definition: lzf_image_io.h:578
pcl::io::LZFYUV422ImageWriter::~LZFYUV422ImageWriter
~LZFYUV422ImageWriter()
Empty destructor.
Definition: lzf_image_io.h:583
pcl::io::LZFYUV422ImageWriter::write
bool write(const char *data, std::uint32_t width, std::uint32_t height, const std::string &filename) override
Save a 16-bit YUV422 image into PCL-LZF format.
pcl::io::LZFYUV422ImageWriter::LZFYUV422ImageWriter
LZFYUV422ImageWriter()
Empty constructor.
Definition: lzf_image_io.h:581
pcl
Definition: convolution.h:46
pcl::read
void read(std::istream &stream, Type &value)
Function for reading data from a stream.
Definition: region_xy.h:46
pcl::write
void write(std::ostream &stream, Type value)
Function for writing data to a stream.
Definition: region_xy.h:63
pcl_macros.h
Defines all the PCL and non-PCL macros used.
PCL_EXPORTS
#define PCL_EXPORTS
Definition: pcl_macros.h:323
pcl::io::CameraParameters
Basic camera parameters placeholder.
Definition: lzf_image_io.h:50
pcl::io::CameraParameters::focal_length_x
double focal_length_x
fx
Definition: lzf_image_io.h:52
pcl::io::CameraParameters::principal_point_y
double principal_point_y
cy
Definition: lzf_image_io.h:58
pcl::io::CameraParameters::focal_length_y
double focal_length_y
fy
Definition: lzf_image_io.h:54
pcl::io::CameraParameters::principal_point_x
double principal_point_x
cx
Definition: lzf_image_io.h:56