Struct ChannelList

pub struct ChannelList { pub list: SmallVec<[ChannelDescription; 5]>, pub bytes_per_pixel: usize, pub uniform_sample_type: Option<SampleType> }

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

impl ChannelList

fn new(channels: SmallVec<[ChannelDescription; 5]>) -> Self

Does not validate channel order.

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.

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.

impl ChannelList

fn byte_size(&self) -> usize

Number of bytes this would consume in an exr file.

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.

fn read(read: &mut PeekRead<impl Read>) -> Result<Self>

Read the value without validating.

fn validate(&self, allow_sampling: bool, data_window: IntegerBounds, strict: bool) -> UnitResult

Check if channels are valid and sorted.

Trait Implementations

impl Clone for ChannelList

fn clone(&self) -> Self

impl Debug for ChannelList

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

impl Eq for ChannelList

impl Hash for ChannelList

fn hash<__H: Hasher>(&self, state: &mut __H)

impl PartialEq for ChannelList

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

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 UnsafeUnpin for ChannelList

impl UnwindSafe for ChannelList

Blanket Implementations

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

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

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

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

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

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

impl<T> From<T> for ChannelList

impl<T> Pointable for ChannelList

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

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

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

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

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