Struct BufferLayoutPreference

#[non_exhaustive]
pub struct BufferLayoutPreference { pub len: usize, pub sample_format: SampleFormat, pub sample_type: Option<DecodingSampleType>, pub row_stride: Option<NonZeroUsize>, pub planes: usize, pub plane_stride: Option<NonZeroUsize>, pub complete_len: usize }

Information on the byte buffer that should be supplied to the decoder.

This is relevant for Decoder::read_image_bytes and Decoder::read_chunk_bytes where the caller provided buffer must fit the expectations of the decoder to be filled with data from the current image.

Fields

len: usize

Minimum byte size of the buffer to read image data.

sample_format: SampleFormat

The interpretation of each sample in the image.

We only support a uniform sample layout. Detailed information for mixed colors may be added in the future and will become available by explicit query. The same goes for the bit-depth of samples that must also be uniform.

sample_type: Option<DecodingSampleType>

The type representation for each sample. Only available for depths and formats which the library can describe.

row_stride: Option<NonZeroUsize>

Minimum number of bytes to represent a row of image data of the requested content.

planes: usize

Number of planes in the image.

plane_stride: Option<NonZeroUsize>

Number of bytes used to represent one plane.

complete_len: usize

Number of bytes of data when reading all planes.

Trait Implementations

impl Clone for BufferLayoutPreference

fn clone(&self) -> BufferLayoutPreference

impl Debug for BufferLayoutPreference

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Auto Trait Implementations

impl Freeze for BufferLayoutPreference

impl RefUnwindSafe for BufferLayoutPreference

impl Send for BufferLayoutPreference

impl Sync for BufferLayoutPreference

impl Unpin for BufferLayoutPreference

impl UnsafeUnpin for BufferLayoutPreference

impl UnwindSafe for BufferLayoutPreference

Blanket Implementations

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for BufferLayoutPreference where ST: ?Sized, DT: ?Sized,

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for BufferLayoutPreference where ST: ?Sized, DT: ?Sized,

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

fn type_id(&self) -> TypeId

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

fn borrow(&self) -> &T

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

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

impl<T> CloneToUninit for BufferLayoutPreference where T: Clone,

unsafe fn clone_to_uninit(&self, dest: *mut u8)

impl<T> From<T> for BufferLayoutPreference

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> Read<Exclusive, BecauseExclusive> for BufferLayoutPreference where T: ?Sized,

impl<T> ToOwned for BufferLayoutPreference where T: Clone,

type Owned = T;
fn to_owned(&self) -> T
fn clone_into(&self, target: &mut T)

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

fn into(self) -> U

Calls U::from(self).

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

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

type Error = never;
fn try_from(value: U) -> Result<T, never>

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

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