Beispiel #1
0
 void yiq2rgb(double y, double i, double q, Pixel pixel)
 {
     double dr, dg, db;
     #if YUV
     dr = (y + 1.140 * q);
     dg = (y - 0.395 * i - 0.581 * q);
     db = (y + 2.032 * i);
     #else
     dr = (y + 0.956 * i + 0.621 * q);
     dg = (y - 0.272 * i - 0.647 * q);
     db = (y - 1.105 * i + 1.702 * q);
     #endif
     pixel.Red = (int) (255 * dr);
     pixel.Green = (int) (255 * dg);
     pixel.Blue = (int) (255 * db);
     pixel.Clamp0255();
 }