Image Component Library (ICL)
|
The ColorFormatDecoder allows for easy conversion of special color formats to RGB. More...
#include <ColorFormatDecoder.h>
Public Types | |
typedef void(* | decoder_func) (const icl8u *, const utils::Size &, core::ImgBase **, std::vector< icl8u > *) |
Public Member Functions | |
ColorFormatDecoder () | |
create a new instance More... | |
~ColorFormatDecoder () | |
Destructor. More... | |
bool | supports (FourCC fourcc) |
return whether a given core::format is supported More... | |
void | decode (FourCC fourcc, const icl8u *data, const utils::Size &size, core::ImgBase **dst) |
decodes a given data range to RGB More... | |
const core::ImgBase * | decode (FourCC fourcc, const icl8u *data, const utils::Size &size) |
decode, but use the internal buffer as output More... | |
Private Attributes | |
std::vector< icl8u > | m_buffer |
internal buffer More... | |
std::map< icl32u, decoder_func > | m_functions |
internal lookup for conversion functions More... | |
core::ImgBase * | m_dstBuf |
optionally used output buffer More... | |
The ColorFormatDecoder allows for easy conversion of special color formats to RGB.
If a capturing device does not support to provide RGB image directly, this Decoder is usually used to convert the compressed image data into a simple planar RGB image (core::Img8u). However, also other output core::depth value are supported.
The decoding routine, is chosen by analyising the source data based on its fourcc color code (see: http://en.wikipedia.org/wiki/FourCC and http://v4l2spec.bytesex.org/spec/c2030.htm for more details)
GRAY, GREY or Y800 simple 8bit grayscale image (no version, copy only) YUYV encodes 2 rgb-pixels in 4 bytes, ordered Y_1UY_2V, so the first pixel is created from Y_1, U and V and the 2nd pixel is created from Y_2, U, and V Y444 Simple interleaved YUV-format, data order: U_1,Y_1,V_2,U_2, ... YU12 Very common planar format where Y, U and V channels are packed in order Y,U,V. The special thing is here, that U and V have only half x- and y-resolution Y10B packed 10 bit gray-scale format (result is put into a 16bit (Img16s) image MYRM Special non standard format used for the Myrmex Tactile Sensor RGGB, GBRG, GRBG, BGGR Bayer filter formats, uncommonly used for webcams (note that bayer filters are often used with Firewire cameras, but in the DCGrabber backend, the core::BayerConverter is used automatically) MJPG Motion jpeg. Here, each image frame actually contains binary encoded jpeg data
For supporting the Myrmex Tactile Device, we added an extra FourCC code called "MYRM".
typedef void(* icl::io::ColorFormatDecoder::decoder_func) (const icl8u *, const utils::Size &, core::ImgBase **, std::vector< icl8u > *) |
icl::io::ColorFormatDecoder::ColorFormatDecoder | ( | ) |
create a new instance
icl::io::ColorFormatDecoder::~ColorFormatDecoder | ( | ) |
Destructor.
void icl::io::ColorFormatDecoder::decode | ( | FourCC | fourcc, |
const icl8u * | data, | ||
const utils::Size & | size, | ||
core::ImgBase ** | dst | ||
) |
decodes a given data range to RGB
|
inline |
decode, but use the internal buffer as output
|
inline |
return whether a given core::format is supported
|
private |
internal buffer
|
private |
optionally used output buffer
|
private |
internal lookup for conversion functions