# GARAugmentedFaceFrame

Object that holds all relevant information for an Augmented Faces frame during which face detection was run.

## Summary

### Inheritance

Inherits from: `NSObject`

| ### Properties ||
|---|---|
| `https://developers.google.com/ar/reference/ios/interface/GARAugmentedFaceFrame#capturedimage` | `CVPixelBufferRef` A buffer containing the image that was input to `https://developers.google.com/ar/reference/ios/interface/GARAugmentedFaceSession#interface_g_a_r_augmented_face_session`. |
| `https://developers.google.com/ar/reference/ios/interface/GARAugmentedFaceFrame#face` | `https://developers.google.com/ar/reference/ios/interface/GARAugmentedFace#interface_g_a_r_augmented_face *` Contains a `https://developers.google.com/ar/reference/ios/interface/GARAugmentedFace#interface_g_a_r_augmented_face` if a face is detected in this frame, otherwise `nil`. |
| `https://developers.google.com/ar/reference/ios/interface/GARAugmentedFaceFrame#timestamp` | `NSTimeInterval` The time at which the frame was captured. |

| ### Public methods ||
|---|---|
| `https://developers.google.com/ar/reference/ios/interface/GARAugmentedFaceFrame#displaytransformforviewportsize:presentationorientation:mirrored:` | `CGAffineTransform` A transform that converts between image coordinates and coordinate space for displaying 2D content on screen that is aligned with the AR rendered content. |
| `https://developers.google.com/ar/reference/ios/interface/GARAugmentedFaceFrame#projectionmatrixforviewportsize:presentationorientation:mirrored:znear:zfar:` | `simd_float4x4` A 3D projection matrix that will result in the correct alignment of AR rendered content on top of the captured camera image. |

## Properties

### capturedImage

```
@property(nonatomic, readonly) CVPixelBufferRef https://developers.google.com/ar/reference/ios/interface/GARAugmentedFaceFrame#capturedimage;
```
A buffer containing the image that was input to `https://developers.google.com/ar/reference/ios/interface/GARAugmentedFaceSession#interface_g_a_r_augmented_face_session`.

### face

```
@property(nonatomic, readonly, nullable) https://developers.google.com/ar/reference/ios/interface/GARAugmentedFace#interface_g_a_r_augmented_face *https://developers.google.com/ar/reference/ios/interface/GARAugmentedFaceFrame#face;
```
Contains a `https://developers.google.com/ar/reference/ios/interface/GARAugmentedFace#interface_g_a_r_augmented_face` if a face is detected in this frame, otherwise `nil`.

### timestamp

```
@property(nonatomic, readonly) NSTimeInterval https://developers.google.com/ar/reference/ios/interface/GARAugmentedFaceFrame#timestamp;
```
The time at which the frame was captured.

This is simply the timestamp passed into `https://developers.google.com/ar/reference/ios/interface/GARAugmentedFaceSession#updatewithpixelbuffer:timestamp:recognitionrotation:`.

## Public methods

### displayTransformForViewportSize:presentationOrientation:mirrored:

```
- (CGAffineTransform)displayTransformForViewportSize:(CGSize) viewPortSizepresentationOrientation:(UIDeviceOrientation) presentationOrientationmirrored:(BOOL) mirrored
```
A transform that converts between image coordinates and coordinate space for displaying 2D content on screen that is aligned with the AR rendered content.

This method assumes camera images are rendered to aspect fill, not aspect fit.

| Details ||
|---|---|
| Parameters | |---|---| | `viewPortSize` | The size of the view used to render the camera image. | | `presentationOrientation` | The orientation in which to display the 2D content. `UIDeviceOrientationUnknown`, `UIDeviceOrientationFaceUp` and `UIDeviceOrientationFaceDown` map to `UIDeviceOrientationPortrait`. | | `mirrored` | Whether to provide a mirrored transform. Use this in conjunction with the value passed in `https://developers.google.com/ar/reference/ios/interface/GARAugmentedFaceFrame#projectionmatrixforviewportsize:presentationorientation:mirrored:znear:zfar:`. | |

### projectionMatrixForViewportSize:presentationOrientation:mirrored:zNear:zFar:

```
- (simd_float4x4)projectionMatrixForViewportSize:(CGSize) viewPortSizepresentationOrientation:(UIDeviceOrientation) presentationOrientationmirrored:(BOOL) mirroredzNear:(CGFloat) zNearzFar:(CGFloat) zFar
```
A 3D projection matrix that will result in the correct alignment of AR rendered content on top of the captured camera image.

This method assumes camera images are rendered to aspect fill, not aspect fit.

| Details ||
|---|---|
| Parameters | |---|---| | `viewPortSize` | The size of the view into which the AR content will be rendered. | | `presentationOrientation` | The orientation in which to display the AR content. `UIDeviceOrientationUnknown`, `UIDeviceOrientationFaceUp` and `UIDeviceOrientationFaceDown` map to `UIDeviceOrientationPortrait`. | | `mirrored` | Whether to provide a mirrored projection matrix. This will require you to flip the winding order for rendering. | | `zNear` | The near clipping distance in meters. | | `zFar` | The far clipping distance in meters. Must be positive and greater than the near distance. | |