public static void ToRGB( YCbCr ycbcr, RGB rgb )
{
// don't warry about zeros. compiler will remove them
float r = Math.Max( 0.0f, Math.Min( 1.0f, (float) ( ycbcr.Y + 0.0000 * ycbcr.Cb + 1.4022 * ycbcr.Cr ) ) );
float g = Math.Max( 0.0f, Math.Min( 1.0f, (float) ( ycbcr.Y - 0.3456 * ycbcr.Cb - 0.7145 * ycbcr.Cr ) ) );
float b = Math.Max( 0.0f, Math.Min( 1.0f, (float) ( ycbcr.Y + 1.7710 * ycbcr.Cb + 0.0000 * ycbcr.Cr ) ) );
rgb.Red = (byte) ( r * 255 );
rgb.Green = (byte) ( g * 255 );
rgb.Blue = (byte) ( b * 255 );
rgb.Alpha = 255;
}