@@ -80,15 +80,15 @@ pub struct Image<Layers> {
8080 pub layer_data : Layers ,
8181}
8282
83- /// A list of layers. `Channels` can be `RgbaChannels ` or `AnyChannels`.
83+ /// A list of layers. `Channels` can be `SpecificChannels ` or `AnyChannels`.
8484pub type Layers < Channels > = SmallVec < [ Layer < Channels > ; 2 ] > ;
8585
8686/// A single Layer, including fancy attributes and compression settings.
87- /// `Channels` can be either `RgbaChannels ` or `AnyChannels`
87+ /// `Channels` can be either `SpecificChannels ` or `AnyChannels`
8888#[ derive( Debug , Clone , PartialEq ) ]
8989pub struct Layer < Channels > {
9090
91- /// The actual pixel data. Either `RgbaChannels ` or `AnyChannels`
91+ /// The actual pixel data. Either `SpecificChannels ` or `AnyChannels`
9292 pub channel_data : Channels ,
9393
9494 /// Attributes that apply to this layer.
@@ -142,23 +142,23 @@ pub enum Blocks {
142142}
143143
144144
145- /// A grid of rgba pixels. The pixels are written to your custom pixel storage.
145+ /// A grid of pixels. The pixels are written to your custom pixel storage.
146146/// `PixelStorage` can be anything, from a flat `Vec<f16>` to `Vec<Vec<AnySample>>`, as desired.
147- /// In order to write this image to a file, your `PixelStorage` must implement [`GetRgbaPixel `].
147+ /// In order to write this image to a file, your `PixelStorage` must implement [`GetPixel `].
148148#[ derive( Debug , Clone , PartialEq , Eq ) ]
149- pub struct SpecificChannels < PixelStorage , ChannelsDescription > {
149+ pub struct SpecificChannels < Pixels , ChannelsDescription > {
150150
151151 /// A description of the channels in the file, as opposed to the channels in memory.
152152 /// Should always be a tuple containing `ChannelDescription`s, one description for each channel.
153153 pub channels : ChannelsDescription , // TODO this is awkward. can this be not a type parameter please? maybe vec<option<chan_info>> ??
154154
155- /// Your custom rgba pixel storage
156- // TODO should also support `Levels<YourStorage>`, where rgba levels are desired!
157- pub storage : PixelStorage , // TODO rename to "pixels"?
155+ /// Your custom pixel storage
156+ // TODO should also support `Levels<YourStorage>`, where levels are desired!
157+ pub pixels : Pixels , // TODO rename to "pixels"?
158158}
159159
160160
161- /// A full list of arbitrary channels, not just rgba .
161+ /// A dynamic list of arbitrary channels.
162162/// `Samples` can currently only be `FlatSamples` or `Levels<FlatSamples>`.
163163#[ derive( Debug , Clone , PartialEq ) ]
164164pub struct AnyChannels < Samples > {
@@ -257,7 +257,7 @@ pub enum DeepAndFlatSamples {
257257///
258258/// Since this is close to the pixel layout in the byte file,
259259/// this will most likely be the fastest storage.
260- /// Using a different storage, for example `RgbaChannels `,
260+ /// Using a different storage, for example `SpecificChannels `,
261261/// will probably be slower.
262262#[ derive( Clone , PartialEq ) ] // debug is implemented manually
263263pub enum FlatSamples {
@@ -313,7 +313,7 @@ impl<SampleStorage, Channels> SpecificChannels<SampleStorage, Channels> {
313313 Channels : Sync + Clone + IntoRecursive ,
314314 <Channels as IntoRecursive >:: Recursive : WritableChannelsDescription < <SampleStorage :: Pixel as IntoRecursive >:: Recursive > ,
315315 {
316- SpecificChannels { channels, storage : source_samples }
316+ SpecificChannels { channels, pixels : source_samples }
317317 }
318318}
319319
@@ -409,7 +409,7 @@ impl<RecursiveChannels: CheckDuplicates, RecursivePixel> SpecificChannelsBuilder
409409 {
410410 SpecificChannels {
411411 channels : self . channels ,
412- storage : get_pixel
412+ pixels : get_pixel
413413 }
414414 }
415415
@@ -426,7 +426,7 @@ impl<RecursiveChannels: CheckDuplicates, RecursivePixel> SpecificChannelsBuilder
426426 {
427427 SpecificChannels {
428428 channels : self . channels ,
429- storage : get_pixel
429+ pixels : get_pixel
430430 }
431431 }
432432}
@@ -853,7 +853,7 @@ impl<C> ContainsNaN for AnyChannel<C> where C: ContainsNaN {
853853
854854impl < S , T > ContainsNaN for SpecificChannels < S , T > where S : ContainsNaN {
855855 fn contains_nan_pixels ( & self ) -> bool {
856- self . storage . contains_nan_pixels ( )
856+ self . pixels . contains_nan_pixels ( )
857857 }
858858}
859859
0 commit comments