pub struct RgbEncoder<P: Pixel> { /* private fields */ }Expand description
Encoder for rgb crate pixel types.
Type parameter P determines pixel layout at compile time. For RGBA/BGRA types, 4th channel is ignored.
Implementations§
Source§impl<P: Pixel> RgbEncoder<P>
impl<P: Pixel> RgbEncoder<P>
Sourcepub fn push(
&mut self,
data: &[P],
rows: usize,
stride: usize,
stop: impl Stop,
) -> Result<()>
pub fn push( &mut self, data: &[P], rows: usize, stride: usize, stop: impl Stop, ) -> Result<()>
Push rows with explicit stride (in pixels).
data: Pixel slicerows: Number of scanlines to pushstride: Pixels per row in buffer (>= width)stop: Cancellation token
Sourcepub fn push_packed(&mut self, data: &[P], stop: impl Stop) -> Result<()>
pub fn push_packed(&mut self, data: &[P], stop: impl Stop) -> Result<()>
Push contiguous (packed) data.
Stride assumed to be width. Rows inferred from data.len() / width.
Sourcepub fn rows_pushed(&self) -> u32
pub fn rows_pushed(&self) -> u32
Get number of rows pushed so far.
Sourcepub fn rows_remaining(&self) -> u32
pub fn rows_remaining(&self) -> u32
Get number of rows remaining.
Auto Trait Implementations§
impl<P> Freeze for RgbEncoder<P>
impl<P> RefUnwindSafe for RgbEncoder<P>where
P: RefUnwindSafe,
impl<P> Send for RgbEncoder<P>where
P: Send,
impl<P> Sync for RgbEncoder<P>where
P: Sync,
impl<P> Unpin for RgbEncoder<P>where
P: Unpin,
impl<P> UnwindSafe for RgbEncoder<P>where
P: UnwindSafe,
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