Structure LogLUV32Pixel

3DS Max Plug-In SDK

Structure LogLUV32Pixel

See Also: Class Color.

struct LogLUV32Pixel

Description:

This structure is available in release 4.0 and later only.

This structure is a 32 bit pixel format that stores 1 bit for sign, 15 bits for the log of the luminance, and 16 bits of chroma.

This class stores colors in XYZ space. XYZ color space is the space define by the CIE by the red (X), green (Y) and blue (Z) response curves of the eye. So to calculate a color in XYZ space, you take the incoming light, multiply it by each response curvey and integrate the result over the visible spectrum. There are several RGB spaces, all depending on what XYZ coordinates get assigned to the red, green and blue primaries of the space. The transformations between XYZ and RGB space are all linear and can be represented as 3 by 3 matrices.

The mapping used by XYZtoRGB and RGBtoXYZ is for CCIR-709 primaries and was taken from the code in the tiff reader for the LogLUV32 format. Both XYZ and RGB methods are supplied, so developers can supply different XYZ to RGB transforms, if desired.

This transform is important, because in the LogLUV32 format the log is taken of the Y coordinate in XYZ space. So, it is important that Y not be 0. The transform helps guarantee this. In fact, Y is zero only when r, g and b are all 0.

Methods:

public:

Data Members:

DWORD32 value;

Storage for the pixel value.

Prototype:

operator Color() const;

Remarks:

Returns this pixel format as a Color.

Prototype:

LogLUV32Pixel& operator=(const float c[3]) { SetRGB(c); return *this; };

Remarks:

Assignment operator.

Parameters:

const float c[3]

The array of color values to assign in RGB order.

Prototype:

void GetRGB(float rgb[3]) const;

Remarks:

Retrieves the RGB space values.

Parameters:

float rgb[3]

The results are stored here.

Prototype:

void SetRGB(const float rgb[3]);

Remarks:

Sets the RGB space values.

Parameters:

const float rgb[3]

The values to set.

Prototype:

void GetXYZ(float xyz[3]) const;

Remarks:

Retrieves the XYZ space values.

Parameters:

const float xyz[3]

The results are stored here.

Prototype:

void SetXYZ(const float xyz[3]);

Remarks:

Sets the XYZ space values.

Parameters:

const float xyz[3]

The values to set.

Prototype:

static void XYZtoRGB(const float xyz[3], float rgb[3]);

Remarks:

This method converts from XYZ space to RGB space.

Parameters:

const float xyz[3]

The input values to convert.

float rgb[3]

The output values are stored here.

Prototype:

static void RGBtoXYZ(const float rgb[3], float xyz[3]);

Remarks:

This method converts from RGB space to XYZ space.

Parameters:

const float rgb[3]

The input values to convert.

float xyz[3]

The output values are stored here.