pub struct TextureViewDescriptor(/* private fields */);Expand description
Configuration for creating texture views.
C++ equivalent: MTL::TextureViewDescriptor
Implementations§
Source§impl TextureViewDescriptor
impl TextureViewDescriptor
Sourcepub fn new() -> Option<Self>
pub fn new() -> Option<Self>
Create a new texture view descriptor.
C++ equivalent: static TextureViewDescriptor* 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 TextureViewDescriptor from a raw pointer.
§Safety
The pointer must be a valid Metal texture view descriptor object.
Sourcepub fn pixel_format(&self) -> PixelFormat
pub fn pixel_format(&self) -> PixelFormat
Get the pixel format.
Sourcepub fn texture_type(&self) -> TextureType
pub fn texture_type(&self) -> TextureType
Get the texture type.
Sourcepub fn level_range(&self) -> Range
pub fn level_range(&self) -> Range
Get the level range.
Sourcepub fn slice_range(&self) -> Range
pub fn slice_range(&self) -> Range
Get the slice range.
Sourcepub fn swizzle(&self) -> TextureSwizzleChannels
pub fn swizzle(&self) -> TextureSwizzleChannels
Get the swizzle channels.
Sourcepub fn set_pixel_format(&self, pixel_format: PixelFormat)
pub fn set_pixel_format(&self, pixel_format: PixelFormat)
Set the pixel format.
Sourcepub fn set_texture_type(&self, texture_type: TextureType)
pub fn set_texture_type(&self, texture_type: TextureType)
Set the texture type.
Sourcepub fn set_level_range(&self, range: Range)
pub fn set_level_range(&self, range: Range)
Set the level range.
Sourcepub fn set_slice_range(&self, range: Range)
pub fn set_slice_range(&self, range: Range)
Set the slice range.
Sourcepub fn set_swizzle(&self, swizzle: TextureSwizzleChannels)
pub fn set_swizzle(&self, swizzle: TextureSwizzleChannels)
Set the swizzle channels.
Trait Implementations§
Source§impl Clone for TextureViewDescriptor
impl Clone for TextureViewDescriptor
Source§impl Debug for TextureViewDescriptor
impl Debug for TextureViewDescriptor
Source§impl Default for TextureViewDescriptor
impl Default for TextureViewDescriptor
Source§impl Drop for TextureViewDescriptor
impl Drop for TextureViewDescriptor
Source§impl Referencing for TextureViewDescriptor
impl Referencing for TextureViewDescriptor
Source§fn as_mut_ptr(&self) -> *mut c_void
fn as_mut_ptr(&self) -> *mut c_void
Get the raw mutable pointer to the Objective-C object.
Source§fn retain(&self) -> Selfwhere
Self: Clone,
fn retain(&self) -> Selfwhere
Self: Clone,
Retain the object, incrementing its reference count. Read more
Source§fn autorelease(&self) -> Selfwhere
Self: Clone,
fn autorelease(&self) -> Selfwhere
Self: Clone,
Autorelease the object. Read more
Source§fn retain_count(&self) -> usize
fn retain_count(&self) -> usize
Get the retain count of the object. Read more
impl Send for TextureViewDescriptor
impl Sync for TextureViewDescriptor
Auto Trait Implementations§
impl Freeze for TextureViewDescriptor
impl RefUnwindSafe for TextureViewDescriptor
impl Unpin for TextureViewDescriptor
impl UnwindSafe for TextureViewDescriptor
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