Struct jpegxl_rs::image::JxlImageDecoder [−][src]
JPEG XL decoder representation for image
crate.
Note: Since image
only supports 8-bit and 16-bit pixel depth,
you can only create u8
and u16
buffer.
Example
let sample = std::fs::read("test/sample.jxl")?; let decoder: JxlImageDecoder<u16> = JxlImageDecoder::new(&sample)?; let img = image::DynamicImage::from_decoder(decoder)?;
Implementations
impl<T: PixelType> JxlImageDecoder<T>
[src]
pub fn new(input: &[u8]) -> ImageResult<JxlImageDecoder<T>>
[src]
Trait Implementations
impl<'a> ImageDecoder<'a> for JxlImageDecoder<u8>
[src]
type Reader = Cursor<Vec<u8>>
The type of reader produced by into_reader
.
fn color_type(&self) -> ColorType
[src]
fn dimensions(&self) -> (u32, u32)
[src]
fn into_reader(self) -> ImageResult<Self::Reader>
[src]
pub fn original_color_type(&self) -> ExtendedColorType
[src]
pub fn total_bytes(&self) -> u64
[src]
pub fn scanline_bytes(&self) -> u64
[src]
pub fn read_image(self, buf: &mut [u8]) -> Result<(), ImageError>
[src]
pub fn read_image_with_progress<F>(
self,
buf: &mut [u8],
progress_callback: F
) -> Result<(), ImageError> where
F: Fn(Progress),
[src]
self,
buf: &mut [u8],
progress_callback: F
) -> Result<(), ImageError> where
F: Fn(Progress),
impl<'a> ImageDecoder<'a> for JxlImageDecoder<u16>
[src]
type Reader = Cursor<Vec<u8>>
The type of reader produced by into_reader
.
fn color_type(&self) -> ColorType
[src]
fn dimensions(&self) -> (u32, u32)
[src]
fn into_reader(self) -> ImageResult<Self::Reader>
[src]
pub fn original_color_type(&self) -> ExtendedColorType
[src]
pub fn total_bytes(&self) -> u64
[src]
pub fn scanline_bytes(&self) -> u64
[src]
pub fn read_image(self, buf: &mut [u8]) -> Result<(), ImageError>
[src]
pub fn read_image_with_progress<F>(
self,
buf: &mut [u8],
progress_callback: F
) -> Result<(), ImageError> where
F: Fn(Progress),
[src]
self,
buf: &mut [u8],
progress_callback: F
) -> Result<(), ImageError> where
F: Fn(Progress),
Auto Trait Implementations
impl<T> RefUnwindSafe for JxlImageDecoder<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for JxlImageDecoder<T> where
T: Send,
T: Send,
impl<T> Sync for JxlImageDecoder<T> where
T: Sync,
T: Sync,
impl<T> Unpin for JxlImageDecoder<T>
impl<T> UnwindSafe for JxlImageDecoder<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,