CVR-Lib last update 20 Sep 2009

cvr::mergeYUVToImage Class Reference
[Color Analysis]

Compute RGB values from given YUV values by merging float or ubyte values to an rgbaPixel, merging channels(floats) or matrix<ubyte>s(ubytes) to an Image. More...

#include <cvrMergeYUVToImage.h>

Inheritance diagram for cvr::mergeYUVToImage:

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

Collaboration graph
[legend]

List of all members.

Public Member Functions

 mergeYUVToImage (void)
 ~mergeYUVToImage ()
const std::string & name () const
mergeYUVToImagecopy (const mergeYUVToImage &other)
mergeYUVToImageoperator= (const mergeYUVToImage &other)
virtual mergeYUVToImageclone () const
virtual mergeYUVToImagenewInstance () const
virtual bool apply (const matrix< float > &Y, const matrix< float > &U, const matrix< float > &V, image &img) const
virtual bool apply (const matrix< ubyte > &Y, const matrix< ubyte > &U, const matrix< ubyte > &V, image &img) const
virtual bool apply (const float &Y, const float &U, const float &V, rgbaPixel &pixel) const
virtual bool apply (const ubyte &Y, const ubyte &U, const ubyte &V, rgbaPixel &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 rgbaPixel, merging channels(floats) or matrix<ubyte>s(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 CVR-Lib provides all three spaces:

Here, the inverse transformation of cvr::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 cvr::splitImageToYUV.

If you use ubyte values, then this functor is equivalent to cvr::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

cvr::mergeYUVToImage::mergeYUVToImage ( void   ) 

constructor

cvr::mergeYUVToImage::~mergeYUVToImage (  ) 

destructor


Member Function Documentation

virtual bool cvr::mergeYUVToImage::apply ( const ubyte Y,
const ubyte U,
const ubyte V,
rgbaPixel 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 cvr::mergeImage.

virtual bool cvr::mergeYUVToImage::apply ( const float &  Y,
const float &  U,
const float &  V,
rgbaPixel 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 cvr::mergeImage.

virtual bool cvr::mergeYUVToImage::apply ( const matrix< ubyte > &  Y,
const matrix< ubyte > &  U,
const matrix< ubyte > &  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 cvr::mergeImage.

virtual bool cvr::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 cvr::mergeImage.

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

Clip function.

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

virtual mergeYUVToImage* cvr::mergeYUVToImage::clone (  )  const [virtual]

returns a pointer to a clone of the functor.

Implements cvr::mergeImage.

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

copy data of "other" functor.

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

const std::string& cvr::mergeYUVToImage::name (  )  const [virtual]

return the name of this type

Implements cvr::functor.

virtual mergeYUVToImage* cvr::mergeYUVToImage::newInstance (  )  const [virtual]

Returns a pointer to a new instance of this functor.

Implements cvr::mergeImage.

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

alias for copy member

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


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

Generated on Sun Sep 20 22:08:51 2009 for CVR-Lib by Doxygen 1.5.8