RGBToYCbCr_JPEG

Convert RGB to YCbCr (JPEG)

Supported Technologies

MT, SSE2

Synopsis

FwStatus   fwiRGBToYCbCr_JPEG_8u_P3R ( const Fw8u * const pSrcRGB[3]int srcStepFw8u * pDstYCbCr[3]int dstStepFwiSize roiSize );
FwStatus   fwiRGBToYCbCr_JPEG_8u_C3P3R ( const Fw8u * pSrcRGBint srcStepFw8u * const pDstYCbCr[3]int dstStepFwiSize roiSize );

Parameters

dstStep   Destination buffer step size (width of the buffer in bytes).
pDstYCbCr[3]   Pointer to destination image ROI for YCbCr image format (three-channel planar).
pSrcRGB   Pointer to source image ROI for RGB image format.
pSrcRGB[3]   Pointer to source image ROI for RGB image format (three-channel planar).
roiSize   Specifies the height and width of an ROI.
srcStep   Source buffer step size (width of the buffer in bytes).

Description

These functions step through an ROI in a source buffer, convert the source data from the RGB color model to the YCbCr color space, and write the converted data to a destination buffer.

The following formulas are used to convert red, green, and blue values to luminance and chrominance values.

 Y = 0.299*R + 0.587*G + 0.114*B
 Cb = -0.16874*R - 0.33126*G + 0.5*B + 128
 Cr = 0.5*R - 0.41869*G - 0.08131*B + 128