#[non_exhaustive]
#[repr(i32)]
pub enum SamplerAddressMode { Repeat = 0, MirroredRepeat = 1, ClampToEdge = 2, ClampToBorder = 3, MirrorClampToEdge = 4, }
Expand description

How the sampler should behave when it needs to access a pixel that is out of range of the texture.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Repeat = 0

Repeat the texture. In other words, the pixel at coordinate x + 1.0 is the same as the one at coordinate x.

§

MirroredRepeat = 1

Repeat the texture but mirror it at every repetition. In other words, the pixel at coordinate x + 1.0 is the same as the one at coordinate 1.0 - x.

§

ClampToEdge = 2

The coordinates are clamped to the valid range. Coordinates below 0.0 have the same value as coordinate 0.0. Coordinates over 1.0 have the same value as coordinate 1.0.

§

ClampToBorder = 3

Any pixel out of range is colored using the colour selected with the border_color on the SamplerBuilder.

When this mode is chosen, the numeric type of the image view’s format must match the border color. When using a floating-point border color, the sampler can only be used with floating-point or depth image views. When using an integer border color, the sampler can only be used with integer or stencil image views. In addition to this, you can’t use an opaque black border color with an image view that uses component swizzling.

§

MirrorClampToEdge = 4

Similar to MirroredRepeat, except that coordinates are clamped to the range [-1.0, 1.0].

The sampler_mirror_clamp_to_edge feature or the khr_sampler_mirror_clamp_to_edge extension must be enabled on the device.

Trait Implementations§

source§

impl Clone for SamplerAddressMode

source§

fn clone(&self) -> SamplerAddressMode

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 Debug for SamplerAddressMode

source§

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

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

impl From<SamplerAddressMode> for SamplerAddressMode

source§

fn from(val: SamplerAddressMode) -> Self

Converts to this type from the input type.
source§

impl Hash for SamplerAddressMode

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for SamplerAddressMode

source§

fn eq(&self, other: &SamplerAddressMode) -> 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 TryFrom<SamplerAddressMode> for SamplerAddressMode

§

type Error = ()

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

fn try_from(val: SamplerAddressMode) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl Copy for SamplerAddressMode

source§

impl Eq for SamplerAddressMode

source§

impl StructuralEq for SamplerAddressMode

source§

impl StructuralPartialEq for SamplerAddressMode

Auto Trait Implementations§

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> 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.