ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/cal/cal/rgb_ycc.cal
Revision: 1.1
Committed: Thu Nov 25 14:44:57 2004 UTC (19 years, 4 months ago) by greg
Branch: MAIN
CVS Tags: rad5R4, rad5R2, rad4R2P2, rad5R0, rad5R1, rad3R7P2, rad3R7P1, rad4R2, rad4R1, rad4R0, rad3R8, rad3R9, rad4R2P1, rad5R3, HEAD
Log Message:
Added functions to convert between RGB and YCC color spaces

File Contents

# Content
1 { RCSid $Id$ }
2 {
3 Convert between RGB and YCbCr color spaces
4
5 Greg Ward Sept. 2004
6 }
7 YCC2R(Y,Cb,Cr) : Y + 1.402*Cr;
8 YCC2G(Y,Cb,Cr) : Y - 0.34413*Cb - 0.71438*Cr;
9 YCC2B(Y,Cb,Cr) : Y + 1.772*Cb;
10 RGB2Y(R,G,B) : 0.299*R + 0.587*G + 0.114*B;
11 RGB2Cb(R,G,B) : -0.16874*R + -0.33126*G + 0.5*B;
12 RGB2Cr(R,G,B) : 0.5*R + -0.41869*G + -0.08131*B;