Color space conversion


Defines

#define ROUND(_x)   ((_x) < 0 ? (int) ((_x) - 0.5) : (int) ((_x) + 0.5))
#define CLIP(_x)   ((_x) < 0 ? 0 : ((_x) > 255 ? 255 : ROUND((_x))))

Functions

void convert_RGB_to_YCbCr (coeff_t **R, coeff_t **G, coeff_t **B, coeff_t **Y, coeff_t **Cb, coeff_t **Cr, int width, int height)
void convert_YCbCr_to_RGB (coeff_t **Y, coeff_t **Cb, coeff_t **Cr, coeff_t **R, coeff_t **G, coeff_t **B, int width, int height)
void clip_channel (coeff_t **channel, int width, int height)

Detailed Description


Define Documentation

#define ROUND ( _x   )     ((_x) < 0 ? (int) ((_x) - 0.5) : (int) ((_x) + 0.5))

Round value to the nearest integer

Referenced by round_channel().

#define CLIP ( _x   )     ((_x) < 0 ? 0 : ((_x) > 255 ? 255 : ROUND((_x))))


Function Documentation

void convert_RGB_to_YCbCr ( coeff_t **  R,
coeff_t **  G,
coeff_t **  B,
coeff_t **  Y,
coeff_t **  Cb,
coeff_t **  Cr,
int  width,
int  height 
)

RGB to YCbCr conversion

This function converts image from RGB to YCbCr color space.

Parameters:
R Red channel
G Green channel
B Blue channel
Y Luma channel
Cb Chroma-blue channel
Cr Chroma-red channel
width Image width
height Image height
Returns:
VOID

Referenced by eps_encode_truecolor_block().

void convert_YCbCr_to_RGB ( coeff_t **  Y,
coeff_t **  Cb,
coeff_t **  Cr,
coeff_t **  R,
coeff_t **  G,
coeff_t **  B,
int  width,
int  height 
)

YCbCr to RGB conversion

This function converts image from YCbCr to RGB color space.

Parameters:
Y Luma channel
Cb Chroma-blue channel
Cr Chroma-red channel
R Red channel
G Green channel
B Blue channel
width Image width
height Image height
Returns:
VOID
Note:
On return, all values are enclosed within [0..255] interval.

References CLIP.

Referenced by eps_decode_truecolor_block().

void clip_channel ( coeff_t **  channel,
int  width,
int  height 
)

Channel clipping

This function encloses (clips) each channel value within [0..255] interval with appropriative rounding.

Parameters:
channel Channel to clip
width Image width
height Image height
Returns:
VOID

References CLIP.

Referenced by eps_decode_truecolor_block().


Generated on Fri May 27 14:50:00 2011 for EPSILON by  doxygen 1.5.6