Struct SpecificChannels
pub struct SpecificChannels<Pixels, ChannelsDescription> { pub channels: ChannelsDescription, pub pixels: Pixels }
A grid of pixels. The pixels are written to your custom pixel storage.
PixelStorage can be anything, from a flat Vec<f16> to
Vec<Vec<AnySample>>, as desired. In order to write this image to a file,
your PixelStorage must implement GetPixel.
Fields
channels: ChannelsDescriptionA description of the channels in the file, as opposed to the channels in memory. Should always be a tuple containing
ChannelDescriptions, one description for each channel.pixels: PixelsYour custom pixel storage
Implementations
impl SpecificChannels<(), ()>
fn build() -> SpecificChannelsBuilder<NoneMore, NoneMore>Start building some specific channels. On the result of this function, call
with_named_channelas many times as desired, and then callwith_pixelsto define the colors.
impl<SampleStorage> SpecificChannels<SampleStorage, (ChannelDescription, ChannelDescription, ChannelDescription)>
fn rgb<R, G, B>(source_samples: SampleStorage) -> Self where R: IntoSample, G: IntoSample, B: IntoSample, SampleStorage: GetPixel<Pixel = (R, G, B)>,Create an image with red, green, and blue channels. You can pass a closure that returns a color for each pixel (
Fn(Vec2<usize>) -> (R,G,B)), or you can pass your own image if it implementsGetPixel<Pixel=(R,G,B)>. Each ofR,GandBcan be eitherf16,f32,u32, orSample.
impl<SampleStorage> SpecificChannels<SampleStorage, (ChannelDescription, ChannelDescription, ChannelDescription, ChannelDescription)>
fn rgba<R, G, B, A>(source_samples: SampleStorage) -> Self where R: IntoSample, G: IntoSample, B: IntoSample, A: IntoSample, SampleStorage: GetPixel<Pixel = (R, G, B, A)>,Create an image with red, green, blue, and alpha channels. You can pass a closure that returns a color for each pixel (
Fn(Vec2<usize>) -> (R,G,B,A)), or you can pass your own image if it implementsGetPixel<Pixel=(R,G,B,A)>. Each ofR,G,BandAcan be eitherf16,f32,u32, orSample.
impl<SampleStorage, Channels> SpecificChannels<SampleStorage, Channels>
const fn new(channels: Channels, source_samples: SampleStorage) -> Self where SampleStorage: GetPixel, SampleStorage::Pixel: IntoRecursive, Channels: Sync + Clone + IntoRecursive, <Channels as IntoRecursive>::Recursive: WritableChannelsDescription<<SampleStorage::Pixel as IntoRecursive>::Recursive>,Create some pixels with channel information. The
Channelsmust be a tuple containing eitherChannelDescriptionorOption<ChannelDescription>. The length of the tuple dictates the number of channels in the sample storage.
Trait Implementations
impl<'c, Channels, Storage> WritableChannels<'c> for SpecificChannels<Storage, Channels>
where
Storage: 'c + GetPixel,
Storage::Pixel: IntoRecursive,
Channels: 'c + Sync + Clone + IntoRecursive,
<Channels as IntoRecursive>::Recursive: WritableChannelsDescription<<Storage::Pixel as IntoRecursive>::Recursive>,
type Writer = SpecificChannelsWriter<'c, <<Channels as IntoRecursive>::Recursive as WritableChannelsDescription<<<Storage as GetPixel>::Pixel as IntoRecursive>::Recursive>>::RecursiveWriter, Storage, Channels>;fn infer_channel_list(&self) -> ChannelListfn infer_level_modes(&self) -> (LevelMode, RoundingMode)fn create_writer(&'c self, header: &Header) -> Self::Writer
impl<Pixels: Clone, ChannelsDescription: Clone> Clone for SpecificChannels<Pixels, ChannelsDescription>
fn clone(&self) -> Self
impl<Pixels: Debug, ChannelsDescription: Debug> Debug for SpecificChannels<Pixels, ChannelsDescription>
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl<Pixels: Eq, ChannelsDescription: Eq> Eq for SpecificChannels<Pixels, ChannelsDescription>
impl<Pixels: PartialEq, ChannelsDescription: PartialEq> PartialEq for SpecificChannels<Pixels, ChannelsDescription>
fn eq(&self, other: &Self) -> bool
impl<Pixels: PartialEq, ChannelsDescription: PartialEq> StructuralPartialEq for SpecificChannels<Pixels, ChannelsDescription>
impl<Pxs, Chans> ValidateResult for SpecificChannels<Pxs, Chans>
where
Pxs: ValidateResult,
Chans: Eq,
fn validate_result(&self, other: &Self, options: ValidationOptions, location: impl Fn() -> String) -> ValidationResult