Struct exr::meta::MetaData

source ·
pub struct MetaData {
    pub requirements: Requirements,
    pub headers: Headers,
}
Expand description

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§

source§

impl MetaData

source

pub 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.

source

pub 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.

source

pub 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.

source

pub(crate) fn read_unvalidated_from_buffered_peekable( read: &mut PeekRead<impl Read>, pedantic: bool ) -> Result<Self>

Does not validate the meta data completely.

source

pub(crate) fn read_validated_from_buffered_peekable( read: &mut PeekRead<impl Read>, pedantic: bool ) -> Result<Self>

Validates the meta data.

source

pub(crate) fn write_validating_to_buffered( write: &mut impl Write, headers: &[Header], pedantic: bool ) -> Result<Requirements>

Validates the meta data and writes it to the stream. If pedantic, throws errors for files that may produce errors in other exr readers. Returns the automatically detected minimum requirement flags.

source

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

Read one offset table from the reader for each header.

source

pub 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.

source

pub 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.

source

pub 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.

source

pub 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.

source

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

Validates this meta data. Returns the minimal possible requirements.

Trait Implementations§

source§

impl Clone for MetaData

source§

fn clone(&self) -> MetaData

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for MetaData

source§

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

Formats the value using the given formatter. Read more
source§

impl PartialEq<MetaData> for MetaData

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl StructuralPartialEq for MetaData

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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 Twhere U: TryFrom<T>,

§

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.