Struct exr::image::SpecificChannels
source · pub struct SpecificChannels<Pixels, ChannelsDescription> {
pub channels: ChannelsDescription,
pub pixels: Pixels,
}
Expand description
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: ChannelsDescription
A description of the channels in the file, as opposed to the channels in memory.
Should always be a tuple containing ChannelDescription
s, one description for each channel.
pixels: Pixels
Your custom pixel storage
Implementations§
source§impl<SampleStorage, Channels> SpecificChannels<SampleStorage, Channels>
impl<SampleStorage, Channels> SpecificChannels<SampleStorage, Channels>
sourcepub fn new(channels: Channels, source_samples: SampleStorage) -> Selfwhere
SampleStorage: GetPixel,
SampleStorage::Pixel: IntoRecursive,
Channels: Sync + Clone + IntoRecursive,
<Channels as IntoRecursive>::Recursive: WritableChannelsDescription<<SampleStorage::Pixel as IntoRecursive>::Recursive>,
pub fn new(channels: Channels, source_samples: SampleStorage) -> Selfwhere
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 Channels
must be a tuple containing either ChannelDescription
or Option<ChannelDescription>
.
The length of the tuple dictates the number of channels in the sample storage.
source§impl SpecificChannels<(), ()>
impl SpecificChannels<(), ()>
sourcepub fn build() -> SpecificChannelsBuilder<NoneMore, NoneMore>
pub fn build() -> SpecificChannelsBuilder<NoneMore, NoneMore>
Start building some specific channels. On the result of this function,
call with_named_channel
as many times as desired,
and then call with_pixels
to define the colors.
source§impl<SampleStorage> SpecificChannels<SampleStorage, (ChannelDescription, ChannelDescription, ChannelDescription, ChannelDescription)>
impl<SampleStorage> SpecificChannels<SampleStorage, (ChannelDescription, ChannelDescription, ChannelDescription, ChannelDescription)>
sourcepub fn rgba<R, G, B, A>(source_samples: SampleStorage) -> Selfwhere
R: IntoSample,
G: IntoSample,
B: IntoSample,
A: IntoSample,
SampleStorage: GetPixel<Pixel = (R, G, B, A)>,
pub fn rgba<R, G, B, A>(source_samples: SampleStorage) -> Selfwhere
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 implements GetPixel<Pixel=(R,G,B,A)>
.
Each of R
, G
, B
and A
can be either f16
, f32
, u32
, or Sample
.
source§impl<SampleStorage> SpecificChannels<SampleStorage, (ChannelDescription, ChannelDescription, ChannelDescription)>
impl<SampleStorage> SpecificChannels<SampleStorage, (ChannelDescription, ChannelDescription, ChannelDescription)>
sourcepub fn rgb<R, G, B>(source_samples: SampleStorage) -> Self
pub fn rgb<R, G, B>(source_samples: SampleStorage) -> Self
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 implements GetPixel<Pixel=(R,G,B)>
.
Each of R
, G
and B
can be either f16
, f32
, u32
, or Sample
.
Trait Implementations§
source§impl<Pixels: Clone, ChannelsDescription: Clone> Clone for SpecificChannels<Pixels, ChannelsDescription>
impl<Pixels: Clone, ChannelsDescription: Clone> Clone for SpecificChannels<Pixels, ChannelsDescription>
source§fn clone(&self) -> SpecificChannels<Pixels, ChannelsDescription>
fn clone(&self) -> SpecificChannels<Pixels, ChannelsDescription>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<Pixels: Debug, ChannelsDescription: Debug> Debug for SpecificChannels<Pixels, ChannelsDescription>
impl<Pixels: Debug, ChannelsDescription: Debug> Debug for SpecificChannels<Pixels, ChannelsDescription>
source§impl<Pixels: PartialEq, ChannelsDescription: PartialEq> PartialEq for SpecificChannels<Pixels, ChannelsDescription>
impl<Pixels: PartialEq, ChannelsDescription: PartialEq> PartialEq for SpecificChannels<Pixels, ChannelsDescription>
source§fn eq(&self, other: &SpecificChannels<Pixels, ChannelsDescription>) -> bool
fn eq(&self, other: &SpecificChannels<Pixels, ChannelsDescription>) -> bool
self
and other
values to be equal, and is used by ==
.source§impl<Pxs, Chans> ValidateResult for SpecificChannels<Pxs, Chans>where
Pxs: ValidateResult,
Chans: Eq,
impl<Pxs, Chans> ValidateResult for SpecificChannels<Pxs, Chans>where
Pxs: ValidateResult,
Chans: Eq,
source§fn validate_result(
&self,
other: &Self,
options: ValidationOptions,
location: impl Fn() -> String,
) -> ValidationResult
fn validate_result( &self, other: &Self, options: ValidationOptions, location: impl Fn() -> String, ) -> ValidationResult
source§fn assert_equals_result(&self, result: &Self)
fn assert_equals_result(&self, result: &Self)
source§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>,
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>,
source§fn infer_channel_list(&self) -> ChannelList
fn infer_channel_list(&self) -> ChannelList
source§fn infer_level_modes(&self) -> (LevelMode, RoundingMode)
fn infer_level_modes(&self) -> (LevelMode, RoundingMode)
source§type Writer = SpecificChannelsWriter<'c, <<Channels as IntoRecursive>::Recursive as WritableChannelsDescription<<<Storage as GetPixel>::Pixel as IntoRecursive>::Recursive>>::RecursiveWriter, Storage, Channels>
type Writer = SpecificChannelsWriter<'c, <<Channels as IntoRecursive>::Recursive as WritableChannelsDescription<<<Storage as GetPixel>::Pixel as IntoRecursive>::Recursive>>::RecursiveWriter, Storage, Channels>
source§fn create_writer(&'c self, header: &Header) -> Self::Writer
fn create_writer(&'c self, header: &Header) -> Self::Writer
impl<Pixels: Eq, ChannelsDescription: Eq> Eq for SpecificChannels<Pixels, ChannelsDescription>
impl<Pixels, ChannelsDescription> StructuralPartialEq for SpecificChannels<Pixels, ChannelsDescription>
Auto Trait Implementations§
impl<Pixels, ChannelsDescription> Freeze for SpecificChannels<Pixels, ChannelsDescription>
impl<Pixels, ChannelsDescription> RefUnwindSafe for SpecificChannels<Pixels, ChannelsDescription>where
ChannelsDescription: RefUnwindSafe,
Pixels: RefUnwindSafe,
impl<Pixels, ChannelsDescription> Send for SpecificChannels<Pixels, ChannelsDescription>
impl<Pixels, ChannelsDescription> Sync for SpecificChannels<Pixels, ChannelsDescription>
impl<Pixels, ChannelsDescription> Unpin for SpecificChannels<Pixels, ChannelsDescription>
impl<Pixels, ChannelsDescription> UnwindSafe for SpecificChannels<Pixels, ChannelsDescription>where
ChannelsDescription: UnwindSafe,
Pixels: 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
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)
clone_to_uninit
)