cp_frame_timing

Struct cp_frame_timing 

Source
pub struct cp_frame_timing { /* private fields */ }
Available on crate feature frame_timing only.
Expand description

Implementations§

Source§

impl cp_frame_timing

Source

pub unsafe fn optimal_input_time(frame_timing: cp_frame_timing_t) -> cp_time_t

Available on crate feature cp_types only.

Returns the optimal time to query the input for a frame.

  • Parameters:
  • timing_information: The frame’s timing information. Fetch this information using the cp_frame_predict_timing function. If you already called that function once for the frame, you can call the cp_drawable_get_frame_timing function to get the information instead.
  • Returns: The Mach absolute time at which to query the input for your frame.

The returned value indicates the optimal time for you to query the input for your frame.

§Safety

frame_timing must be a valid pointer.

Source

pub unsafe fn rendering_deadline(frame_timing: cp_frame_timing_t) -> cp_time_t

Available on crate feature cp_types only.

Returns the time at which you must finish all work for the specified frame.

  • Parameters:
  • timing_information: The frame’s timing information. Fetch this information using the cp_frame_predict_timing function. If you already called that function once for the frame, you can call the cp_drawable_get_frame_timing function to get the information instead.
  • Returns: The Mach absolute time at which you must finish all work for the frame. This value reflects the total presentation time minus the overhead for the compositor to render your frame and display it onscreen.

Finish all CPU and GPU work by the returned time to ensure the timely display of the frame onscreen.

§Safety

frame_timing must be a valid pointer.

Source

pub unsafe fn presentation_time(frame_timing: cp_frame_timing_t) -> cp_time_t

Available on crate feature cp_types only.

Returns the time at which the system will display the frame onscreen.

  • Parameters:
  • timing_information: The frame’s timing information. Fetch this information using the cp_frame_predict_timing function. If you already called that function once for the frame, you can call the cp_drawable_get_frame_timing function to get the information instead.
  • Returns: The Mach absolute time at which the layer presents the frame onscreen.

You can use the presentation time as a synchronization point for other parts of your app. For example, you might play a specific audio clip when the frame appears.

§Safety

frame_timing must be a valid pointer.

Source

pub unsafe fn trackable_anchor_time( frame_timing: cp_frame_timing_t, ) -> cp_time_t

Available on crate feature cp_types only.

Returns the time to used to predict transform of trackable anchors to provide best content registration with the frame.

  • Parameters:
  • timing_information: The frame’s timing information. Fetch this information using the cp_frame_predict_timing function. If you already called that function once for the frame, you can call the cp_drawable_get_frame_timing function to get the information instead.
  • Returns: The Mach absolute time to use to predict transform of a trackable anchor.

You can use trackable anchor prediction time for prediction of ARKit trackable anchors to register rendered anchored content to the real-world objects. The offset of this time to presentation time is variable, so it is recommended to query this per-frame.

  • note: For predicting ARKit device anchor use presentation time, see cp_frame_timing_get_presentation_time
§Safety

frame_timing must be a valid pointer.

Trait Implementations§

Source§

impl Debug for cp_frame_timing

Source§

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

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

impl RefEncode for cp_frame_timing

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,