Skip to main content

SamplerDescriptor

Struct SamplerDescriptor 

Source
pub struct SamplerDescriptor(/* private fields */);
Expand description

A configuration for a sampler state.

C++ equivalent: MTL::SamplerDescriptor

Implementations§

Source§

impl SamplerDescriptor

Source

pub fn new() -> Option<Self>

Create a new sampler descriptor.

C++ equivalent: static SamplerDescriptor* alloc()->init()

Source

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.

Source

pub fn as_raw(&self) -> *mut c_void

Get the raw pointer.

Source

pub fn min_filter(&self) -> SamplerMinMagFilter

Get the minification filter.

C++ equivalent: SamplerMinMagFilter minFilter() const

Source

pub fn set_min_filter(&self, filter: SamplerMinMagFilter)

Set the minification filter.

C++ equivalent: void setMinFilter(SamplerMinMagFilter)

Source

pub fn mag_filter(&self) -> SamplerMinMagFilter

Get the magnification filter.

C++ equivalent: SamplerMinMagFilter magFilter() const

Source

pub fn set_mag_filter(&self, filter: SamplerMinMagFilter)

Set the magnification filter.

C++ equivalent: void setMagFilter(SamplerMinMagFilter)

Source

pub fn mip_filter(&self) -> SamplerMipFilter

Get the mipmap filter.

C++ equivalent: SamplerMipFilter mipFilter() const

Source

pub fn set_mip_filter(&self, filter: SamplerMipFilter)

Set the mipmap filter.

C++ equivalent: void setMipFilter(SamplerMipFilter)

Source

pub fn s_address_mode(&self) -> SamplerAddressMode

Get the S (horizontal) address mode.

C++ equivalent: SamplerAddressMode sAddressMode() const

Source

pub fn set_s_address_mode(&self, mode: SamplerAddressMode)

Set the S (horizontal) address mode.

C++ equivalent: void setSAddressMode(SamplerAddressMode)

Source

pub fn t_address_mode(&self) -> SamplerAddressMode

Get the T (vertical) address mode.

C++ equivalent: SamplerAddressMode tAddressMode() const

Source

pub fn set_t_address_mode(&self, mode: SamplerAddressMode)

Set the T (vertical) address mode.

C++ equivalent: void setTAddressMode(SamplerAddressMode)

Source

pub fn r_address_mode(&self) -> SamplerAddressMode

Get the R (depth) address mode.

C++ equivalent: SamplerAddressMode rAddressMode() const

Source

pub fn set_r_address_mode(&self, mode: SamplerAddressMode)

Set the R (depth) address mode.

C++ equivalent: void setRAddressMode(SamplerAddressMode)

Source

pub fn border_color(&self) -> SamplerBorderColor

Get the border color.

C++ equivalent: SamplerBorderColor borderColor() const

Source

pub fn set_border_color(&self, color: SamplerBorderColor)

Set the border color.

C++ equivalent: void setBorderColor(SamplerBorderColor)

Source

pub fn lod_min_clamp(&self) -> f32

Get the minimum LOD clamp.

C++ equivalent: float lodMinClamp() const

Source

pub fn set_lod_min_clamp(&self, clamp: f32)

Set the minimum LOD clamp.

C++ equivalent: void setLodMinClamp(float)

Source

pub fn lod_max_clamp(&self) -> f32

Get the maximum LOD clamp.

C++ equivalent: float lodMaxClamp() const

Source

pub fn set_lod_max_clamp(&self, clamp: f32)

Set the maximum LOD clamp.

C++ equivalent: void setLodMaxClamp(float)

Source

pub fn lod_bias(&self) -> f32

Get the LOD bias.

C++ equivalent: float lodBias() const

Source

pub fn set_lod_bias(&self, bias: f32)

Set the LOD bias.

C++ equivalent: void setLodBias(float)

Source

pub fn lod_average(&self) -> bool

Get whether LOD averaging is enabled.

C++ equivalent: bool lodAverage() const

Source

pub fn set_lod_average(&self, average: bool)

Set whether LOD averaging is enabled.

C++ equivalent: void setLodAverage(bool)

Source

pub fn max_anisotropy(&self) -> UInteger

Get the maximum anisotropy.

C++ equivalent: NS::UInteger maxAnisotropy() const

Source

pub fn set_max_anisotropy(&self, max: UInteger)

Set the maximum anisotropy.

C++ equivalent: void setMaxAnisotropy(NS::UInteger)

Source

pub fn compare_function(&self) -> CompareFunction

Get the compare function.

C++ equivalent: CompareFunction compareFunction() const

Source

pub fn set_compare_function(&self, func: CompareFunction)

Set the compare function.

C++ equivalent: void setCompareFunction(CompareFunction)

Source

pub fn reduction_mode(&self) -> SamplerReductionMode

Get the reduction mode.

C++ equivalent: SamplerReductionMode reductionMode() const

Source

pub fn set_reduction_mode(&self, mode: SamplerReductionMode)

Set the reduction mode.

C++ equivalent: void setReductionMode(SamplerReductionMode)

Source

pub fn normalized_coordinates(&self) -> bool

Check if normalized coordinates are used.

C++ equivalent: bool normalizedCoordinates() const

Source

pub fn set_normalized_coordinates(&self, normalized: bool)

Set whether normalized coordinates are used.

C++ equivalent: void setNormalizedCoordinates(bool)

Source

pub fn label(&self) -> Option<String>

Get the label.

C++ equivalent: NS::String* label() const

Source

pub fn set_label(&self, label: &str)

Set the label.

C++ equivalent: void setLabel(const NS::String*)

Source

pub fn support_argument_buffers(&self) -> bool

Check if LOD average is supported.

C++ equivalent: bool supportArgumentBuffers() const

Source

pub fn set_support_argument_buffers(&self, support: bool)

Set whether argument buffers are supported.

C++ equivalent: void setSupportArgumentBuffers(bool)

Trait Implementations§

Source§

impl Clone for SamplerDescriptor

Source§

fn clone(&self) -> Self

Returns a duplicate 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 SamplerDescriptor

Source§

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

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

impl Default for SamplerDescriptor

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Drop for SamplerDescriptor

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl Referencing for SamplerDescriptor

Source§

fn as_ptr(&self) -> *const c_void

Get the raw pointer to the Objective-C object.
Source§

fn as_mut_ptr(&self) -> *mut c_void

Get the raw mutable pointer to the Objective-C object.
Source§

fn retain(&self) -> Self
where Self: Clone,

Retain the object, incrementing its reference count. Read more
Source§

fn release(&self)

Release the object, decrementing its reference count. Read more
Source§

fn autorelease(&self) -> Self
where Self: Clone,

Autorelease the object. Read more
Source§

fn retain_count(&self) -> usize

Get the retain count of the object. Read more
Source§

impl Send for SamplerDescriptor

Source§

impl Sync for SamplerDescriptor

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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 T
where 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 T
where T: Clone,

Source§

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 T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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.