Convert RGB to grayscale
SSE2
FwStatus | fwiRGBToY_JPEG_8u_P3C1R | ( | const Fw8u * const pSrcRGB[3], int srcStep, Fw8u * pDstY, int dstStep, FwiSize roiSize ); | |
FwStatus | fwiRGBToY_JPEG_8u_C3C1R | ( | const Fw8u * pSrcRGB, int srcStep, Fw8u * pDstY, int dstStep, FwiSize roiSize ); |
dstStep | Destination buffer step size (width of the buffer in bytes). | |
pDstY | Pointer to destination image ROI for grayscale image format. | |
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). |
These functions step through an ROI in a source buffer, convert the source data from RGB to grayscale luminance values, and write the converted data to a destination buffer.
The following formula is used to convert red, green, and blue values to luminance values.
Y = 0.299*R + 0.587*G + 0.114*B