RGBToRGB565, BGRToBGR565

Convert 24-bit per pixel image to the 16-bit image.

Syntax

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

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

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

The functions ippiRGBToRGB565 and ippiBGRToBGR565 are declared in the ippcc.h file. They operate with ROI (see Regions of Interest in Intel IPP).

This function converts the 24-bit per pixel gamma-corrected R'G'B' (B'G'R') image pSrc to the packed 16-bit image pDst: all 3 channel intensities for a pixel are packed into two consecutive bytes (16u data type). The destination image has format RGB565 (BGR565) - 5 bits for blue, 6 bits for green, 5 bits for red (see Figure Converting an RGB Image to Gray Scale for more details).

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.

ippStsStepErr

Indicates an error condition if one of srcStep or dstStep is less than or equal to 0.

Submit feedback on this help topic

Copyright © 2000 - 2011, Intel Corporation. All rights reserved.