man pages section 3: Multimedia Library Functions

Exit Print View

Updated: July 2014
 
 

mlib_VideoColorCMYK2JFIFYCCK444 (3MLIB)

Name

mlib_VideoColorCMYK2JFIFYCCK444 - CMYK to JFIF YCbCr color conversion

Synopsis

cc [ flag... ] file... –lmlib [ library... ]
#include <mlib.h>

mlib_status mlib_VideoColorCMYK2JFIFYCCK444(mlib_u8 *y, mlib_u8 *cb,
     mlib_u8 *cr, mlib_u8 *k, const mlib_u8 *cmyk, mlib_s32 n);

Description

The mlib_VideoColorCMYK2JFIFYCCK444() function performs color space conversion from CMYK to YCbCrK when used in the JPEG File Interchange Format (JFIF).

The following equation is used:

R  = (255 - C)
G  = (255 - M)
B  = (255 - Y)
Y  =  0.29900 * R + 0.58700 * G + 0.11400 * B
Cb = -0.16874 * R - 0.33126 * G + 0.50000 * B  + 128
Cr =  0.50000 * R - 0.41869 * G - 0.08131 * B  + 128
K  = K

Parameters

The function takes the following arguments:

y

Pointer to destination Y component row. y must be 8-byte aligned.

cb

Pointer to destination Cb component row. cb must be 8-byte aligned.

cr

Pointer to destination Cr component row. cr must be 8-byte aligned.

k

Pointer to destination K component row. k must be 8-byte aligned.

cmyk

Pointer to source CMYK multi-component row. cmyk must be 8-byte aligned.

n

Length of Y,Cb,Cr, and K component rows. The length of the CMYK multi-component row must be 4*n.

Return Values

The function returns MLIB_SUCCESS if successful. Otherwise it returns MLIB_FAILURE.

Attributes

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Interface Stability
Committed
MT-Level
MT-Safe

See also

mlib_VideoColorJFIFYCCK2CMYK444(3MLIB), attributes(5)