Trait colstodian::State[][src]

pub trait State: Default + Display {
    const STATE: DynamicState;
}
Expand description

A type that implements this trait represents a color’s State.

All colors have units. Sometimes a color’s units are explicit, such as measuring the emitted light from a display using a spectroradiometer and being able to reference pixel values in CIE XYZ cd/m2. Other times, the units are only indirectly related to the real world, and then providing a mathematical conversion to measurable quantities. For example, in the case of display technology, common color encodings (relations of code value to measurable XYZ performance) include sRGB, DCI-P3, and BT.2020.

Howver, considering color as a displayed quantity only provides part of the color encoding story. In addition to relating RGB values to display measurements, one can also relate RGB values to the performance characteristics of an input device (i.e., a camera, or a virtual camera in a 3d renderer). Input colorimetry can be measured in real world units as well. In the case of a 3d renderer, these units are often (or at least should be) defined in the renderer as a radiometric quantity like radiance, with the relation to XYZ values dictated by a linear transformation to the rendering color space. Even in the case of a real world camera, it is not difficult to measure an input spectra with the spectrophotometer in XYZ, and then compare this to the RGB values output from the camera.

It is a meaningful abstraction to categorize color spaces by the “direction” of this relationship to real world quantities, which we refer to as State. Colors which are defined in relation to display characteristic are called Display-referred, while color spaces which are defined in relation to input devices (scenes) are Scene-referred.

Associated Constants

Implementors