Applies a color twist matrix to an image with integer pixel values.
Case 1: Not-in-place operation on pixel-order data
IppStatus ippiColorTwist32f_<mod>(const Ipp<datatype>* pSrc, int srcStep, Ipp<datatype>* pDst, int dstStep, IppiSize roiSize, const Ipp32f twist[3][4]);
Supported values for mod:
8u_C3R | 8s_C3R | 16u_C3R | 16s_C3R |
8u_AC4R | 8s_AC4R | 16u_AC4R | 16s_AC4R |
Case 2: Not-in-place operation on planar data
IppStatus ippiColorTwist32f_<mod>(const Ipp<datatype>* const pSrc[3], int srcStep, Ipp<datatype>* const pDst[3], int dstStep, IppiSize roiSize, const Ipp32f twist[3][4]);
Supported values for mod :
8u_P3R | 8s_P3R | 16u_P3R | 16s_P3R |
Case 3: In-place operation on pixel-order data
IppStatus ippiColorTwist32f_<mod>(Ipp<datatype>* pSrcDst, int srcDstStep, IppiSize roiSize, const Ipp32ftwist[3][4]);
Supported values for mod :
8u_C3IR | 8s_C3IR | 16u_C3IR | 16s_C3IR |
8u_AC4IR | 8s_AC4IR | 16u_AC4IR | 16s_AC4IR |
Case 4: In-place operation on planar data
IppStatus ippiColorTwist32f_<mod>(Ipp<datatype>* const pSrcDst[3], int srcDstStep, IppiSize roiSize, const Ipp32f twist[3][4]);
Supported values for mod :
8u_IP3R | 8s_IP3R | 16u_IP3R | 16s_IP3R |
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. |
pSrcDst |
Pointer to the source and destination image ROI for the in-place operation. |
srcDstStep |
Distance in bytes between starts of consecutive lines in the source and destination image for the in-place operation. |
roiSize |
Size of the source and destination ROI in pixels. |
twist |
The array containing color-twist matrix elements. |
The function ippiColorTwist32f is declared in the ippcc.h file. It operates with ROI (see Regions of Interest in Intel IPP).
This function applies the color-twist matrix to all three color channel values in the integer source image to obtain the resulting data in the destination image. For example, the conversion from the RGB to the YCbCr format can be done as
Y = 0.299*R + 0.587*G + 0.114*B
Cb = - 0.16874*R - 0.33126*G + 0.5*B + 0.5
Cr = 0.5*R - 0.41869*G - 0.08131*B + 0.5
which can be described in terms of the following color twist matrix:
0.29900f 0.58700f 0.11400f 0.000f -0.16874f -0.33126f 0.50000f 128.0f 0.50000f -0.41869f -0.08131f 128.0f
Color-twist matrices may also be used to perform many other color conversions.
ippStsNoErr |
Indicates no error. Any other value indicates an error. |
ippStsNullPtrErr |
Indicates an error condition if pSrc, pDst, or pSrcDst 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.