Image Component Library (ICL)
Public Types | Public Member Functions | Private Attributes | List of all members
icl::io::ColorFormatDecoder Class Reference

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::ImgBasedecode (FourCC fourcc, const icl8u *data, const utils::Size &size)
 decode, but use the internal buffer as output More...
 

Private Attributes

std::vector< icl8um_buffer
 internal buffer More...
 
std::map< icl32u, decoder_funcm_functions
 internal lookup for conversion functions More...
 
core::ImgBasem_dstBuf
 optionally used output buffer More...
 

Detailed Description

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)

Supported FourCC codes

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

Example (Image Convolution)

For supporting the Myrmex Tactile Device, we added an extra FourCC code called "MYRM".

See also
FourCC

Member Typedef Documentation

typedef void(* icl::io::ColorFormatDecoder::decoder_func) (const icl8u *, const utils::Size &, core::ImgBase **, std::vector< icl8u > *)

Constructor & Destructor Documentation

icl::io::ColorFormatDecoder::ColorFormatDecoder ( )

create a new instance

icl::io::ColorFormatDecoder::~ColorFormatDecoder ( )

Destructor.

Member Function Documentation

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

Member Data Documentation

std::vector<icl8u> icl::io::ColorFormatDecoder::m_buffer
private

internal buffer

core::ImgBase* icl::io::ColorFormatDecoder::m_dstBuf
private

optionally used output buffer

std::map<icl32u,decoder_func> icl::io::ColorFormatDecoder::m_functions
private

internal lookup for conversion functions


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