Trait rgb::ComponentSlice
source · [−]pub trait ComponentSlice<T> {
fn as_slice(&self) -> &[T]ⓘNotable traits for &mut [u8]impl Write for &mut [u8]impl Read for &[u8]
;
fn as_mut_slice(&mut self) -> &mut [T]ⓘNotable traits for &mut [u8]impl Write for &mut [u8]impl Read for &[u8]
;
}
Expand description
Casting the struct to slices of its components
Required Methods
The components interpreted as an array, e.g. one RGB
expands to 3 elements.
It’s implemented for individual pixels as well as slices of pixels.
The components interpreted as a mutable array, e.g. one RGB
expands to 3 elements.
It’s implemented for individual pixels as well as slices of pixels.
If you get an error when calling this on an array, add [..]
use of unstable library feature ‘array_methods’
ⓘ
arr[..].as_mut_slice()