Converts an RGB image to the YCC color model.
IppStatus ippiRGBToYCC_<mod>(const Ipp<datatype>* pSrc, int srcStep, Ipp<datatype>* pDst, int dstStep, IppiSize roiSize);
Supported values for mod:
8u_C3R | 16u_C3R | 16s_C3R | 32f_C3R |
8u_AC4R | 16u_AC4R | 16s_AC4R | 32f_AC4R |
pSrc |
Pointer to the source image ROI. |
srcStep |
Distance in bytes between starts of consecutive lines in the source image. |
pDst |
Pointer to the destination image ROI. |
dstStep |
Distance in bytes between starts of consecutive lines in the destination image. |
roiSize |
Size of the source and destination ROI in pixels. |
The function ippiRGBToYCC is declared in the ippcc.h file. It operates with ROI (see Regions of Interest in Intel IPP).
This function converts the gamma-corrected R'B'G' image pSrc to the PhotoY'C'C' image pDst according to the following basic equations:
Y' = 0.299*R' + 0.587*G' + 0.114*B'
C1' = -0.299*R' - 0.587*G' + 0.886*B' = B'- Y
C2' = 0.701*R' - 0.587*G' - 0.114*B' = R'- Y
The equations above are given on the assumption that R',G', and B' values are normalized to the range [0..1]. In case of the floating-point data type, the input R'G'B' values must already be in the range [0..1]. For integer data types, normalization is done by the conversion function internally.
The computed Y', C1', C2' values are then quantized and converted to fit in the range [0..1] as follows:
Y' = 1. / 1.402 * Y'
C1' = 111.4 / 255. * C1' + 156. / 255.
C2' = 135.64 /255. * C2' + 137. / 255.
In case of integer function flavors, these values are then scaled to the full range of the destination data type (see Table “Image Data Types and Ranges”).
ippStsNoErr |
Indicates no error. Any other value indicates an error. |
ippStsNullPtrErr |
Indicates an error condition if pSrc or pDst is NULL. |
ippStsSizeErr |
Indicates an error condition if roiSize has a field with a zero or negative value. |
Copyright © 2000 - 2011, Intel Corporation. All rights reserved.