pub struct Sampler {
pub clamp_u: ClampMode,
pub clamp_v: ClampMode,
pub clamp_w: ClampMode,
pub mag: FilterMode,
pub min: FilterMode,
}
Expand description
Sampler state that is used when sampling images on the GPU.
Fields
clamp_u: ClampMode
Clamping mode in the U (x) direction.
clamp_v: ClampMode
Clamping mode in the V (y) direction.
clamp_w: ClampMode
Clamping mode in the W (z) direction.
mag: FilterMode
Magnification (upscaling) filter.
min: FilterMode
Minification (downscaling) filter.
Implementations
sourceimpl Sampler
impl Sampler
sourcepub fn linear_clamp() -> Self
pub fn linear_clamp() -> Self
Sampler state with linear filtering and edge clamping.
sourcepub fn nearest_clamp() -> Self
pub fn nearest_clamp() -> Self
Sampler state with nearest filtering and edge clamping.
Ideal for pixel art.
Trait Implementations
sourceimpl From<FilterMode> for Sampler
impl From<FilterMode> for Sampler
sourcefn from(filter: FilterMode) -> Self
fn from(filter: FilterMode) -> Self
Converts to this type from the input type.
sourceimpl<'a> From<Sampler> for SamplerDescriptor<'a>
impl<'a> From<Sampler> for SamplerDescriptor<'a>
sourceimpl Ord for Sampler
impl Ord for Sampler
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialOrd<Sampler> for Sampler
impl PartialOrd<Sampler> for Sampler
sourcefn partial_cmp(&self, other: &Sampler) -> Option<Ordering>
fn partial_cmp(&self, other: &Sampler) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for Sampler
impl Eq for Sampler
impl StructuralEq for Sampler
impl StructuralPartialEq for Sampler
Auto Trait Implementations
impl RefUnwindSafe for Sampler
impl Send for Sampler
impl Sync for Sampler
impl Unpin for Sampler
impl UnwindSafe for Sampler
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.sourceimpl<T> HasMut<T> for T
impl<T> HasMut<T> for T
sourcefn retrieve_mut(&mut self) -> &mut T
fn retrieve_mut(&mut self) -> &mut T
Method to retrieve the context type as mutable.