# ArCameraConfig

Camera configuration.

## Summary

| ### Enumerations ||
|---|---|
| `https://developers.google.com/ar/reference/c/group/ar-camera-config#arcameraconfigfacingdirection{ https://developers.google.com/ar/reference/c/group/ar-camera-config#ar_camera_config_facing_direction_back = 0, https://developers.google.com/ar/reference/c/group/ar-camera-config#ar_camera_config_facing_direction_front = 1 }` | enumDescribes the direction a camera is facing relative to the device. |

| ### Typedefs ||
|---|---|
| `https://developers.google.com/ar/reference/c/group/ar-camera-config#arcameraconfig` | typedef `struct ArCameraConfig_` A camera config struct that contains the config supported by the physical camera obtained from the low level device profiles. |
| `https://developers.google.com/ar/reference/c/group/ar-camera-config#arcameraconfiglist` | typedef `struct ArCameraConfigList_` A list of camera config ([value type](https://developers.google.com/ar/reference/c/group/concepts#object-ownership)). |

| ### Functions ||
|---|---|
| `https://developers.google.com/ar/reference/c/group/ar-camera-config#arcameraconfiglist_create(const https://developers.google.com/ar/reference/c/group/ar-session#arsession *session, https://developers.google.com/ar/reference/c/group/ar-camera-config#arcameraconfiglist **out_list)` | `void` Creates a camera config list object. |
| `https://developers.google.com/ar/reference/c/group/ar-camera-config#arcameraconfiglist_destroy(https://developers.google.com/ar/reference/c/group/ar-camera-config#arcameraconfiglist *list)` | `void` Releases the memory used by a camera config list object, along with all the camera config references it holds. |
| `https://developers.google.com/ar/reference/c/group/ar-camera-config#arcameraconfiglist_getitem(const https://developers.google.com/ar/reference/c/group/ar-session#arsession *session, const https://developers.google.com/ar/reference/c/group/ar-camera-config#arcameraconfiglist *list, int32_t index, https://developers.google.com/ar/reference/c/group/ar-camera-config#arcameraconfig *out_camera_config)` | `void` Retrieves the specific camera config based on the position in this list. |
| `https://developers.google.com/ar/reference/c/group/ar-camera-config#arcameraconfiglist_getsize(const https://developers.google.com/ar/reference/c/group/ar-session#arsession *session, const https://developers.google.com/ar/reference/c/group/ar-camera-config#arcameraconfiglist *list, int32_t *out_size)` | `void` Retrieves the number of camera configs in this list. |
| `https://developers.google.com/ar/reference/c/group/ar-camera-config#arcameraconfig_create(const https://developers.google.com/ar/reference/c/group/ar-session#arsession *session, https://developers.google.com/ar/reference/c/group/ar-camera-config#arcameraconfig **out_camera_config)` | `void` Creates a camera config object. |
| `https://developers.google.com/ar/reference/c/group/ar-camera-config#arcameraconfig_destroy(https://developers.google.com/ar/reference/c/group/ar-camera-config#arcameraconfig *camera_config)` | `void` Releases the memory used by a camera config object. |
| `https://developers.google.com/ar/reference/c/group/ar-camera-config#arcameraconfig_getcameraid(const https://developers.google.com/ar/reference/c/group/ar-session#arsession *session, const https://developers.google.com/ar/reference/c/group/ar-camera-config#arcameraconfig *camera_config, char **out_camera_id)` | `void` Obtains the camera id for the given camera config which is obtained from the list of ARCore compatible camera configs. |
| `https://developers.google.com/ar/reference/c/group/ar-camera-config#arcameraconfig_getdepthsensorusage(const https://developers.google.com/ar/reference/c/group/ar-session#arsession *session, const https://developers.google.com/ar/reference/c/group/ar-camera-config#arcameraconfig *camera_config, uint32_t *out_depth_sensor_usage)` | `void` Gets the depth sensor usage settings. |
| `https://developers.google.com/ar/reference/c/group/ar-camera-config#arcameraconfig_getfacingdirection(const https://developers.google.com/ar/reference/c/group/ar-session#arsession *session, const https://developers.google.com/ar/reference/c/group/ar-camera-config#arcameraconfig *camera_config, https://developers.google.com/ar/reference/c/group/ar-camera-config#arcameraconfigfacingdirection *out_facing)` | `void` Obtains the facing direction of the camera selected by this config. |
| `https://developers.google.com/ar/reference/c/group/ar-camera-config#arcameraconfig_getfpsrange(const https://developers.google.com/ar/reference/c/group/ar-session#arsession *session, const https://developers.google.com/ar/reference/c/group/ar-camera-config#arcameraconfig *camera_config, int32_t *out_min_fps, int32_t *out_max_fps)` | `void` Obtains the minimum and maximum camera capture rate in frames per second (fps) for the current camera config. |
| `https://developers.google.com/ar/reference/c/group/ar-camera-config#arcameraconfig_getimagedimensions(const https://developers.google.com/ar/reference/c/group/ar-session#arsession *session, const https://developers.google.com/ar/reference/c/group/ar-camera-config#arcameraconfig *camera_config, int32_t *out_width, int32_t *out_height)` | `void` Obtains the CPU camera image dimensions for the given camera config. |
| `https://developers.google.com/ar/reference/c/group/ar-camera-config#arcameraconfig_getstereocamerausage(const https://developers.google.com/ar/reference/c/group/ar-session#arsession *session, const https://developers.google.com/ar/reference/c/group/ar-camera-config#arcameraconfig *camera_config, https://developers.google.com/ar/reference/c/group/ar-camera-config-filter#arcameraconfigstereocamerausage *out_stereo_camera_usage)` | `void` Gets the stereo multi-camera (<https://source.android.com/devices/camera/multi-camera>) usage settings. |
| `https://developers.google.com/ar/reference/c/group/ar-camera-config#arcameraconfig_gettexturedimensions(const https://developers.google.com/ar/reference/c/group/ar-session#arsession *session, const https://developers.google.com/ar/reference/c/group/ar-camera-config#arcameraconfig *camera_config, int32_t *out_width, int32_t *out_height)` | `void` Obtains the GPU texture dimensions for the given camera config. |

## Enumerations

### ArCameraConfigFacingDirection

```
 ArCameraConfigFacingDirection
```
Describes the direction a camera is facing relative to the device.

Used by `https://developers.google.com/ar/reference/c/group/ar-camera-config#arcameraconfig_getfacingdirection`.

| Properties ||
|---|---|
| `AR_CAMERA_CONFIG_FACING_DIRECTION_BACK` | Camera looks out the back of the device (away from the user). |
| `AR_CAMERA_CONFIG_FACING_DIRECTION_FRONT` | Camera looks out the front of the device (towards the user). To create a session using the front-facing (selfie) camera, use `https://developers.google.com/ar/reference/c/group/ar-session#arsession_setcameraconfig` to set a front-facing (selfie) camera config retrieved from `https://developers.google.com/ar/reference/c/group/ar-session#arsession_getsupportedcameraconfigswithfilter`. When the front camera is selected, ARCore's behavior changes in the following ways: - The display will be mirrored. Specifically, `https://developers.google.com/ar/reference/c/group/ar-camera#arcamera_getprojectionmatrix` will include a horizontal flip in the generated projection matrix and APIs that reason about things in screen space, such as `https://developers.google.com/ar/reference/c/group/ar-frame#arframe_transformcoordinates2d`, will mirror screen coordinates. Open GL apps should consider using `glFrontFace` to render mirrored assets without changing their winding direction. - `https://developers.google.com/ar/reference/c/group/ar-camera#arcamera_gettrackingstate` will always output `https://developers.google.com/ar/reference/c/group/shared-types#ar_tracking_state_paused`. - `https://developers.google.com/ar/reference/c/group/ar-frame#arframe_hittest` will always output an empty list. - `https://developers.google.com/ar/reference/c/group/ar-camera#arcamera_getdisplayorientedpose` will always output an identity pose. - `https://developers.google.com/ar/reference/c/group/ar-session#arsession_acquirenewanchor` will always return `https://developers.google.com/ar/reference/c/group/shared-types#ar_error_not_tracking`. - Planes will never be detected. - `https://developers.google.com/ar/reference/c/group/ar-session#arsession_configure` will fail if the supplied configuration requests Cloud Anchors, Augmented Images, or Environmental HDR Lighting Estimation mode. <br /> |

## Typedefs

### ArCameraConfig

```
struct ArCameraConfig_ ArCameraConfig
```
A camera config struct that contains the config supported by the physical camera obtained from the low level device profiles.

([value type](https://developers.google.com/ar/reference/c/group/concepts#object-ownership)).


- Create with: `https://developers.google.com/ar/reference/c/group/ar-camera-config#arcameraconfig_create`
- Release with: `https://developers.google.com/ar/reference/c/group/ar-camera-config#arcameraconfig_destroy`

<br />

### ArCameraConfigList

```
struct ArCameraConfigList_ ArCameraConfigList
```
A list of camera config ([value type](https://developers.google.com/ar/reference/c/group/concepts#object-ownership)).


- Create with: `https://developers.google.com/ar/reference/c/group/ar-camera-config#arcameraconfiglist_create`
- Release with: `https://developers.google.com/ar/reference/c/group/ar-camera-config#arcameraconfiglist_destroy`

<br />

## Functions

### ArCameraConfigList_create

```
void ArCameraConfigList_create(
  const ArSession *session,
  ArCameraConfigList **out_list
)
```
Creates a camera config list object.


| Details ||
|---|---|
| Parameters | |---|---| | `session` | The ARCore session | | `out_list` | A pointer to an `https://developers.google.com/ar/reference/c/group/ar-camera-config#arcameraconfiglist*` to receive the address of the newly allocated `https://developers.google.com/ar/reference/c/group/ar-camera-config#arcameraconfiglist`. | |

### ArCameraConfigList_destroy

```
void ArCameraConfigList_destroy(
  ArCameraConfigList *list
)
```
Releases the memory used by a camera config list object, along with all the camera config references it holds.

### ArCameraConfigList_getItem

```
void ArCameraConfigList_getItem(
  const ArSession *session,
  const ArCameraConfigList *list,
  int32_t index,
  ArCameraConfig *out_camera_config
)
```
Retrieves the specific camera config based on the position in this list.

### ArCameraConfigList_getSize

```
void ArCameraConfigList_getSize(
  const ArSession *session,
  const ArCameraConfigList *list,
  int32_t *out_size
)
```
Retrieves the number of camera configs in this list.

### ArCameraConfig_create

```
void ArCameraConfig_create(
  const ArSession *session,
  ArCameraConfig **out_camera_config
)
```
Creates a camera config object.


| Details ||
|---|---|
| Parameters | |---|---| | `session` | The ARCore session | | `out_camera_config` | Pointer to an `https://developers.google.com/ar/reference/c/group/ar-camera-config#arcameraconfig*` to receive the address of the newly allocated `https://developers.google.com/ar/reference/c/group/ar-camera-config#arcameraconfig`. | |

### ArCameraConfig_destroy

```
void ArCameraConfig_destroy(
  ArCameraConfig *camera_config
)
```
Releases the memory used by a camera config object.

### ArCameraConfig_getCameraId

```
void ArCameraConfig_getCameraId(
  const ArSession *session,
  const ArCameraConfig *camera_config,
  char **out_camera_id
)
```
Obtains the camera id for the given camera config which is obtained from the list of ARCore compatible camera configs.

The acquired ID must be released after use by the `https://developers.google.com/ar/reference/c/group/utility-functions#arstring_release` function.

### ArCameraConfig_getDepthSensorUsage

```
void ArCameraConfig_getDepthSensorUsage(
  const ArSession *session,
  const ArCameraConfig *camera_config,
  uint32_t *out_depth_sensor_usage
)
```
Gets the depth sensor usage settings.

`out_depth_sensor_usage` will contain one of the values from `https://developers.google.com/ar/reference/c/group/ar-camera-config-filter#arcameraconfigdepthsensorusage` enum.

### ArCameraConfig_getFacingDirection

```
void ArCameraConfig_getFacingDirection(
  const ArSession *session,
  const ArCameraConfig *camera_config,
  ArCameraConfigFacingDirection *out_facing
)
```
Obtains the facing direction of the camera selected by this config.

### ArCameraConfig_getFpsRange

```
void ArCameraConfig_getFpsRange(
  const ArSession *session,
  const ArCameraConfig *camera_config,
  int32_t *out_min_fps,
  int32_t *out_max_fps
)
```
Obtains the minimum and maximum camera capture rate in frames per second (fps) for the current camera config.

Actual capture frame rate will vary within this range, depending on lighting conditions. Frame rates will generally be lower under poor lighting conditions to accommodate longer exposure times.

### ArCameraConfig_getImageDimensions

```
void ArCameraConfig_getImageDimensions(
  const ArSession *session,
  const ArCameraConfig *camera_config,
  int32_t *out_width,
  int32_t *out_height
)
```
Obtains the CPU camera image dimensions for the given camera config.

### ArCameraConfig_getStereoCameraUsage

```
void ArCameraConfig_getStereoCameraUsage(
  const ArSession *session,
  const ArCameraConfig *camera_config,
  ArCameraConfigStereoCameraUsage *out_stereo_camera_usage
)
```
Gets the stereo multi-camera (<https://source.android.com/devices/camera/multi-camera>) usage settings.

`out_stereo_camera_usage` will contain one of the values from `https://developers.google.com/ar/reference/c/group/ar-camera-config-filter#arcameraconfigstereocamerausage` enum.

### ArCameraConfig_getTextureDimensions

```
void ArCameraConfig_getTextureDimensions(
  const ArSession *session,
  const ArCameraConfig *camera_config,
  int32_t *out_width,
  int32_t *out_height
)
```
Obtains the GPU texture dimensions for the given camera config.