XYZToRGB
Converts an XYZ image to the RGB color model.
Syntax
IppStatus ippiXYZToRGB_<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 |
Include Files
ippcc.h
Domain Dependencies
Headers:
ippcore.h
,
ippvm.h
,
ipps.h
,
ippi.h
Libraries:
ippcore.lib
,
ippvm.lib
,
ipps.lib
,
ippi.lib
Parameters
- 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.
Description
This function operates with ROI (see Regions of Interest in Intel IPP).
This function converts the
CIE
XYZ
image pSrc
to the RGB
image pDst
according to the following basic equations:R = 3.240479 * X - 1.53715 * Y - 0.498535 * Z
G = -0.969256 * X + 1.875991 * Y + 0.041556 * Z
B = 0.055648 * X - 0.204043 * Y + 1.057311 * Z
The equations above are given on the assumption that
X,Y,
and Z
values are in the range [0..1]. In case of the floating-point
data type, the input XYZ
values must already be in the range [0..1]. For integer data types, normalization is done by the conversion function internally.The computed
RGB
values are saturated if they fall out of range [0..1].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”
).Return Values
- ippStsNoErr
- Indicates no error. Any other value indicates an error.
- ippStsNullPtrErr
- Indicates an error condition ifpSrcorpDstisNULL.
- ippStsSizeErr
- Indicates an error condition ifroiSizehas a field with a zero or negative value.