/// 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`.
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`.
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 ` .
fn optional<Sample>(self, channel_name: impl Into<Text>, default_sample: Sample)
        -> ReadOptionalChannel<Self, Sample>
    {
        let channel_name = channel_name.into();
        assert!(self.already_contains(&channel_name).not(), "a channel with the name `{}` is already defined", channel_name);
        ReadOptionalChannel { channel_name, previous_channels: self, default_sample }
    }
fn optional < Sample > ( self , channel_name : impl Into < Text > , default_sample : Sample ) -> ReadOptionalChannel < Self , Sample > { let channel_name = channel_name . into ( ) ; assert ! ( self already_contains ( channel_name ) not ( ) " " channel_name ) ; ReadOptionalChannel { channel_name , previous_channels : self , default_sample } }
Plan to read an additional channel from the image, with the specified name.
Plan to read an additional channel from the image with the specified name .
self
channel_name
impl Into<Text>
default_sample
Sample