LTI-Lib latest version v1.9 - last update 10 Apr 2010

lti::mergeYUVToImage Class Reference
[Color Analysis]

Compute RGB values from given YUV values by merging float or ubyte values to an rgbPixel, merging channels(floats) or channel8s(ubytes) to an Image. More...

#include <ltiMergeYUVToImage.h>

Inheritance diagram for lti::mergeYUVToImage:
Inheritance graph
[legend]
Collaboration diagram for lti::mergeYUVToImage:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 mergeYUVToImage (void)
 ~mergeYUVToImage ()
virtual const char * getTypeName () const
mergeYUVToImagecopy (const mergeYUVToImage &other)
mergeYUVToImageoperator= (const mergeYUVToImage &other)
virtual functorclone () const
virtual bool apply (const matrix< float > &Y, const matrix< float > &U, const matrix< float > &V, image &img) const
virtual bool apply (const channel8 &Y, const channel8 &U, const channel8 &V, image &img) const
virtual bool apply (const float &Y, const float &U, const float &V, rgbPixel &pixel) const
virtual bool apply (const ubyte &Y, const ubyte &U, const ubyte &V, rgbPixel &pixel) const

Protected Member Functions

ubyte clip (const int val) const

Detailed Description

Compute RGB values from given YUV values by merging float or ubyte values to an rgbPixel, merging channels(floats) or channel8s(ubytes) to an Image.

In the literature, technical and scientific, there is often confusion among the color spaces YUV, YPbPr and YPbPr. Poynton in http://www.poynton.com/notes/colour_and_gamma/ColorFAQ.html explains that YUV is usually never correctly meant, because the color space normally used for component digital video is the YCbCr (ITU-RS601 or CCIR-601). Other devices use the YPbPr, but the "real" YUV is rarely employed.

The LTI-Lib provides all three spaces:

Here, the inverse transformation of lti::splitImageToYUV is followed

\[ \begin{bmatrix} R \\ G \\ B \end{bmatrix} = M^{-1} \begin{bmatrix} Y \\ U \\ V \end{bmatrix} \]

where M is the matrix given in lti::splitImageToYUV.

If you use ubyte values, then this functor is equivalent to lti::mergeYPbPrToImage, as the U and V values have to be linearly mapped to make use of the limited range from 0 to 255.


Constructor & Destructor Documentation

lti::mergeYUVToImage::mergeYUVToImage ( void   ) 

constructor

lti::mergeYUVToImage::~mergeYUVToImage (  ) 

destructor


Member Function Documentation

bool lti::mergeYUVToImage::apply ( const ubyte Y,
const ubyte U,
const ubyte V,
rgbPixel pixel 
) const [inline, virtual]

merge the 8-bit-values Y, U and V to a pixel

Parameters:
Y the Y value, i.e. black&white
U the U value, chromatic
V the V value, chromatic
pixel the merged pixel

Implements lti::mergeImage.

bool lti::mergeYUVToImage::apply ( const float &  Y,
const float &  U,
const float &  V,
rgbPixel pixel 
) const [inline, virtual]

merge the values Y, U and V to a pixel

Parameters:
Y the Y value, i.e. black&white
U the U value, chromatic
V the V value, chromatic
pixel the merged pixel

Implements lti::mergeImage.

References clip(), and lti::rgbPixel::set().

virtual bool lti::mergeYUVToImage::apply ( const channel8 Y,
const channel8 U,
const channel8 V,
image img 
) const [virtual]

merge 8-bit-channels Y, U, V to an image

Parameters:
Y the Y channel, i.e. black&white
U the U channel, chromatic
V the V channel, chromatic
img the image to be splitted

Implements lti::mergeImage.

virtual bool lti::mergeYUVToImage::apply ( const matrix< float > &  Y,
const matrix< float > &  U,
const matrix< float > &  V,
image img 
) const [virtual]

merge channels Y, U, V to an image

Parameters:
Y the Y channel, i.e. black&white
U the U channel, chromatic
V the V channel, chromatic
img the image to be splitted

Implements lti::mergeImage.

ubyte lti::mergeYUVToImage::clip ( const int  val  )  const [inline, protected]

Clip function.

Equivalent to min(255,max(0,val)) but maybe faster

Referenced by apply().

virtual functor* lti::mergeYUVToImage::clone (  )  const [virtual]

returns a pointer to a clone of the functor.

Implements lti::functor.

mergeYUVToImage& lti::mergeYUVToImage::copy ( const mergeYUVToImage other  ) 

copy data of "other" functor.

Parameters:
other the functor to be copied
Returns:
a reference to this functor object

Reimplemented from lti::mergeImage.

virtual const char* lti::mergeYUVToImage::getTypeName (  )  const [virtual]

return the name of this type

Reimplemented from lti::mergeImage.

mergeYUVToImage& lti::mergeYUVToImage::operator= ( const mergeYUVToImage other  ) 

alias for copy member

Parameters:
other the functor to be copied
Returns:
a reference to this functor object

Reimplemented from lti::mergeImage.


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

Generated on Sat Apr 10 15:27:36 2010 for LTI-Lib by Doxygen 1.6.1