Developer Reference for Intel® Integrated Performance Primitives 2018

LabToBGR, LabToRGB

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

Syntax

Case 1: Lab to BGR

IppStatus ippiLabToBGR_8u_C3R(const Ipp8u* pSrc, int srcStep, Ipp8u* pDst, int dstStep, IppiSize roiSize);

IppStatus ippiLabToBGR_16u8u_C3R(const Ipp16u* pSrc, int srcStep, Ipp8u* pDst, int dstStep, IppiSize roiSize);

IppStatus ippiLabToBGR_32f_C3R(const Ipp32f* pSrc, int srcStep, Ipp32f* pDst, int dstStep, IppiSize roiSize);

Case 2: Lab to RGB

IppStatus ippiLabToRGB_8u_C3R(const Ipp8u* pSrc, int srcStep, Ipp8u* pDst, int dstStep, IppiSize roiSize);

IppStatus ippiLabToRGB_32f_C3R(const Ipp32f* pSrc, int srcStep, Ipp32f* pDst, int dstStep, IppiSize roiSize);

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 Lab image pSrc to the BGR or RGB image pDst in two steps. First, the conversion is carried out into CIE XYZ format.

To accomplish it, Lab 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./255.

a = a - 128.

b = b - 128.

For 16u data type:

L = L * 100./65535.

a = (a/255. - 128.)

b = (b/255.) - 128.)

After that, conversion to XYZ format takes place as follows:

Y = Yn* P3.

X = Xn*(P + a/500.)3.

Z = Zn*(P - b/200.)3.

where

P = (L +16)/116.

After this intermediate conversion is done, the obtained XYZ image is then converted to the destination BGR or RGB 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.