File ColorSpace.str
Version 1.0


This file contains components for converting between various different color spaces.


Component Summary
int->int RGBtoYCbCr
          Converts a pixel in RGB format to a pixel in YCbCr format according to Recommendation ITU-R BT.
int->int YCbCrtoRGB
          Converts a pixel in YCbCr format to a pixel in RGB format according to Recommendation ITU-R BT.

Component Detail

RGBtoYCbCr

int->int RGBtoYCbCr
Converts a pixel in RGB format to a pixel in YCbCr format according to Recommendation ITU-R BT.709 for color space transformations. This is the default transformation that should be used for MPEG-2 videos. This transformation is given in Table 6-9 on P.47 of the MPEG-2 13818-2 IEEE specification (entry #1).

Input:
<int> - Three integers in RGB color space and order.
Output:
<int> - Three integers in YCbCr color space and order.

YCbCrtoRGB

int->int YCbCrtoRGB
Converts a pixel in YCbCr format to a pixel in RGB format according to Recommendation ITU-R BT.709 for color space transformations. This is the default transformation that should be used for MPEG-2 videos. This transformation is given in Table 6-9 on P.47 of the MPEG-2 13818-2 IEEE specification (entry #1). The recommendation specifies the transform from RGB to YCbCR. This function's transformation coefficients were calculated using MATLAB and an inverse matrix transform based on the RGB to YCbCr conversion.

Input:
<int> - Three integers in YCbCr color space and order.
Output:
<int> - Three integers in RGB color space and order.

Please contact the author (Matthew Drake) for more information.