Image Component Library (ICL)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Types | Public Member Functions | Private Attributes
icl::io::ColorFormatDecoder Class Reference

The ColorFormatDecoder allows for easy conversion of special color formats to RGB. More...

#include <ColorFormatDecoder.h>

List of all members.

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

Private Attributes

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

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

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

create a new instance

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

internal buffer

optionally used output buffer

internal lookup for conversion functions


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines