Convert CMYK to YCCK (JPEG)
SSE2
FwStatus | fwiCMYKToYCCK_JPEG_8u_P4R | ( | const Fw8u * const pSrcCMYK[4], int srcStep, Fw8u * pDstYCCK[4], int dstStep, FwiSize roiSize ); | |
FwStatus | fwiCMYKToYCCK_JPEG_8u_C4P4R | ( | const Fw8u * const pSrcCMYK, int srcStep, Fw8u * const pDstYCCK[4], int dstStep, FwiSize roiSize ); |
dstStep | Destination buffer step size (width of the buffer in bytes). | |
pDstYCCK[4] | Pointer to destination image ROI for YCCK image format (four-channel planar). | |
pSrcCMYK | Pointer to source image ROI for CMYK image format. | |
pSrcCMYK[4] | Pointer to source image ROI for CMYK image format (four-channel planar). | |
roiSize | Specifies the height and width of an ROI. | |
srcStep | Source buffer step size (width of the buffer in bytes). |
These function step through an ROI in a source buffer, convert source data from the CMYK color model to the YCCK color space, and write the converted data to a destination buffer.
The following formulas are used to convert cyan, magenta, and yellow values to red, green, and blue values.
R = 255 - C G = 255 - M B = 255 - Y
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
The black (K) channel value remains the same during conversion.