Struct jpegxr::ImageDecode[][src]

pub struct ImageDecode<R: Read + Seek> { /* fields omitted */ }
Expand description

High-level JPEG XR image decoder struct. Requires a seekable data source, such as a File. You can decode multiple subsets of the image, though this is not yet well-tested.

Implementations

impl<R> ImageDecode<R> where
    R: Read + Seek
[src]

pub fn with_reader(reader: R) -> Result<Self>[src]

Create a new JPEG XR image decoder for the given input. This will consume the reader, and free it when done.

pub fn get_pixel_format(&self) -> Result<PixelFormat>[src]

Return the pixel format of the decoded image. This is just a big enum; you’re responsible for knowing how to interpret the image data yourself from that. This could fail if a new unknown pixel type appears in the wild.

pub fn get_size(&self) -> Result<(i32, i32)>[src]

Get width and height in pixels.

pub fn get_resolution(&self) -> Result<(f32, f32)>[src]

Get horizontal and vertical DPI.

pub fn copy(
    &mut self,
    rect: &Rect,
    dest: &mut [u8],
    stride: usize
) -> Result<()>
[src]

Decode pixel data and copy it into a provided output buffer. You can ask for just part of the image to decode fewer macroblocks. However this mode is not well tested.

pub fn copy_all(&mut self, dest: &mut [u8], stride: usize) -> Result<()>[src]

Decode the entire image in one go, for convenience.

pub fn into_reader(self) -> R[src]

Free the image decoder and return the input reader. Only needed if you want to reuse the same reader struct on something else, but it feels so Rustic!

Trait Implementations

impl<R> Drop for ImageDecode<R> where
    R: Read + Seek
[src]

fn drop(&mut self)[src]

Executes the destructor for this type. Read more

Auto Trait Implementations

impl<R> RefUnwindSafe for ImageDecode<R> where
    R: RefUnwindSafe

impl<R> !Send for ImageDecode<R>

impl<R> !Sync for ImageDecode<R>

impl<R> Unpin for ImageDecode<R>

impl<R> UnwindSafe for ImageDecode<R> where
    R: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

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]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.