# GARFrame

ARCore frame class.

Each `https://developers.google.com/ar/reference/ios/interface/GARFrame#interface_g_a_r_frame` corresponds to an `ARFrame` that was passed into a `https://developers.google.com/ar/reference/ios/interface/GARSession#interface_g_a_r_session` with a call to `https://developers.google.com/ar/reference/ios/interface/GARSession#update:error:`. GARFrames are immutable, since new `ARFrame`s can be generated by **ARKit** at any time. For Augmented Faces, see `https://developers.google.com/ar/reference/ios/interface/GARAugmentedFaceFrame#interface_g_a_r_augmented_face_frame`.

## Summary

### Inheritance

Inherits from: `NSObject`

| ### Properties ||
|---|---|
| `https://developers.google.com/ar/reference/ios/interface/GARFrame#anchors` | `NSArray< https://developers.google.com/ar/reference/ios/interface/GARAnchor#interface_g_a_r_anchor * > *` All anchors in the `https://developers.google.com/ar/reference/ios/interface/GARSession#interface_g_a_r_session` at the timestamp of this frame, plus any anchors removed by the `https://developers.google.com/ar/reference/ios/interface/GARSession#interface_g_a_r_session` since the last frame was generated. |
| `https://developers.google.com/ar/reference/ios/interface/GARFrame#earth` | `https://developers.google.com/ar/reference/ios/interface/GAREarth#interface_g_a_r_earth *` Snapshot of the `https://developers.google.com/ar/reference/ios/interface/GAREarth#interface_g_a_r_earth` state for this frame. |
| `https://developers.google.com/ar/reference/ios/interface/GARFrame#semanticconfidenceimage` | `CVPixelBufferRef` The latest semantic confidence image for the `https://developers.google.com/ar/reference/ios/interface/GARFrame#interface_g_a_r_frame` as a [`CVPixelBuffer`](https://developer.apple.com/documentation/corevideo/cvpixelbuffer). |
| `https://developers.google.com/ar/reference/ios/interface/GARFrame#semanticimage` | `CVPixelBufferRef` The latest semantic image for the `https://developers.google.com/ar/reference/ios/interface/GARFrame#interface_g_a_r_frame` as a [`CVPixelBuffer`](https://developer.apple.com/documentation/corevideo/cvpixelbuffer). |
| `https://developers.google.com/ar/reference/ios/interface/GARFrame#streetscapegeometries` | `NSArray< https://developers.google.com/ar/reference/ios/interface/GARStreetscapeGeometry#interface_g_a_r_streetscape_geometry * > *` List of snapshots of `https://developers.google.com/ar/reference/ios/interface/GARStreetscapeGeometry#interface_g_a_r_streetscape_geometry` for this frame. |
| `https://developers.google.com/ar/reference/ios/interface/GARFrame#timestamp` | `NSTimeInterval` The frame timestamp. |
| `https://developers.google.com/ar/reference/ios/interface/GARFrame#updatedanchors` | `NSArray< https://developers.google.com/ar/reference/ios/interface/GARAnchor#interface_g_a_r_anchor * > *` The subset of the anchors array consisting of those anchors that have changed since the last frame was generated. |

| ### Public methods ||
|---|---|
| `https://developers.google.com/ar/reference/ios/interface/GARFrame#fractionforsemanticlabel:` | `float` Retrieves the fraction of the most recent semantics frame that are `queryLabel`. |

## Properties

### anchors

```
@property(nonatomic, readonly) NSArray *https://developers.google.com/ar/reference/ios/interface/GARFrame#anchors;
```
All anchors in the `https://developers.google.com/ar/reference/ios/interface/GARSession#interface_g_a_r_session` at the timestamp of this frame, plus any anchors removed by the `https://developers.google.com/ar/reference/ios/interface/GARSession#interface_g_a_r_session` since the last frame was generated.

Each anchor in this array is an immutable snapshot of an underlying anchor, which can be uniquely identified by the anchor's identifier property.

### earth

```
@property(nonatomic, readonly, nullable) https://developers.google.com/ar/reference/ios/interface/GAREarth#interface_g_a_r_earth *earth;
```
Snapshot of the `https://developers.google.com/ar/reference/ios/interface/GAREarth#interface_g_a_r_earth` state for this frame.

This will be nil if `https://developers.google.com/ar/reference/ios/category/GARSessionConfiguration(Geospatial)#geospatialmode` is disabled.
Provided by category `https://developers.google.com/ar/reference/ios/category/GARFrame(Geospatial)#category_g_a_r_frame_07_geospatial_08_1aab5b3788bfdd747edb32c0cafeb827ab`.

### semanticConfidenceImage

```
@property(nullable, readonly) CVPixelBufferRef semanticConfidenceImage CF_RETURNS_NOT_RETAINED;
```
The latest semantic confidence image for the `https://developers.google.com/ar/reference/ios/interface/GARFrame#interface_g_a_r_frame` as a [`CVPixelBuffer`](https://developer.apple.com/documentation/corevideo/cvpixelbuffer).

Each pixel is an 8-bit integer representing the confidence of the semantic label, with 0 representing the lowest confidence and 255 representing the highest confidence.

`https://developers.google.com/ar/reference/ios/interface/GARFrame#interface_g_a_r_frame` retains the semantic `CVPixelBuffer`. Holding references to `https://developers.google.com/ar/reference/ios/interface/GARFrame#interface_g_a_r_frame`s will eventually exhaust resources.

`https://developers.google.com/ar/reference/ios/category/GARFrame(Semantics)#semanticconfidenceimage` will be nil if `https://developers.google.com/ar/reference/ios/interface/GARSessionConfiguration#interface_g_a_r_session_configuration` does not have `https://developers.google.com/ar/reference/ios/group/GARSemanticMode#garsemanticmodeenabled` set. Use `https://developers.google.com/ar/reference/ios/category/GARSession(Semantics)#issemanticmodesupported:` to check for support for the Scene Semantics API.

`https://developers.google.com/ar/reference/ios/category/GARFrame(Semantics)#semanticconfidenceimage` may be nil for the first few frames after initializing semantics, or if memory is exhausted due to retaining old `https://developers.google.com/ar/reference/ios/interface/GARFrame#interface_g_a_r_frame`s.
Provided by category `https://developers.google.com/ar/reference/ios/category/GARFrame(Semantics)#category_g_a_r_frame_07_semantics_08_1aba2335384b07d882ebc284158fa697f9`.

### semanticImage

```
@property(nullable, readonly) CVPixelBufferRef semanticImage CF_RETURNS_NOT_RETAINED;
```
The latest semantic image for the `https://developers.google.com/ar/reference/ios/interface/GARFrame#interface_g_a_r_frame` as a [`CVPixelBuffer`](https://developer.apple.com/documentation/corevideo/cvpixelbuffer).

Each pixel in the image is an 8-bit integer representing a semantic class label: see `https://developers.google.com/ar/reference/ios/group/GARSemanticLabel#garsemanticlabel` for a list of pixel labels and [the Scene Semantics Developer Guide](https://developers.google.com/ar/develop/ios/scene-semantics) for more information.

`https://developers.google.com/ar/reference/ios/interface/GARFrame#interface_g_a_r_frame` retains the semantic `CVPixelBuffer`. Holding references to `https://developers.google.com/ar/reference/ios/interface/GARFrame#interface_g_a_r_frame`s will eventually exhaust resources.

`https://developers.google.com/ar/reference/ios/category/GARFrame(Semantics)#semanticimage` will be nil if `https://developers.google.com/ar/reference/ios/interface/GARSessionConfiguration#interface_g_a_r_session_configuration` does not have `https://developers.google.com/ar/reference/ios/group/GARSemanticMode#garsemanticmodeenabled` set. Use `https://developers.google.com/ar/reference/ios/category/GARSession(Semantics)#issemanticmodesupported:` to check for support for the Scene Semantics API.

`https://developers.google.com/ar/reference/ios/category/GARFrame(Semantics)#semanticimage` may be nil for the first few frames after initializing semantics, or if memory is exhausted due to retaining old `https://developers.google.com/ar/reference/ios/interface/GARFrame#interface_g_a_r_frame`s.
Provided by category `https://developers.google.com/ar/reference/ios/category/GARFrame(Semantics)#category_g_a_r_frame_07_semantics_08_1ae4f7b3d8df273c055755b2433e97dd64`.

### streetscapeGeometries

```
@property(nonatomic, readonly, nullable) NSArray *streetscapeGeometries;
```
List of snapshots of `https://developers.google.com/ar/reference/ios/interface/GARStreetscapeGeometry#interface_g_a_r_streetscape_geometry` for this frame.

See the [Streetscape Geometry Developer Guide](https://developers.google.com/ar/develop/ios/geospatial/streetscape-geometry) for additional information.

This will be `nil` if `https://developers.google.com/ar/reference/ios/category/GARSessionConfiguration(Geospatial)#streetscapegeometrymode` is disabled.
Provided by category `https://developers.google.com/ar/reference/ios/category/GARFrame(Geospatial)#category_g_a_r_frame_07_geospatial_08_1a628584db78260b59de09ad5efb1c4eab`.

### timestamp

```
@property(nonatomic, readonly) NSTimeInterval https://developers.google.com/ar/reference/ios/interface/GARFrame#timestamp;
```
The frame timestamp.

This is equal to the timestamp on the corresponding `ARFrame`, and represents time since boot in seconds.

### updatedAnchors

```
@property(nonatomic, readonly) NSArray *https://developers.google.com/ar/reference/ios/interface/GARFrame#updatedanchors;
```
The subset of the anchors array consisting of those anchors that have changed since the last frame was generated.

This should only be used if the immediately previous frame was processed.

## Public methods

### fractionForSemanticLabel:

```
- (float)fractionForSemanticLabel:(https://developers.google.com/ar/reference/ios/group/GARSemanticLabel#garsemanticlabel) queryLabel
```
Retrieves the fraction of the most recent semantics frame that are `queryLabel`.

Queries the semantic image provided by `https://developers.google.com/ar/reference/ios/category/GARFrame(Semantics)#semanticimage` for pixels labeled by `queryLabel`. This call is more efficient than retrieving the `CVPixelBuffer` and performing a pixel-wise search for the detected labels.

If `https://developers.google.com/ar/reference/ios/category/GARFrame(Semantics)#semanticimage` is nil, `https://developers.google.com/ar/reference/ios/category/GARFrame(Semantics)#fractionforsemanticlabel:` will return 0.0.


Details Parameters `queryLabel` the label to search for in the semantic image. See `https://developers.google.com/ar/reference/ios/group/GARSemanticLabel#garsemanticlabel` for options. **Returns** The fraction of the semantic image with the given `queryLabel`. Provided by category `https://developers.google.com/ar/reference/ios/category/GARFrame(Semantics)#category_g_a_r_frame_07_semantics_08_1a20c44998075101f44c360592025b2ed4`.