Struct InputFileReader

Source
pub struct InputFileReader { /* private fields */ }
Expand description

InputFileReader provides a safe API over InputFile by taking ownership of the storage into which the channel data is to be read and handling all the Slice pointer offset shenanigans internally.

Implementations§

Source§

impl InputFileReader

Source

pub fn read_pixels( self, s1: i32, s2: i32, ) -> Result<(InputFile, Vec<Frame>), Error>

Read all scanlines in the range [s1, s2] and put them in the current frame buffer.

This consumes the InputFileReader and returns the original InputFile object and the Vec of the read Frames .

§Errors
Source

pub fn is_optimization_enabled(&self) -> bool

Check if SSE optimization is enabled. Decode times will be faster if this returns true.

Optimization depends on:

  • The file type (only scanline data is supported),
  • The framebuffer channels (RGB/RGBA mono or stereo)
  • The framebuffer channel types (all channels half-float format only)
  • The file channels (RGB/RGBA mono or stereo)
  • The file channel types (all channel half-float format only)
  • Whether SSE2 instruction support was detected at compile time

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.