# GARAugmentedFaceSession

ARCore Augmented Face Session.

Class is used to take in a series of `CVPixelBufferRef`s and outputs a 3D Face Mesh for the detected face.

## Summary

### Inheritance

Inherits from: `NSObject`

| ### Properties ||
|---|---|
| `https://developers.google.com/ar/reference/ios/interface/GARAugmentedFaceSession#currentframe` | `https://developers.google.com/ar/reference/ios/interface/GARAugmentedFaceFrame#interface_g_a_r_augmented_face_frame *` The most recent frame created from calling `https://developers.google.com/ar/reference/ios/interface/GARAugmentedFaceSession#updatewithpixelbuffer:timestamp:recognitionrotation:`. |
| `https://developers.google.com/ar/reference/ios/interface/GARAugmentedFaceSession#delegate` | `id< https://developers.google.com/ar/reference/ios/protocol/GARAugmentedFaceSessionDelegateP#protocol_g_a_r_augmented_face_session_delegate-p >` Delegate that receives callbacks from the face session. |
| `https://developers.google.com/ar/reference/ios/interface/GARAugmentedFaceSession#delegatequeue` | `dispatch_queue_t` The dispatch queue through which the face session calls your delegate methods. |

| ### Public methods ||
|---|---|
| `https://developers.google.com/ar/reference/ios/interface/GARAugmentedFaceSession#initwithfieldofview:error:` | `instancetype _Nullable` Initializes a `https://developers.google.com/ar/reference/ios/interface/GARAugmentedFaceSession#interface_g_a_r_augmented_face_session` with the camera's field of view. |
| `https://developers.google.com/ar/reference/ios/interface/GARAugmentedFaceSession#updatewithpixelbuffer:timestamp:recognitionrotation:` | `BOOL` Provides the Face Mesh API with a new pixel buffer so it will capture a face frame. |

## Properties

### currentFrame

```
@property(atomic, readonly, nullable) https://developers.google.com/ar/reference/ios/interface/GARAugmentedFaceFrame#interface_g_a_r_augmented_face_frame *https://developers.google.com/ar/reference/ios/interface/GARAugmentedFaceSession#currentframe;
```
The most recent frame created from calling `https://developers.google.com/ar/reference/ios/interface/GARAugmentedFaceSession#updatewithpixelbuffer:timestamp:recognitionrotation:`.

### delegate

```
@property(atomic, weak, nullable) id https://developers.google.com/ar/reference/ios/interface/GARAugmentedFaceSession#delegate;
```
Delegate that receives callbacks from the face session.

### delegateQueue

```
@property(atomic, nullable) dispatch_queue_t https://developers.google.com/ar/reference/ios/interface/GARAugmentedFaceSession#delegatequeue;
```
The dispatch queue through which the face session calls your delegate methods.

## Public methods

### initWithFieldOfView:error:

```
- (instancetype _Nullable)initWithFieldOfView:(float) fieldOfViewerror:(NSError **) error
```
Initializes a `https://developers.google.com/ar/reference/ios/interface/GARAugmentedFaceSession#interface_g_a_r_augmented_face_session` with the camera's field of view.


| Details ||
|---|---|
| Parameters | |---|---| | `fieldOfView` | The camera device's horizontal field of view in degrees. | | `error` | Out parameter for an NSError. Possible errors: - `https://developers.google.com/ar/reference/ios/group/GARAugmentedFaceSessionErrorCode#garaugmentedfacesessionerrorcodedevicenotcompatible` - this device or OS version is not currently supported. | |
| **Returns** | An initialized `https://developers.google.com/ar/reference/ios/interface/GARAugmentedFaceSession#interface_g_a_r_augmented_face_session` or `nil` if there is an error. |

### updateWithPixelBuffer:timestamp:recognitionRotation:

```
- (BOOL)updateWithPixelBuffer:(CVPixelBufferRef) pixelBuffertimestamp:(NSTimeInterval) timestamprecognitionRotation:(NSUInteger) recognitionRotation
```
Provides the Face Mesh API with a new pixel buffer so it will capture a face frame.


| Details ||
|---|---|
| Parameters | |---|---| | `pixelBuffer` | `CVPixelBufferRef` containing camera image. | | `timestamp` | Timestamp that you wish to associate with this image. Timestamps must monotonically increase on successive calls to this method. | | `recognitionRotation` | The counter-clockwise rotation in degrees required to orient the face upwards for face detection. NOTE: The default camera orientation is landscape left. When holding the phone in portrait and taking a selfie this should be set to 270. The 270 degree rotation rotates a landscape camera image to portrait with the head pointing up. | |
| **Returns** | `YES` if the frame was accepted for processing. `NO` if the frame was not accepted for processing. This will occur when the session has too many frames in the queue to process. |