pub struct EncodeRequest<'a> { /* private fields */ }Expand description
An encoding request — binds config + image dimensions + pixel layout.
Created via LosslessConfig::encode_request or LossyConfig::encode_request.
Implementations§
Source§impl<'a> EncodeRequest<'a>
impl<'a> EncodeRequest<'a>
Sourcepub fn with_metadata(self, meta: &'a ImageMetadata<'a>) -> Self
pub fn with_metadata(self, meta: &'a ImageMetadata<'a>) -> Self
Attach image metadata (ICC, EXIF, XMP).
Sourcepub fn with_limits(self, limits: &'a Limits) -> Self
pub fn with_limits(self, limits: &'a Limits) -> Self
Attach resource limits.
Sourcepub fn with_stop(self, stop: &'a dyn Stop) -> Self
pub fn with_stop(self, stop: &'a dyn Stop) -> Self
Attach a cooperative cancellation token.
The encoder will check this periodically and return
EncodeError::Cancelled if stopped.
Sourcepub fn encode_with_stats(self, pixels: &[u8]) -> Result<EncodeResult>
pub fn encode_with_stats(self, pixels: &[u8]) -> Result<EncodeResult>
Encode pixels and return the JXL bytes together with EncodeStats.
Sourcepub fn encode_into(
self,
pixels: &[u8],
out: &mut Vec<u8>,
) -> Result<EncodeResult>
pub fn encode_into( self, pixels: &[u8], out: &mut Vec<u8>, ) -> Result<EncodeResult>
Encode pixels, appending to an existing buffer. Returns metrics.
Auto Trait Implementations§
impl<'a> Freeze for EncodeRequest<'a>
impl<'a> !RefUnwindSafe for EncodeRequest<'a>
impl<'a> Send for EncodeRequest<'a>
impl<'a> Sync for EncodeRequest<'a>
impl<'a> Unpin for EncodeRequest<'a>
impl<'a> !UnwindSafe for EncodeRequest<'a>
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