Struct exr::meta::attribute::ChannelList
source · pub struct ChannelList {
pub list: SmallVec<[ChannelDescription; 5]>,
pub bytes_per_pixel: usize,
pub uniform_sample_type: Option<SampleType>,
}
Expand description
A List of channels. Channels must be sorted alphabetically.
Fields§
§list: SmallVec<[ChannelDescription; 5]>
The channels in this list.
bytes_per_pixel: usize
The number of bytes that one pixel in this image needs.
uniform_sample_type: Option<SampleType>
The sample type of all channels, if all channels have the same type.
Implementations§
source§impl ChannelList
impl ChannelList
sourcepub fn new(channels: SmallVec<[ChannelDescription; 5]>) -> Self
pub fn new(channels: SmallVec<[ChannelDescription; 5]>) -> Self
Does not validate channel order.
sourcepub fn channels_with_byte_offset(
&self,
) -> impl Iterator<Item = (usize, &ChannelDescription)>
pub fn channels_with_byte_offset( &self, ) -> impl Iterator<Item = (usize, &ChannelDescription)>
Iterate over the channels, and adds to each channel the byte offset of the channels sample type. Assumes the internal channel list is properly sorted.
sourcepub fn find_index_of_channel(&self, exact_name: &Text) -> Option<usize>
pub fn find_index_of_channel(&self, exact_name: &Text) -> Option<usize>
Return the index of the channel with the exact name, case sensitive, or none. Potentially uses less than linear time.
source§impl ChannelList
impl ChannelList
sourcepub fn write(&self, write: &mut impl Write) -> UnitResult
pub fn write(&self, write: &mut impl Write) -> UnitResult
Without validation, write this instance to the byte stream. Assumes channels are sorted alphabetically and all values are validated.
sourcepub fn validate(
&self,
allow_sampling: bool,
data_window: IntegerBounds,
strict: bool,
) -> UnitResult
pub fn validate( &self, allow_sampling: bool, data_window: IntegerBounds, strict: bool, ) -> UnitResult
Check if channels are valid and sorted.
Trait Implementations§
source§impl Clone for ChannelList
impl Clone for ChannelList
source§fn clone(&self) -> ChannelList
fn clone(&self) -> ChannelList
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for ChannelList
impl Debug for ChannelList
source§impl Hash for ChannelList
impl Hash for ChannelList
source§impl PartialEq for ChannelList
impl PartialEq for ChannelList
source§fn eq(&self, other: &ChannelList) -> bool
fn eq(&self, other: &ChannelList) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for ChannelList
impl StructuralPartialEq for ChannelList
Auto Trait Implementations§
impl Freeze for ChannelList
impl RefUnwindSafe for ChannelList
impl Send for ChannelList
impl Sync for ChannelList
impl Unpin for ChannelList
impl UnwindSafe for ChannelList
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more