pub struct BytesEncoder { /* private fields */ }Expand description
Encoder for raw byte input with explicit pixel layout.
This encoder wraps StreamingEncoder to provide true streaming encoding
without buffering the entire image in memory.
Implementations§
Source§impl BytesEncoder
impl BytesEncoder
Sourcepub fn push(
&mut self,
data: &[u8],
rows: usize,
stride_bytes: usize,
stop: impl Stop,
) -> Result<()>
pub fn push( &mut self, data: &[u8], rows: usize, stride_bytes: usize, stop: impl Stop, ) -> Result<()>
Push rows with explicit stride.
data: Raw pixel bytesrows: Number of scanlines to pushstride_bytes: Bytes per row in buffer (>= width * bytes_per_pixel)stop: Cancellation token (useenough::Unstoppableif not needed)
Sourcepub fn push_packed(&mut self, data: &[u8], stop: impl Stop) -> Result<()>
pub fn push_packed(&mut self, data: &[u8], stop: impl Stop) -> Result<()>
Push contiguous (packed) data.
Stride is assumed to be width * bytes_per_pixel.
Rows inferred from data.len() / (width * bytes_per_pixel).
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.
Sourcepub fn layout(&self) -> PixelLayout
pub fn layout(&self) -> PixelLayout
Get the pixel layout.
Auto Trait Implementations§
impl Freeze for BytesEncoder
impl RefUnwindSafe for BytesEncoder
impl Send for BytesEncoder
impl Sync for BytesEncoder
impl Unpin for BytesEncoder
impl UnwindSafe for BytesEncoder
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