pub trait Stimulus: Zero {
// Required method
fn max_intensity() -> Self;
}
Expand description
Color components that represent a stimulus intensity.
The term “stimulus” comes from “tristimulus”, literally a set of three stimuli, which is a term for color spaces that measure the intensity of three primary color values. Classic examples of tristimulus color space are XYZ and RGB.
Stimulus values are expected to have these properties:
- Has a typical range from
0
to some finite maximum, the “max intensity”. This represents a range from0%
to100%
. For example0u8
to255u8
,0.0f32
to1.0f32
. - Values below
0
are considered invalid for display purposes, but may still be used in calculations. - Values above the “max intensity” are sometimes supported, depending on the application. For example in 3D rendering, where high values represent intense light.
- Unsigned integer values (
u8
,u16
,u32
, etc.) have a range from0
to their largest representable value. For example0u8
to255u8
or0u16
to65535u16
. - Real values (
f32
,f64
, fixed point types, etc.) have a range from0.0
to1.0
.
Required Methods§
sourcefn max_intensity() -> Self
fn max_intensity() -> Self
The highest displayable value this component type can reach. Integers types are expected to return their maximum value, while real numbers (like floats) return 1.0. Higher values are allowed, but they may be lowered to this before converting to another format.
Object Safety§
This trait is not object safe.