pub struct UninitializedJxlImage { /* private fields */ }
Expand description
Empty, uninitialized JPEG XL image.
§Examples
let mut uninit_image = JxlImage::builder().build_uninit();
let image = loop {
let buf = read_bytes()?;
uninit_image.feed_bytes(buf)?;
match uninit_image.try_init()? {
InitializeResult::NeedMoreData(uninit) => {
uninit_image = uninit;
}
InitializeResult::Initialized(image) => {
break image;
}
}
};
println!("{:?}", image.image_header());
Implementations§
source§impl UninitializedJxlImage
impl UninitializedJxlImage
sourcepub fn feed_bytes(&mut self, buf: &[u8]) -> Result<()>
pub fn feed_bytes(&mut self, buf: &[u8]) -> Result<()>
Feeds more data into the decoder.
sourcepub fn reader(&self) -> &ContainerDetectingReader
pub fn reader(&self) -> &ContainerDetectingReader
Returns the internal reader.
sourcepub fn try_init(self) -> Result<InitializeResult>
pub fn try_init(self) -> Result<InitializeResult>
Try to initialize an image with the data fed into so far.
§Returns
Ok(InitializeResult::Initialized(_))
if the initialization was successful,Ok(InitializeResult::NeedMoreData(_))
if the data was not enough, andErr(_)
if there was a decode error during the initialization, meaning invalid bitstream was given.
Auto Trait Implementations§
impl Freeze for UninitializedJxlImage
impl !RefUnwindSafe for UninitializedJxlImage
impl Send for UninitializedJxlImage
impl Sync for UninitializedJxlImage
impl Unpin for UninitializedJxlImage
impl !UnwindSafe for UninitializedJxlImage
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> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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