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§
source§impl 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§
source§impl From<FilterMode> for Sampler
impl From<FilterMode> for Sampler
source§fn from(filter: FilterMode) -> Self
fn from(filter: FilterMode) -> Self
Converts to this type from the input type.
source§impl<'a> From<Sampler> for SamplerDescriptor<'a>
impl<'a> From<Sampler> for SamplerDescriptor<'a>
source§impl Ord for Sampler
impl Ord for Sampler
source§impl PartialEq<Sampler> for Sampler
impl PartialEq<Sampler> for Sampler
source§impl PartialOrd<Sampler> for Sampler
impl PartialOrd<Sampler> for Sampler
1.0.0 · source§fn 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§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<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,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
source§impl<T> HasMut<T> for T
impl<T> HasMut<T> for T
source§fn retrieve_mut(&mut self) -> &mut T
fn retrieve_mut(&mut self) -> &mut T
Method to retrieve the context type as mutable.