Enum vulkano::image::sampler::SamplerAddressMode
source · #[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
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
impl Clone for SamplerAddressMode
source§fn clone(&self) -> SamplerAddressMode
fn clone(&self) -> SamplerAddressMode
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for SamplerAddressMode
impl Debug for SamplerAddressMode
source§impl From<SamplerAddressMode> for SamplerAddressMode
impl From<SamplerAddressMode> for SamplerAddressMode
source§fn from(val: SamplerAddressMode) -> Self
fn from(val: SamplerAddressMode) -> Self
source§impl Hash for SamplerAddressMode
impl Hash for SamplerAddressMode
source§impl PartialEq for SamplerAddressMode
impl PartialEq for SamplerAddressMode
source§fn eq(&self, other: &SamplerAddressMode) -> bool
fn eq(&self, other: &SamplerAddressMode) -> bool
self
and other
values to be equal, and is used
by ==
.