pub trait DisplayStrategy<P: Copy> {
// Required method
fn to_display(&self, pixel: &P) -> Srgba8;
}Expand description
Named conversion from any pixel type to Srgba8 for display.
This follows fovea Philosophy #4: conversions are named, data loss never happens silently. Every pixel type requires an explicit strategy to become displayable.
The output is always Srgba8 because displays are sRGB devices.
§Design note
This is intentionally separate from ConvertPixel<P, Srgba8>. See
the TODO.md “Why not reuse ConvertPixel?” section for rationale.
Required Methods§
Sourcefn to_display(&self, pixel: &P) -> Srgba8
fn to_display(&self, pixel: &P) -> Srgba8
Convert a single pixel to display-ready Srgba8.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".