cp_view_texture_map

Struct cp_view_texture_map 

Source
#[repr(C)]
pub struct cp_view_texture_map { /* private fields */ }
Available on crate feature view only.
Expand description

Implementations§

Source§

impl cp_view_texture_map

Source

pub unsafe fn texture_index(view_texture_map: cp_view_texture_map_t) -> usize

Returns the index of the view’s textures in the drawable.

  • Parameters:
  • view_texture_map: The texture map for your view.
  • Returns: The index of the color or depth texture in the drawable.

Pass the returned index to the cp_drawable_get_color_texture or cp_drawable_get_depth_texture function.

Source

pub unsafe fn slice_index(view_texture_map: cp_view_texture_map_t) -> usize

Returns the index of the view’s texture in an array-based texture type.

  • Parameters:
  • view_texture_map: The texture map for your view.
  • Returns: The index of the view’s texture in an array-based texture type.

Use the returned index to retrieve the view’s texture when the texture type is <doc ://com.apple.documentation/documentation/metal/mtltexturetype/type2darray>. When configuring your render pass descriptor, specify the index in the <doc ://com.apple.documentation/documentation/metal/mtlrenderpassattachmentdescriptor/1437914-slice> property of the descriptor’s color and depth attachments.

To request an array-based texture from your layer, configure your layer with the cp_layer_renderer_layout/cp_layer_renderer_layout_dedicated layout option.

Source

pub unsafe fn viewport(view_texture_map: cp_view_texture_map_t) -> MTLViewport

Available on crate feature objc2-metal only.

Returns the portion of the texture that the view uses to draw its content.

  • Parameters:
  • view_texture_map: The texture map for your view.
  • Returns: A Metal viewport that specifies the view’s size and location in the texture.

Call this function to get the size of the view and its location within the texture. If the layer dedicates a separate texture to each view, the texture bounds and view bounds match. However, if the layer uses a shared or layered texture, the view’s location or other slice index might differ.

Trait Implementations§

Source§

impl Debug for cp_view_texture_map

Source§

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

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

impl RefEncode for cp_view_texture_map

Source§

const ENCODING_REF: Encoding

The Objective-C type-encoding for a reference of this type. Read more

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> 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, 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.
Source§

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