Struct ReadLargestLevel
pub struct ReadLargestLevel<DeepOrFlatSamples> { pub read_samples: DeepOrFlatSamples }
Specify to read only the highest resolution level, skipping all smaller
variations. The sample storage can be ReadFlatSamples.
Fields
read_samples: DeepOrFlatSamplesThe sample reading specification
Implementations
impl<DeepOrFlatSamples> ReadLargestLevel<DeepOrFlatSamples>
fn all_channels(self) -> ReadAnyChannels<DeepOrFlatSamples>Read all arbitrary channels in each layer.
fn rgba_channels<R, G, B, A, Create, Set, Pixels>(self, create_pixels: Create, set_pixel: Set) -> CollectPixels<ReadOptionalChannel<ReadRequiredChannel<ReadRequiredChannel<ReadRequiredChannel<NoneMore, R>, G>, B>, A>, (R, G, B, A), Pixels, Create, Set> where R: FromNativeSample, G: FromNativeSample, B: FromNativeSample, A: FromNativeSample, Create: Fn(Vec2<usize>, &RgbaChannels) -> Pixels, Set: Fn(&mut Pixels, Vec2<usize>, (R, G, B, A)),Read only layers that contain rgba channels. Skips any other channels in the layer. The alpha channel will contain the value
1.0if no alpha channel can be found in the image.Using two closures, define how to store the pixels. The first closure creates an image, and the second closure inserts a single pixel. The type of the pixel can be defined by the second closure; it must be a tuple containing four values, each being either
f16,f32,u32orSample.Throws an error for images with deep data or subsampling. Use
specific_channelsorall_channelsif you want to read something other than rgba.fn rgb_channels<R, G, B, Create, Set, Pixels>(self, create_pixels: Create, set_pixel: Set) -> CollectPixels<ReadRequiredChannel<ReadRequiredChannel<ReadRequiredChannel<NoneMore, R>, G>, B>, (R, G, B), Pixels, Create, Set> where R: FromNativeSample, G: FromNativeSample, B: FromNativeSample, Create: Fn(Vec2<usize>, &RgbChannels) -> Pixels, Set: Fn(&mut Pixels, Vec2<usize>, (R, G, B)),Read only layers that contain rgb channels. Skips any other channels in the layer.
Using two closures, define how to store the pixels. The first closure creates an image, and the second closure inserts a single pixel. The type of the pixel can be defined by the second closure; it must be a tuple containing three values, each being either
f16,f32,u32orSample.Throws an error for images with deep data or subsampling. Use
specific_channelsorall_channelsif you want to read something other than rgb.fn specific_channels(self) -> ReadZeroChannelsRead only layers that contain the specified channels, skipping any other channels in the layer. Further specify which channels should be included by calling
.required("ChannelName")or.optional(" ChannelName", default_value)on the result of this function. Callcollect_pixelsafterwards to define the pixel container for your set of channels.Throws an error for images with deep data or subsampling.
Trait Implementations
impl<DeepOrFlatSamples: Clone> Clone for ReadLargestLevel<DeepOrFlatSamples>
fn clone(&self) -> Self
impl<DeepOrFlatSamples: Debug> Debug for ReadLargestLevel<DeepOrFlatSamples>
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl<DeepOrFlatSamples: Eq> Eq for ReadLargestLevel<DeepOrFlatSamples>
impl<DeepOrFlatSamples: PartialEq> PartialEq for ReadLargestLevel<DeepOrFlatSamples>
fn eq(&self, other: &Self) -> bool
impl<DeepOrFlatSamples: PartialEq> StructuralPartialEq for ReadLargestLevel<DeepOrFlatSamples>
Auto Trait Implementations
impl<DeepOrFlatSamples> Freeze for ReadLargestLevel<DeepOrFlatSamples>
where
DeepOrFlatSamples: Freeze,
impl<DeepOrFlatSamples> RefUnwindSafe for ReadLargestLevel<DeepOrFlatSamples>
where
DeepOrFlatSamples: RefUnwindSafe,
impl<DeepOrFlatSamples> Send for ReadLargestLevel<DeepOrFlatSamples>
where
DeepOrFlatSamples: Send,
impl<DeepOrFlatSamples> Sync for ReadLargestLevel<DeepOrFlatSamples>
where
DeepOrFlatSamples: Sync,
impl<DeepOrFlatSamples> Unpin for ReadLargestLevel<DeepOrFlatSamples>
where
DeepOrFlatSamples: Unpin,
impl<DeepOrFlatSamples> UnsafeUnpin for ReadLargestLevel<DeepOrFlatSamples>
where
DeepOrFlatSamples: UnsafeUnpin,
impl<DeepOrFlatSamples> UnwindSafe for ReadLargestLevel<DeepOrFlatSamples>
where
DeepOrFlatSamples: UnwindSafe,
Blanket Implementations
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for ReadLargestLevel<DeepOrFlatSamples>
where
ST: ?Sized,
DT: ?Sized,
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for ReadLargestLevel<DeepOrFlatSamples>
where
ST: ?Sized,
DT: ?Sized,
impl<T> Any for ReadLargestLevel<DeepOrFlatSamples>
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for ReadLargestLevel<DeepOrFlatSamples>
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for ReadLargestLevel<DeepOrFlatSamples>
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> CloneToUninit for ReadLargestLevel<DeepOrFlatSamples>
where
T: Clone,
unsafe fn clone_to_uninit(&self, dest: *mut u8)
impl<T> From<T> for ReadLargestLevel<DeepOrFlatSamples>
fn from(t: T) -> TReturns the argument unchanged.
impl<T> Pointable for ReadLargestLevel<DeepOrFlatSamples>
const ALIGN: usize = _;type Init = T;unsafe fn init(init: <T as Pointable>::Init) -> usizeunsafe fn deref<'a>(ptr: usize) -> &'a Tunsafe fn deref_mut<'a>(ptr: usize) -> &'a mut Tunsafe fn drop(ptr: usize)
impl<T> Read<Exclusive, BecauseExclusive> for ReadLargestLevel<DeepOrFlatSamples>
where
T: ?Sized,
impl<T> ToOwned for ReadLargestLevel<DeepOrFlatSamples>
where
T: Clone,
type Owned = T;fn to_owned(&self) -> Tfn clone_into(&self, target: &mut T)
impl<T, U> Into<U> for ReadLargestLevel<DeepOrFlatSamples>
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for ReadLargestLevel<DeepOrFlatSamples>
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for ReadLargestLevel<DeepOrFlatSamples>
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>