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 | |
~ColorFormatDecoder () | |
Destructor. | |
bool | supports (FourCC fourcc) |
return whether a given core::format is supported | |
void | decode (FourCC fourcc, const icl8u *data, const utils::Size &size, core::ImgBase **dst) |
decodes a given data range to RGB | |
const core::ImgBase * | decode (FourCC fourcc, const icl8u *data, const utils::Size &size) |
decode, but use the internal buffer as output | |
Private Attributes | |
std::vector< icl8u > | m_buffer |
internal buffer | |
std::map< icl32u, decoder_func > | m_functions |
internal lookup for conversion functions | |
core::ImgBase * | m_dstBuf |
optionally used output buffer |
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)
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 > *) |
create a new instance
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
const core::ImgBase* icl::io::ColorFormatDecoder::decode | ( | FourCC | fourcc, |
const icl8u * | data, | ||
const utils::Size & | size | ||
) | [inline] |
decode, but use the internal buffer as output
bool icl::io::ColorFormatDecoder::supports | ( | FourCC | fourcc | ) | [inline] |
return whether a given core::format is supported
std::vector<icl8u> icl::io::ColorFormatDecoder::m_buffer [private] |
internal buffer
optionally used output buffer
std::map<icl32u,decoder_func> icl::io::ColorFormatDecoder::m_functions [private] |
internal lookup for conversion functions