Developer Reference

  • 2020
  • 07/15/2020
  • Public Content
Contents

LUVToRGB, LUVToBGR

Converts a LUV image to the RGB or BGR color model.

Syntax

Case 1: LUV to RGB
IppStatus ippiLUVToRGB_<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
Case 2: LUV to BGR
IppStatus ippiLUVToBGR_<mod>(const Ipp<datatype>*
pSrc
, int
srcStep
, Ipp<datatype>*
pDst
, int
dstStep
, IppiSize
roiSize
);
Supported values for
mod
:
8u_C3R
32f_C3R
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 LUV
image
pSrc
to the
RGB
or
BGR
image
pDst
in two steps. First, the conversion is carried out into
CIE XYZ
format.
To accomplish it,
LUV
components are transformed back into their original range. This is done for different data types in the following way.
For
8u
data type:
L = L * 100./ IPP_MAX_8U
U = (U * 354./ IPP_MAX_8U) - 134.
V = (V * 262./ IPP_MAX_8U) - 140.
For
16u
data type:
L = L * 100./ IPP_MAX_16U
U = (U * 354./ IPP_MAX_16U) - 134.
V = (V * 262./ IPP_MAX_16U) - 140.
For
16s
data type:
L = (L - IPP_MIN_16S)* 100./ IPP_MAX_16U
U = ((U - IPP_MIN_16S)* 354./ IPP_MAX_16U) - 134.
V = ((V - IPP_MIN_16S) * 262./ IPP_MAX_16U) - 140.
After that, conversion to
XYZ
format takes place as follows:
Y = Y
n
* ((L + 16.) / 116.)**3.
X = -9.* Y * u / ((u - 4.)* v - u* v )
Z = (9.* Y - 15*v*Y - v*X) / 3. * v
where
u = U / (13.* L) + u
n
v = V / (13.* L) + v
n
and
u
n
= 4.*x
n
/ (-2.*x
n
+ 12.*y
n
+ 3.)
v
n
= 9.*y
n
/ (-2.*x
n
+ 12.*y
n
+ 3.)
Here
x
n
= 0.312713,
y
n
= 0.329016 are the CIE chromaticity coordinates of the D65 white point, and
Y
n
= 1.0 is the luminance of the D65 white point.
After this intermediate conversion is done, the obtained
XYZ
image is then converted to the destination
RGB
or
BGR
format using equations defined for the
ippiXYZToRGB
function.
Return Values
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.

Product and Performance Information

1

Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.

Notice revision #20110804