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
impl MetaData
sourcepub fn read_from_file(path: impl AsRef<Path>, pedantic: bool) -> Result<Self>
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.
sourcepub fn read_from_unbuffered(
unbuffered: impl Read,
pedantic: bool,
) -> Result<Self>
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.
sourcepub fn read_from_buffered(buffered: impl Read, pedantic: bool) -> Result<Self>
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.
sourcepub(crate) fn read_unvalidated_from_buffered_peekable(
read: &mut PeekRead<impl Read>,
pedantic: bool,
) -> Result<Self>
pub(crate) fn read_unvalidated_from_buffered_peekable( read: &mut PeekRead<impl Read>, pedantic: bool, ) -> Result<Self>
Does not validate the meta data completely.
sourcepub(crate) fn read_validated_from_buffered_peekable(
read: &mut PeekRead<impl Read>,
pedantic: bool,
) -> Result<Self>
pub(crate) fn read_validated_from_buffered_peekable( read: &mut PeekRead<impl Read>, pedantic: bool, ) -> Result<Self>
Validates the meta data.
sourcepub(crate) fn write_validating_to_buffered(
write: &mut impl Write,
headers: &[Header],
pedantic: bool,
) -> Result<Requirements>
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.
sourcepub fn read_offset_tables(
read: &mut PeekRead<impl Read>,
headers: &Headers,
) -> Result<OffsetTables>
pub fn read_offset_tables( read: &mut PeekRead<impl Read>, headers: &Headers, ) -> Result<OffsetTables>
Read one offset table from the reader for each header.
sourcepub fn skip_offset_tables(
read: &mut PeekRead<impl Read>,
headers: &Headers,
) -> Result<usize>
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.
sourcepub fn enumerate_ordered_header_block_indices(
&self,
) -> impl '_ + Iterator<Item = (usize, BlockIndex)>
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.
sourcepub fn collect_ordered_blocks<'s>(
&'s self,
get_block: impl 's + FnMut(BlockIndex) -> UncompressedBlock,
) -> impl 's + Iterator<Item = (usize, UncompressedBlock)>
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.
sourcepub fn collect_ordered_block_data<'s>(
&'s self,
get_block_data: impl 's + FnMut(BlockIndex) -> Vec<u8>,
) -> impl 's + Iterator<Item = (usize, UncompressedBlock)>
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.