pub trait IntoRawBytes: PixelColor + Sized {
type Raw: AsRef<[u8]> + AsMut<[u8]> + Copy + Default;
const BYTES_PER_PIXEL: usize;
// Required method
fn into_raw_bytes(self) -> <Self as IntoRawBytes>::Raw;
}
Expand description
A trait for converting a PixelColor
into its raw byte representation.
This trait is the bridge between embedded-graphics
color types and a raw byte
buffer. By implementing this trait for a color, you define how it should be serialized
into bytes for the display.
Required Associated Constants§
Sourceconst BYTES_PER_PIXEL: usize
const BYTES_PER_PIXEL: usize
The number of bytes used to represent one pixel of this color.
Required Associated Types§
Required Methods§
Sourcefn into_raw_bytes(self) -> <Self as IntoRawBytes>::Raw
fn into_raw_bytes(self) -> <Self as IntoRawBytes>::Raw
Converts the color instance into its raw byte representation.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.