Struct MetaData

pub struct MetaData { pub requirements: Requirements, pub headers: Headers }

Contains the complete meta data of an exr image.

Defines how the image is split up in the file, the number and type of images and channels, and various other attributes. The usage of custom attributes is encouraged.

Fields

requirements: Requirements

Some flags summarizing the features that must be supported to decode the file.

headers: Headers

One header to describe each layer in this file.

Implementations

impl MetaData

fn read_from_file(path: impl AsRef<Path>, pedantic: bool) -> Result<Self>

Read the exr meta data from a file. Use read_from_unbuffered instead if you do not have a file. Does not validate the meta data.

fn read_from_unbuffered(unbuffered: impl Read, pedantic: bool) -> Result<Self>

Buffer the reader and then read the exr meta data from it. Use read_from_buffered if your reader is an in-memory reader. Use read_from_file if you have a file path. Does not validate the meta data.

fn read_from_buffered(buffered: impl Read, pedantic: bool) -> Result<Self>

Read the exr meta data from a reader. Use read_from_file if you have a file path. Use read_from_unbuffered if this is not an in-memory reader. Does not validate the meta data.

fn read_offset_tables(read: &mut PeekRead<impl Read>, headers: &Headers) -> Result<OffsetTables>

Read one offset table from the reader for each header.

fn skip_offset_tables(read: &mut PeekRead<impl Read>, headers: &Headers) -> Result<usize>

Skip the offset tables by advancing the reader by the required byte count.

fn enumerate_ordered_header_block_indices(&self) -> impl '_ + Iterator<Item = (usize, BlockIndex)>

This iterator tells you the block indices of all blocks that must be in the image. The order of the blocks depends on the LineOrder attribute (unspecified line order is treated the same as increasing line order). The blocks written to the file must be exactly in this order, except for when the LineOrder is unspecified. The index represents the block index, in increasing line order, within the header.

fn collect_ordered_blocks<'s>(&'s self, get_block: impl 's + FnMut(BlockIndex) -> UncompressedBlock) -> impl 's + Iterator<Item = (usize, UncompressedBlock)>

Go through all the block indices in the correct order and call the specified closure for each of these blocks. That way, the blocks indices are filled with real block data and returned as an iterator. The closure returns the an UncompressedBlock for each block index.

fn collect_ordered_block_data<'s>(&'s self, get_block_data: impl 's + FnMut(BlockIndex) -> Vec<u8>) -> impl 's + Iterator<Item = (usize, UncompressedBlock)>

Go through all the block indices in the correct order and call the specified closure for each of these blocks. That way, the blocks indices are filled with real block data and returned as an iterator. The closure returns the byte data for each block index.

fn validate(headers: &[Header], pedantic: bool) -> Result<Requirements>

Validates this meta data. Returns the minimal possible requirements.

Trait Implementations

impl Clone for MetaData

fn clone(&self) -> Self

impl Debug for MetaData

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

impl PartialEq for MetaData

fn eq(&self, other: &Self) -> bool

impl StructuralPartialEq for MetaData

Auto Trait Implementations

impl Freeze for MetaData

impl RefUnwindSafe for MetaData

impl Send for MetaData

impl Sync for MetaData

impl Unpin for MetaData

impl UnsafeUnpin for MetaData

impl UnwindSafe for MetaData

Blanket Implementations

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

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

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

fn type_id(&self) -> TypeId

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

fn borrow(&self) -> &T

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

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

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

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

impl<T> From<T> for MetaData

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> Pointable for MetaData

const ALIGN: usize = _;
type Init = T;
unsafe fn init(init: <T as Pointable>::Init) -> usize
unsafe fn deref<'a>(ptr: usize) -> &'a T
unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
unsafe fn drop(ptr: usize)

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

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

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

impl<T, U> Into<U> for MetaData 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 MetaData where U: Into<T>,

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

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

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