3ds Max C++ API Reference
Loading...
Searching...
No Matches
LogLUV32Pixel Struct Reference

#include <color.h>

Public Member Functions

 operator Color () const
 
LogLUV32Pixeloperator= (const float c[3])
 
void GetRGB (float rgb[3]) const
 
void SetRGB (const float rgb[3])
 
void GetXYZ (float xyz[3]) const
 
void SetXYZ (const float xyz[3])
 

Static Public Member Functions

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

Public Attributes

uint32_t value
 Storage for the pixel value.
 

Detailed Description

See also
Class Color.
Remarks
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.

Member Function Documentation

◆ operator Color()

operator Color ( ) const
inline
Remarks
This method will return the pixel format as a Color.
598 {
599 Color c;
600 GetRGB(c);
601 return c;
602 }
Definition: color.h:73
void GetRGB(float rgb[3]) const

◆ operator=()

LogLUV32Pixel & operator= ( const float  c[3])
inline
Remarks
Assignment operator.
Parameters:
const float c[3]
The array of color values to assign in RGB order.
609 {
610 SetRGB(c);
611 return *this;
612 }
void SetRGB(const float rgb[3])

◆ GetRGB()

void GetRGB ( float  rgb[3]) const
Remarks
Retrieves the RGB space values.
Parameters:
float rgb[3]
The results are stored here.

◆ SetRGB()

void SetRGB ( const float  rgb[3])
Remarks
Sets the RGB space values.
Parameters:
const float rgb[3]
The values to set.

◆ GetXYZ()

void GetXYZ ( float  xyz[3]) const
Remarks
Retrieves the XYZ space values.
Parameters:
const float xyz[3]
The results are stored here.

◆ SetXYZ()

void SetXYZ ( const float  xyz[3])
Remarks
Sets the XYZ space values.
Parameters:
const float xyz[3]
The values to set.

◆ XYZtoRGB()

static void XYZtoRGB ( const float  xyz[3],
float  rgb[3] 
)
static
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.

◆ RGBtoXYZ()

static void RGBtoXYZ ( const float  rgb[3],
float  xyz[3] 
)
static
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.

Member Data Documentation

◆ value

uint32_t value

Storage for the pixel value.