|
latest version v1.9 - last update 10 Apr 2010 |
|
Computes the YCbCr values from a given RGB color representation (rgbPixel). More...
#include <ltiSplitImageToYCbCr.h>


Public Member Functions | |
| splitImageToYCbCr () | |
| splitImageToYCbCr (const splitImageToYCbCr &other) | |
| virtual | ~splitImageToYCbCr () |
| virtual const char * | getTypeName () const |
| splitImageToYCbCr & | copy (const splitImageToYCbCr &other) |
| splitImageToYCbCr & | operator= (const splitImageToYCbCr &other) |
| virtual functor * | clone () const |
| virtual bool | apply (const rgbPixel &pixel, float &c1, float &c2, float &c3) const |
| virtual bool | apply (const rgbPixel &pixel, ubyte &c1, ubyte &c2, ubyte &c3) const |
| virtual bool | apply (const image &img, channel &c1, channel &c2, channel &c3) const |
| virtual bool | apply (const image &img, channel8 &c1, channel8 &c2, channel8 &c3) const |
Computes the YCbCr values from a given RGB color representation (rgbPixel).
In the literature, technical and scientific, there is often confusion among the color spaces YUV, YCbCr 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:
This functor splits an RGB images into the color space YCbCr (ITU-RS601) using the conversion equations given by the above mentioned reference:
Note that the Y values will have an excursion of 219 with an offset of 16, while the Cb and Cr values will have an excursion of +/-112 with an offset of 128.
The Cb value corresponds to U, and Cr to V, in case you need to provide them with "wrong" names.
| lti::splitImageToYCbCr::splitImageToYCbCr | ( | ) |
default constructor
| lti::splitImageToYCbCr::splitImageToYCbCr | ( | const splitImageToYCbCr & | other | ) |
copy constructor
| other | the object to be copied |
| virtual lti::splitImageToYCbCr::~splitImageToYCbCr | ( | ) | [virtual] |
destructor
| virtual bool lti::splitImageToYCbCr::apply | ( | const image & | img, | |
| channel8 & | c1, | |||
| channel8 & | c2, | |||
| channel8 & | c3 | |||
| ) | const [virtual] |
Split image into 8-bit channels.
N.B.: when casting the transformation result to unsigned shorts (8-bit channel) major rounding errors will occur.
As a result, the merging operation might produce negative values or values > 1, which are truncated subsequently. When accurate Y, U and V values are required, prefer float values.
Implements lti::splitImage.
| virtual bool lti::splitImageToYCbCr::apply | ( | const image & | img, | |
| channel & | c1, | |||
| channel & | c2, | |||
| channel & | c3 | |||
| ) | const [virtual] |
split pixel into float channels
Implements lti::splitImage.
| bool lti::splitImageToYCbCr::apply | ( | const rgbPixel & | pixel, | |
| ubyte & | c1, | |||
| ubyte & | c2, | |||
| ubyte & | c3 | |||
| ) | const [inline, virtual] |
Split pixel into 8-bit values (between 0 and 255).
N.B.: when casting the transformation result to unsigned shorts (8-bit channel) major rounding errors will occur.
As a result, the merging operation might produce negative values or values > 1, which are truncated subsequently.
When accurate Y, U and V values are required, prefer float values
Implements lti::splitImage.
References lti::rgbPixel::getBlue(), lti::rgbPixel::getGreen(), and lti::rgbPixel::getRed().
| bool lti::splitImageToYCbCr::apply | ( | const rgbPixel & | pixel, | |
| float & | c1, | |||
| float & | c2, | |||
| float & | c3 | |||
| ) | const [inline, virtual] |
split pixel into float values (between 0 and 1)
Implements lti::splitImage.
References lti::rgbPixel::getBlue(), lti::rgbPixel::getGreen(), and lti::rgbPixel::getRed().
| virtual functor* lti::splitImageToYCbCr::clone | ( | ) | const [virtual] |
returns a pointer to a clone of this functor.
Implements lti::functor.
| splitImageToYCbCr& lti::splitImageToYCbCr::copy | ( | const splitImageToYCbCr & | other | ) |
copy data of "other" functor.
| other | the functor to be copied |
Reimplemented from lti::splitImage.
| virtual const char* lti::splitImageToYCbCr::getTypeName | ( | ) | const [virtual] |
returns the name of this type ("splitImageToYCbCr")
Reimplemented from lti::splitImage.
| splitImageToYCbCr& lti::splitImageToYCbCr::operator= | ( | const splitImageToYCbCr & | other | ) |
alias for copy member
| other | the functor to be copied |
Reimplemented from lti::splitImage.