~ubuntu-branches/ubuntu/saucy/openexr/saucy

« back to all changes in this revision

Viewing changes to IlmImf/ImfChromaticities.h

  • Committer: Bazaar Package Importer
  • Author(s): Adeodato Simó
  • Date: 2008-03-24 23:00:21 UTC
  • mfrom: (3.1.2 lenny)
  • Revision ID: james.westby@ubuntu.com-20080324230021-gnofz9mnvcj1xlv3
Tags: 1.6.1-3
Disable (hopefully temporarily) the test suite on arm and ia64.

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
//
44
44
//-----------------------------------------------------------------------------
45
45
 
46
 
#include <ImathVec.h>
47
 
#include <ImathMatrix.h>
 
46
#include "ImathVec.h"
 
47
#include "ImathMatrix.h"
48
48
 
49
49
namespace Imf {
50
50
 
51
51
   
52
52
struct Chromaticities
53
53
{
 
54
    //-----------------------------------------------
 
55
    // The CIE x and y coordinates of the RGB triples
 
56
    // (1,0,0), (0,1,0), (0,0,1) and (1,1,1).
 
57
    //-----------------------------------------------
 
58
 
54
59
    Imath::V2f  red;
55
60
    Imath::V2f  green;
56
61
    Imath::V2f  blue;
57
62
    Imath::V2f  white;
58
63
 
 
64
    //--------------------------------------------
 
65
    // Default constructor produces chromaticities
 
66
    // according to Rec. ITU-R BT.709-3
 
67
    //--------------------------------------------
 
68
 
59
69
    Chromaticities (const Imath::V2f &red   = Imath::V2f (0.6400f, 0.3300f),
60
70
                    const Imath::V2f &green = Imath::V2f (0.3000f, 0.6000f),
61
71
                    const Imath::V2f &blue  = Imath::V2f (0.1500f, 0.0600f),
100
110
// 
101
111
//      YYZtoRGB(c,Y) returns RGBtoXYZ(c,Y).inverse().
102
112
// 
103
 
// Warning:
104
 
// 
105
 
//      It would seem that RGBtoXYZ() and XYZtoRGB() are all you need
106
 
//      to convert RGB values with one set of primary and white point
107
 
//      chromaticities into perceptually equivalent RGB values with
108
 
//      different primary and white point chromaticities:
109
 
// 
110
 
//          M44f M = RGBtoXYZ (chromaticities1, Y1) *
111
 
//                   XYZtoRGB (chromaticities2, Y2);
112
 
// 
113
 
//      However, this simple conversion does not account for white point
114
 
//      adaptation, and produces undesirable results.  The proper thing
115
 
//      to do is to perform a Bradford or a von Kries transform, which
116
 
//      moves the white point of the original color space to the white
117
 
//      point of the destination color space, dragging other colors with
118
 
//      it in a sensible fashion.  
119
 
//
120
113
 
121
114
Imath::M44f     RGBtoXYZ (const Chromaticities chroma, float Y);
122
115
Imath::M44f     XYZtoRGB (const Chromaticities chroma, float Y);