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: usizeThe 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]>) -> SelfDoes 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) -> usizeNumber of bytes this would consume in an exr file.
fn write(&self, write: &mut impl Write) -> UnitResultWithout 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) -> UnitResultCheck 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,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for ChannelList
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for ChannelList
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> CloneToUninit for ChannelList
where
T: Clone,
unsafe fn clone_to_uninit(&self, dest: *mut u8)
impl<T> From<T> for ChannelList
fn from(t: T) -> TReturns the argument unchanged.
impl<T> Pointable for ChannelList
const ALIGN: usize = _;type Init = T;unsafe fn init(init: <T as Pointable>::Init) -> usizeunsafe fn deref<'a>(ptr: usize) -> &'a Tunsafe fn deref_mut<'a>(ptr: usize) -> &'a mut Tunsafe fn drop(ptr: usize)
impl<T> Read<Exclusive, BecauseExclusive> for ChannelList
where
T: ?Sized,
impl<T> ToOwned for ChannelList
where
T: Clone,
type Owned = T;fn to_owned(&self) -> Tfn clone_into(&self, target: &mut T)
impl<T, U> Into<U> for ChannelList
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for ChannelList
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for ChannelList
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>