Struct exr::image::read::specific_channels::ReadOptionalChannel
source · pub struct ReadOptionalChannel<ReadChannels, Sample> {
previous_channels: ReadChannels,
channel_name: Text,
default_sample: Sample,
}
Expand description
Used to read another specific channel from an image.
Contains the previous ReadChannels
objects.
Fields§
§previous_channels: ReadChannels
§channel_name: Text
§default_sample: Sample
Trait Implementations§
source§impl<Inner: CheckDuplicates, Sample> CheckDuplicates for ReadOptionalChannel<Inner, Sample>
impl<Inner: CheckDuplicates, Sample> CheckDuplicates for ReadOptionalChannel<Inner, Sample>
source§fn already_contains(&self, name: &Text) -> bool
fn already_contains(&self, name: &Text) -> bool
Check for duplicate channel names.
source§impl<ReadChannels: Clone, Sample: Clone> Clone for ReadOptionalChannel<ReadChannels, Sample>
impl<ReadChannels: Clone, Sample: Clone> Clone for ReadOptionalChannel<ReadChannels, Sample>
source§fn clone(&self) -> ReadOptionalChannel<ReadChannels, Sample>
fn clone(&self) -> ReadOptionalChannel<ReadChannels, Sample>
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<DefaultSample, ReadChannels> ReadSpecificChannel for ReadOptionalChannel<ReadChannels, DefaultSample>where
ReadChannels: ReadSpecificChannel,
DefaultSample: FromNativeSample + 'static,
impl<DefaultSample, ReadChannels> ReadSpecificChannel for ReadOptionalChannel<ReadChannels, DefaultSample>where
ReadChannels: ReadSpecificChannel,
DefaultSample: FromNativeSample + 'static,
source§type RecursivePixelReader = Recursive<<ReadChannels as ReadSpecificChannel>::RecursivePixelReader, OptionalSampleReader<DefaultSample>>
type RecursivePixelReader = Recursive<<ReadChannels as ReadSpecificChannel>::RecursivePixelReader, OptionalSampleReader<DefaultSample>>
A separate internal reader for the pixels. Will be of type
Recursive<_, SampleReader<_>>
,
depending on the pixels of the specific channel combination.source§fn create_recursive_reader(
&self,
channels: &ChannelList,
) -> Result<Self::RecursivePixelReader>
fn create_recursive_reader( &self, channels: &ChannelList, ) -> Result<Self::RecursivePixelReader>
Create a separate internal reader for the pixels of the specific channel combination.
source§fn required<Sample>(
self,
channel_name: impl Into<Text>,
) -> ReadRequiredChannel<Self, Sample>
fn required<Sample>( self, channel_name: impl Into<Text>, ) -> ReadRequiredChannel<Self, Sample>
Plan to read an additional channel from the image, with the specified name.
If the channel cannot be found in the image when the image is read, the image will not be loaded.
The generic parameter can usually be inferred from the closure in
collect_pixels
.source§fn optional<Sample>(
self,
channel_name: impl Into<Text>,
default_sample: Sample,
) -> ReadOptionalChannel<Self, Sample>
fn optional<Sample>( self, channel_name: impl Into<Text>, default_sample: Sample, ) -> ReadOptionalChannel<Self, Sample>
Plan to read an additional channel from the image, with the specified name.
If the file does not contain this channel, the specified default sample will be returned instead.
You can check whether the channel has been loaded by
checking the presence of the optional channel description before instantiating your own image.
The generic parameter can usually be inferred from the closure in
collect_pixels
.Auto Trait Implementations§
impl<ReadChannels, Sample> Freeze for ReadOptionalChannel<ReadChannels, Sample>
impl<ReadChannels, Sample> RefUnwindSafe for ReadOptionalChannel<ReadChannels, Sample>where
ReadChannels: RefUnwindSafe,
Sample: RefUnwindSafe,
impl<ReadChannels, Sample> Send for ReadOptionalChannel<ReadChannels, Sample>
impl<ReadChannels, Sample> Sync for ReadOptionalChannel<ReadChannels, Sample>
impl<ReadChannels, Sample> Unpin for ReadOptionalChannel<ReadChannels, Sample>
impl<ReadChannels, Sample> UnwindSafe for ReadOptionalChannel<ReadChannels, Sample>where
ReadChannels: UnwindSafe,
Sample: UnwindSafe,
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)