B
Ben newsam
In defining a "colour space", I need a class with x and y components
of Red, Green, and Blue, and
also the x & y components of the "white point". In C++, I would do
something like this:
#define IlluminantC 0.3101, 0.3162
#define IlluminantD65 0.3127, 0.3291
#define IlluminantD93 0.2832, 0.2972
static CColourSpace NTSCSystem ( 0.67, 0.33, 0.21, 0.71, 0.14,
0.08, IlluminantC );
static CColourSpace SMPTEsystem ( 0.630, 0.340, 0.310, 0.595, 0.155,
0.070, IlluminantD65 );
static CColourSpace MySystem ( 0.64, 0.33, 0.29, 0.60, 0.15, 0.06,
IlluminantD65 );
CColourSpace::CColourSpace ( double dXR, double dYR, double dXG,
double dYG, double dXB, double dYB, double dXW, double dYW )
{
m_Red.m_dx = dXR;
<...Detail snipped...>
}
Notice how I am able to refer to, say, IlluminantD65 without having to
worry about the contents.
My question is of course, if you hadn't guessed already, how do I do
that in C#?
of Red, Green, and Blue, and
also the x & y components of the "white point". In C++, I would do
something like this:
#define IlluminantC 0.3101, 0.3162
#define IlluminantD65 0.3127, 0.3291
#define IlluminantD93 0.2832, 0.2972
static CColourSpace NTSCSystem ( 0.67, 0.33, 0.21, 0.71, 0.14,
0.08, IlluminantC );
static CColourSpace SMPTEsystem ( 0.630, 0.340, 0.310, 0.595, 0.155,
0.070, IlluminantD65 );
static CColourSpace MySystem ( 0.64, 0.33, 0.29, 0.60, 0.15, 0.06,
IlluminantD65 );
CColourSpace::CColourSpace ( double dXR, double dYR, double dXG,
double dYG, double dXB, double dYB, double dXW, double dYW )
{
m_Red.m_dx = dXR;
<...Detail snipped...>
}
Notice how I am able to refer to, say, IlluminantD65 without having to
worry about the contents.
My question is of course, if you hadn't guessed already, how do I do
that in C#?
