pub struct SamplerDescriptor(/* private fields */);Expand description
A configuration for a sampler state.
C++ equivalent: MTL::SamplerDescriptor
Implementations§
Source§impl SamplerDescriptor
impl SamplerDescriptor
Sourcepub fn new() -> Option<Self>
pub fn new() -> Option<Self>
Create a new sampler descriptor.
C++ equivalent: static SamplerDescriptor* alloc()->init()
Sourcepub unsafe fn from_raw(ptr: *mut c_void) -> Option<Self>
pub unsafe fn from_raw(ptr: *mut c_void) -> Option<Self>
Create a SamplerDescriptor from a raw pointer.
§Safety
The pointer must be a valid Metal sampler descriptor object.
Sourcepub fn min_filter(&self) -> SamplerMinMagFilter
pub fn min_filter(&self) -> SamplerMinMagFilter
Get the minification filter.
C++ equivalent: SamplerMinMagFilter minFilter() const
Sourcepub fn set_min_filter(&self, filter: SamplerMinMagFilter)
pub fn set_min_filter(&self, filter: SamplerMinMagFilter)
Set the minification filter.
C++ equivalent: void setMinFilter(SamplerMinMagFilter)
Sourcepub fn mag_filter(&self) -> SamplerMinMagFilter
pub fn mag_filter(&self) -> SamplerMinMagFilter
Get the magnification filter.
C++ equivalent: SamplerMinMagFilter magFilter() const
Sourcepub fn set_mag_filter(&self, filter: SamplerMinMagFilter)
pub fn set_mag_filter(&self, filter: SamplerMinMagFilter)
Set the magnification filter.
C++ equivalent: void setMagFilter(SamplerMinMagFilter)
Sourcepub fn mip_filter(&self) -> SamplerMipFilter
pub fn mip_filter(&self) -> SamplerMipFilter
Get the mipmap filter.
C++ equivalent: SamplerMipFilter mipFilter() const
Sourcepub fn set_mip_filter(&self, filter: SamplerMipFilter)
pub fn set_mip_filter(&self, filter: SamplerMipFilter)
Set the mipmap filter.
C++ equivalent: void setMipFilter(SamplerMipFilter)
Sourcepub fn s_address_mode(&self) -> SamplerAddressMode
pub fn s_address_mode(&self) -> SamplerAddressMode
Get the S (horizontal) address mode.
C++ equivalent: SamplerAddressMode sAddressMode() const
Sourcepub fn set_s_address_mode(&self, mode: SamplerAddressMode)
pub fn set_s_address_mode(&self, mode: SamplerAddressMode)
Set the S (horizontal) address mode.
C++ equivalent: void setSAddressMode(SamplerAddressMode)
Sourcepub fn t_address_mode(&self) -> SamplerAddressMode
pub fn t_address_mode(&self) -> SamplerAddressMode
Get the T (vertical) address mode.
C++ equivalent: SamplerAddressMode tAddressMode() const
Sourcepub fn set_t_address_mode(&self, mode: SamplerAddressMode)
pub fn set_t_address_mode(&self, mode: SamplerAddressMode)
Set the T (vertical) address mode.
C++ equivalent: void setTAddressMode(SamplerAddressMode)
Sourcepub fn r_address_mode(&self) -> SamplerAddressMode
pub fn r_address_mode(&self) -> SamplerAddressMode
Get the R (depth) address mode.
C++ equivalent: SamplerAddressMode rAddressMode() const
Sourcepub fn set_r_address_mode(&self, mode: SamplerAddressMode)
pub fn set_r_address_mode(&self, mode: SamplerAddressMode)
Set the R (depth) address mode.
C++ equivalent: void setRAddressMode(SamplerAddressMode)
Sourcepub fn border_color(&self) -> SamplerBorderColor
pub fn border_color(&self) -> SamplerBorderColor
Get the border color.
C++ equivalent: SamplerBorderColor borderColor() const
Sourcepub fn set_border_color(&self, color: SamplerBorderColor)
pub fn set_border_color(&self, color: SamplerBorderColor)
Set the border color.
C++ equivalent: void setBorderColor(SamplerBorderColor)
Sourcepub fn lod_min_clamp(&self) -> f32
pub fn lod_min_clamp(&self) -> f32
Get the minimum LOD clamp.
C++ equivalent: float lodMinClamp() const
Sourcepub fn set_lod_min_clamp(&self, clamp: f32)
pub fn set_lod_min_clamp(&self, clamp: f32)
Set the minimum LOD clamp.
C++ equivalent: void setLodMinClamp(float)
Sourcepub fn lod_max_clamp(&self) -> f32
pub fn lod_max_clamp(&self) -> f32
Get the maximum LOD clamp.
C++ equivalent: float lodMaxClamp() const
Sourcepub fn set_lod_max_clamp(&self, clamp: f32)
pub fn set_lod_max_clamp(&self, clamp: f32)
Set the maximum LOD clamp.
C++ equivalent: void setLodMaxClamp(float)
Sourcepub fn set_lod_bias(&self, bias: f32)
pub fn set_lod_bias(&self, bias: f32)
Set the LOD bias.
C++ equivalent: void setLodBias(float)
Sourcepub fn lod_average(&self) -> bool
pub fn lod_average(&self) -> bool
Get whether LOD averaging is enabled.
C++ equivalent: bool lodAverage() const
Sourcepub fn set_lod_average(&self, average: bool)
pub fn set_lod_average(&self, average: bool)
Set whether LOD averaging is enabled.
C++ equivalent: void setLodAverage(bool)
Sourcepub fn max_anisotropy(&self) -> UInteger
pub fn max_anisotropy(&self) -> UInteger
Get the maximum anisotropy.
C++ equivalent: NS::UInteger maxAnisotropy() const
Sourcepub fn set_max_anisotropy(&self, max: UInteger)
pub fn set_max_anisotropy(&self, max: UInteger)
Set the maximum anisotropy.
C++ equivalent: void setMaxAnisotropy(NS::UInteger)
Sourcepub fn compare_function(&self) -> CompareFunction
pub fn compare_function(&self) -> CompareFunction
Get the compare function.
C++ equivalent: CompareFunction compareFunction() const
Sourcepub fn set_compare_function(&self, func: CompareFunction)
pub fn set_compare_function(&self, func: CompareFunction)
Set the compare function.
C++ equivalent: void setCompareFunction(CompareFunction)
Sourcepub fn reduction_mode(&self) -> SamplerReductionMode
pub fn reduction_mode(&self) -> SamplerReductionMode
Get the reduction mode.
C++ equivalent: SamplerReductionMode reductionMode() const
Sourcepub fn set_reduction_mode(&self, mode: SamplerReductionMode)
pub fn set_reduction_mode(&self, mode: SamplerReductionMode)
Set the reduction mode.
C++ equivalent: void setReductionMode(SamplerReductionMode)
Sourcepub fn normalized_coordinates(&self) -> bool
pub fn normalized_coordinates(&self) -> bool
Check if normalized coordinates are used.
C++ equivalent: bool normalizedCoordinates() const
Sourcepub fn set_normalized_coordinates(&self, normalized: bool)
pub fn set_normalized_coordinates(&self, normalized: bool)
Set whether normalized coordinates are used.
C++ equivalent: void setNormalizedCoordinates(bool)
Sourcepub fn set_label(&self, label: &str)
pub fn set_label(&self, label: &str)
Set the label.
C++ equivalent: void setLabel(const NS::String*)
Sourcepub fn support_argument_buffers(&self) -> bool
pub fn support_argument_buffers(&self) -> bool
Check if LOD average is supported.
C++ equivalent: bool supportArgumentBuffers() const
Sourcepub fn set_support_argument_buffers(&self, support: bool)
pub fn set_support_argument_buffers(&self, support: bool)
Set whether argument buffers are supported.
C++ equivalent: void setSupportArgumentBuffers(bool)