Intel® Integrated Performance Primitives (Intel® IPP) Developer Guide and Reference

ID 790148
Date 10/31/2024
Public
Document Table of Contents

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);

IppStatus ippiLabToRGB_32f_P3R(const Ipp32f* pSrc[3], int srcStep[3], Ipp32f* pDst[3], int dstStep[3], IppiSize roiSize);

IppStatus ippiLabToRGB_64f_P3R(const Ipp64f* pSrc[3], int srcStep[3], Ipp64f* pDst[3], int dstStep[3], IppiSize roiSize);

Case 3: Lab to RGB with platform-aware functions

IppStatus ippiLabToRGB_32f_P3R_L(const Ipp32f* pSrc[3], IppSizeL srcStep[3], Ipp32f* pDst[3], IppSizeL dstStep[3], IppiSizeL roiSize);

IppStatus ippiLabToRGB_64f_P3R_L(const Ipp64f* pSrc[3], IppSizeL srcStep[3], Ipp64f* pDst[3], IppSizeL dstStep[3], IppiSizeL roiSize);

Case 4: Lab to RGB with TL functions based on the Platform Aware API

IppStatus ippiLabToRGB_32f_P3R_LT(const Ipp32f* pSrc[3], IppSizeL srcStep[3], Ipp32f* pDst[3], IppSizeL dstStep[3], IppiSizeL roiSize);

IppStatus ippiLabToRGB_64f_P3R_LT(const Ipp64f* pSrc[3], IppSizeL srcStep[3], Ipp64f* pDst[3], IppSizeL dstStep[3], IppiSizeL roiSize);

Case 5: Lab to RGB with TL functions based on the Classic API

IppStatus ippiLabToRGB_32f_P3R_T(const Ipp32f* pSrc[3], int srcStep[3], Ipp32f* pDst[3], int dstStep[3], IppiSize roiSize);

IppStatus ippiLabToRGB_64f_P3R_T(const Ipp64f* pSrc[3], int srcStep[3], Ipp64f* pDst[3], int dstStep[3], IppiSize roiSize);

Include Files

ippcc.h

ippcc_l.h

ippcc_tl.h

Domain Dependencies

Headers: ippcore.h, ippvm.h, ipps.h, ippi.h

Libraries: ippcore.lib, ippvm.lib, ipps.lib, ippi.lib

Parameters

pSrc, pSrc[3]

Pointer to the source image ROI.

srcStep, srcStep[3]

Distance in bytes between starts of consecutive lines in the source image.

pDst, pDst[3]

Pointer to the destination image ROI.

dstStep, dstStep[3]

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, pSrc[3], pDst, or pDst[3] is NULL.

ippStsSizeErr

Indicates an error condition if roiSize has a field with a zero or negative value.