pub struct Rgb8 {
pub width: usize,
pub height: usize,
pub data: Vec<u8>,
}Expand description
An 8-bit RGB image, row-major and interleaved (RGBRGB…), as a rasterizer
hands it over.
Fields§
§width: usize§height: usize§data: Vec<u8>width · height · 3 bytes, row-major, channels interleaved.
Implementations§
Source§impl Rgb8
impl Rgb8
Sourcepub fn new(width: usize, height: usize, data: Vec<u8>) -> Result<Self, String>
pub fn new(width: usize, height: usize, data: Vec<u8>) -> Result<Self, String>
Wraps a buffer, checking it is exactly the size the dimensions imply.
Checked rather than assumed because the alternative is an out-of-bounds panic deep inside resampling, where the message tells you nothing about the real mistake (a stride miscalculation at the call site).
Trait Implementations§
impl Eq for Rgb8
impl StructuralPartialEq for Rgb8
Auto Trait Implementations§
impl Freeze for Rgb8
impl RefUnwindSafe for Rgb8
impl Send for Rgb8
impl Sync for Rgb8
impl Unpin for Rgb8
impl UnsafeUnpin for Rgb8
impl UnwindSafe for Rgb8
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.