Trait rgb::ComponentBytes
[−]
[src]
pub trait ComponentBytes<T> { fn as_slice(&self) -> &[T]; fn as_mut_slice(&mut self) -> &mut [T]; fn as_bytes(&self) -> &[u8] { ... } }
Casting the struct to slices/bytes of its components
Required Methods
fn as_slice(&self) -> &[T]
The components interpreted as an array, e.g. RGB gives 3-element slice. The red component is first.
fn as_mut_slice(&mut self) -> &mut [T]
Provided Methods
fn as_bytes(&self) -> &[u8]
The components interpreted as raw bytes, in machine's native endian. Bytes of the red component are first.