pub struct ReadLargestLevel<DeepOrFlatSamples> {
    pub read_samples: DeepOrFlatSamples,
}
Expand description

Specify to read only the highest resolution level, skipping all smaller variations. The sample storage can be [ReadFlatSamples].

Fields§

§read_samples: DeepOrFlatSamples

The sample reading specification

Implementations§

source§

impl<DeepOrFlatSamples> ReadLargestLevel<DeepOrFlatSamples>

source

pub fn all_channels(self) -> ReadAnyChannels<DeepOrFlatSamples>

Read all arbitrary channels in each layer.

source

pub 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.0 if 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, u32 or Sample.

Throws an error for images with deep data or subsampling. Use specific_channels or all_channels if you want to read something other than rgba.

source

pub 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, u32 or Sample.

Throws an error for images with deep data or subsampling. Use specific_channels or all_channels if you want to read something other than rgb.

source

pub fn specific_channels(self) -> ReadZeroChannels

Read 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. Call collect_pixels afterwards to define the pixel container for your set of channels.

Throws an error for images with deep data or subsampling.

Trait Implementations§

source§

impl<DeepOrFlatSamples: Clone> Clone for ReadLargestLevel<DeepOrFlatSamples>

source§

fn clone(&self) -> ReadLargestLevel<DeepOrFlatSamples>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<DeepOrFlatSamples: Debug> Debug for ReadLargestLevel<DeepOrFlatSamples>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<DeepOrFlatSamples: PartialEq> PartialEq<ReadLargestLevel<DeepOrFlatSamples>> for ReadLargestLevel<DeepOrFlatSamples>

source§

fn eq(&self, other: &ReadLargestLevel<DeepOrFlatSamples>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<DeepOrFlatSamples: Eq> Eq for ReadLargestLevel<DeepOrFlatSamples>

source§

impl<DeepOrFlatSamples> StructuralEq for ReadLargestLevel<DeepOrFlatSamples>

source§

impl<DeepOrFlatSamples> StructuralPartialEq for ReadLargestLevel<DeepOrFlatSamples>

Auto Trait Implementations§

§

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> UnwindSafe for ReadLargestLevel<DeepOrFlatSamples>where DeepOrFlatSamples: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.