latest version v1.9 - last update 10 Apr 2010 |
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>
Public Member Functions | |
mergeYUVToImage (void) | |
~mergeYUVToImage () | |
virtual const char * | getTypeName () const |
mergeYUVToImage & | copy (const mergeYUVToImage &other) |
mergeYUVToImage & | operator= (const mergeYUVToImage &other) |
virtual functor * | clone () 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 |
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
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.
lti::mergeYUVToImage::mergeYUVToImage | ( | void | ) |
constructor
lti::mergeYUVToImage::~mergeYUVToImage | ( | ) |
destructor
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
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
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().
ubyte lti::mergeYUVToImage::clip | ( | const int | val | ) | const [inline, protected] |
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.
other | the functor to be copied |
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
other | the functor to be copied |
Reimplemented from lti::mergeImage.