pub struct JxlEncoder { /* private fields */ }Expand description
JPEG-XL encoder.
Encodes images to JPEG-XL format. Currently optimized for lossless encoding using the Modular sub-codec with Reversible Color Transform and adaptive prediction.
Implementations§
Source§impl JxlEncoder
impl JxlEncoder
Sourcepub fn lossless_with_effort(effort: u8) -> Self
pub fn lossless_with_effort(effort: u8) -> Self
Create a lossless encoder with specified effort level.
Sourcepub fn encode(
&self,
data: &[u8],
width: u32,
height: u32,
channels: u8,
bit_depth: u8,
) -> CodecResult<Vec<u8>>
pub fn encode( &self, data: &[u8], width: u32, height: u32, channels: u8, bit_depth: u8, ) -> CodecResult<Vec<u8>>
Encode an image to JPEG-XL format.
§Arguments
data- Interleaved pixel data (e.g., RGBRGBRGB… for 8-bit RGB)width- Image width in pixelsheight- Image height in pixelschannels- Number of channels (1=gray, 3=RGB, 4=RGBA)bit_depth- Bits per sample (8 or 16)
§Errors
Returns error if parameters are invalid or encoding fails.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for JxlEncoder
impl RefUnwindSafe for JxlEncoder
impl Send for JxlEncoder
impl Sync for JxlEncoder
impl Unpin for JxlEncoder
impl UnsafeUnpin for JxlEncoder
impl UnwindSafe for JxlEncoder
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more