Classes | Namespaces | Functions
compressed_depth_codec.h File Reference

Image transport codec corresponding to compressed_depth_image_transport. More...

#include <memory>
#include <string>
#include <vector>
#include <dynamic_reconfigure/Config.h>
#include <sensor_msgs/CompressedImage.h>
#include <sensor_msgs/Image.h>
#include <compressed_depth_image_transport/CompressedDepthPublisherConfig.h>
#include <compressed_depth_image_transport/compression_common.h>
#include <cras_cpp_common/c_api.h>
#include <cras_cpp_common/log_utils.h>
#include <cras_cpp_common/log_utils/node.h>
#include <cras_cpp_common/optional.hpp>
#include <cras_cpp_common/span.hpp>
#include <image_transport_codecs/image_transport_codec.h>
Include dependency graph for compressed_depth_codec.h:

Go to the source code of this file.

Classes

class  image_transport_codecs::CompressedDepthCodec
 Image transport codec corresponding to compressed_depth_image_transport. More...
 

Namespaces

 cv
 
 image_transport_codecs
 

Functions

bool compressed_depth_codec_has_rvl ()
 Whether the RVL encoding is available. This should be false on Melodic and true on Noetic. More...
 
bool compressedDepthCodecDecode (const char *compressedFormat, size_t compressedDataLength, const uint8_t compressedData[], sensor_msgs::Image::_height_type &rawHeight, sensor_msgs::Image::_width_type &rawWidth, cras::allocator_t rawEncodingAllocator, sensor_msgs::Image::_is_bigendian_type &rawIsBigEndian, sensor_msgs::Image::_step_type &rawStep, cras::allocator_t rawDataAllocator, cras::allocator_t errorStringAllocator, cras::allocator_t logMessagesAllocator)
 Decode the given compressed image using compressedDepth codec. More...
 
bool compressedDepthCodecEncode (sensor_msgs::Image::_height_type rawHeight, sensor_msgs::Image::_width_type rawWidth, const char *rawEncoding, sensor_msgs::Image::_is_bigendian_type rawIsBigEndian, sensor_msgs::Image::_step_type rawStep, size_t rawDataLength, const uint8_t rawData[], cras::allocator_t compressedFormatAllocator, cras::allocator_t compressedDataAllocator, double configDepthMax, double configDepthQuantization, int configPngLevel, cras::allocator_t errorStringAllocator, cras::allocator_t logMessagesAllocator)
 Encode the given raw image using compressedDepth codec with the given config. More...
 

Detailed Description

Image transport codec corresponding to compressed_depth_image_transport.

Author
Martin Pecka

Definition in file compressed_depth_codec.h.

Function Documentation

◆ compressed_depth_codec_has_rvl()

bool compressed_depth_codec_has_rvl ( )

Whether the RVL encoding is available. This should be false on Melodic and true on Noetic.

Returns
Whether the RVL encoding is available.

◆ compressedDepthCodecDecode()

bool compressedDepthCodecDecode ( const char *  compressedFormat,
size_t  compressedDataLength,
const uint8_t  compressedData[],
sensor_msgs::Image::_height_type &  rawHeight,
sensor_msgs::Image::_width_type &  rawWidth,
cras::allocator_t  rawEncodingAllocator,
sensor_msgs::Image::_is_bigendian_type &  rawIsBigEndian,
sensor_msgs::Image::_step_type &  rawStep,
cras::allocator_t  rawDataAllocator,
cras::allocator_t  errorStringAllocator,
cras::allocator_t  logMessagesAllocator 
)

Decode the given compressed image using compressedDepth codec.

This is a C API to allow interfacing this library from other programming languages. Do not use it in C++.

Parameters
[in]compressedFormatThe format field of the compressed image.
[in]compressedDataLengthLength of the compressed image data in bytes.
[in]compressedDataBytes of the compressed image.
[out]rawHeightRaw image height, that is, number of rows.
[out]rawWidthRaw image width, that is, number of columns.
[in,out]rawEncodingAllocatorAllocator for raw image encoding of pixels – channel meaning, ordering, size.
[out]rawIsBigEndianIs raw image bigendian?
[out]rawStepRaw image full row length in bytes.
[in,out]rawDataAllocatorAllocator for raw image bytes.
[in,out]errorStringAllocatorAllocator for error string in case the encoding fails.
[in,out]logMessagesAllocatorAllocator for log messages to be passed to the calling code. Each allocated message should be properly reported by the native logging mechanism after this call finishes. The messages are serialized rosgraph_msgs::Log messages.
Returns
Whether the encoding has succeeded. If yes, output parameters are set, rawEncodingAllocator and rawDataAllocator allocate their buffers and write the output to them. If not, errorStringAllocator allocates its buffer and stores the error string in it.
See also
Corresponding C++ API function: image_transport_codecs::CompressedDepthCodec::decode().

◆ compressedDepthCodecEncode()

bool compressedDepthCodecEncode ( sensor_msgs::Image::_height_type  rawHeight,
sensor_msgs::Image::_width_type  rawWidth,
const char *  rawEncoding,
sensor_msgs::Image::_is_bigendian_type  rawIsBigEndian,
sensor_msgs::Image::_step_type  rawStep,
size_t  rawDataLength,
const uint8_t  rawData[],
cras::allocator_t  compressedFormatAllocator,
cras::allocator_t  compressedDataAllocator,
double  configDepthMax,
double  configDepthQuantization,
int  configPngLevel,
cras::allocator_t  errorStringAllocator,
cras::allocator_t  logMessagesAllocator 
)

Encode the given raw image using compressedDepth codec with the given config.

This is a C API to allow interfacing this library from other programming languages. Do not use it in C++.

Parameters
[in]rawHeightRaw image height, that is, number of rows.
[in]rawWidthRaw image width, that is, number of columns.
[in]rawEncodingRaw image encoding of pixels – channel meaning, ordering, size.
[in]rawIsBigEndianIs raw image bigendian?
[in]rawStepRaw image full row length in bytes.
[in]rawDataLengthLength of raw image data in bytes, should be step * rows.
[in]rawDataThe raw image bytes.
[in,out]compressedFormatAllocatorAllocator for the format field of the compressed image.
[in,out]compressedDataAllocatorAllocator for the byte data of the compressed image.
[in]configFormatCompression format (png or rvl) (Noetic only; Melodic autoselects PNG).
[in]configDepthMaxMaximum depth value in meters (1-100).
[in]configDepthQuantizationDepth value at which the sensor accuracy is 1 m (Kinect: >75) (1-150).
[in]configPngLevelPNG compression level (1-9).
[in,out]errorStringAllocatorAllocator for error string in case the encoding fails.
[in,out]logMessagesAllocatorAllocator for log messages to be passed to the calling code. Each allocated message should be properly reported by the native logging mechanism after this call finishes. The messages are serialized rosgraph_msgs::Log messages.
Returns
Whether the encoding has succeeded. If yes, compressedFormatAllocator and compressedDataAllocator allocate their buffers and write the output to them. If not, errorStringAllocator allocates its buffer and stores the error string in it.
See also
Corresponding C++ API function: image_transport_codecs::CompressedDepthCodec::encode().


image_transport_codecs
Author(s): Martin Pecka
autogenerated on Sat Jun 17 2023 02:33:19