# MeteringPoint

Artifact: [androidx.camera:camera-core](https://developer.android.com/jetpack/androidx/releases/camera) [View Source](https://cs.android.com/search?q=file:androidx/camera/core/MeteringPoint.java+class:androidx.camera.core.MeteringPoint) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/camera#1.0.0)

*** ** * ** ***


```
public class MeteringPoint
```

<br />

*** ** * ** ***

A `https://developer.android.com/reference/androidx/camera/core/MeteringPoint` is used to specify a region which can then be converted to sensor coordinate system for focus and metering purpose.

Conceptually, a `https://developer.android.com/reference/androidx/camera/core/MeteringPoint` is a opaque handle to a metering point created by a `https://developer.android.com/reference/androidx/camera/core/MeteringPointFactory`, for use when building a `https://developer.android.com/reference/androidx/camera/core/FocusMeteringAction`. The coordinates of the point are specified by the application when creating points from the factory, and then the coordinates are converted into an internal representation stored by this class. Because of the nature of internal representation, the X and Y of the `https://developer.android.com/reference/androidx/camera/core/MeteringPoint` is not publicly visible. These are for internal use only.

When a `https://developer.android.com/reference/androidx/camera/core/FocusMeteringAction` is submitted via `https://developer.android.com/reference/androidx/camera/core/CameraControl#startFocusAndMetering(androidx.camera.core.FocusMeteringAction)`, the `https://developer.android.com/reference/androidx/camera/core/MeteringPoint` is converted to a point in the sensor coordinate system where it defines the center of a metering rectangle. If zoom is applied via `https://developer.android.com/reference/androidx/camera/core/CameraControl` , it will set a crop region calculated by the zoom and the final coordinates will be mapped into the crop region. If not set, it is mapped to the sensor active array.

Besides defining the center point of the metering rectangle, there is also the size of the `https://developer.android.com/reference/androidx/camera/core/MeteringPoint`. The size of the `https://developer.android.com/reference/androidx/camera/core/MeteringPoint` ranges from 0 to 1.0. The size is the percentage of sensor width and height (or crop region width/height if crop region is set). See formula below:

```
Metering rectangle width = size * sensorSizeOrCropRegion.width
Metering rectangle height = size * sensorSizeOrCropRegion.height
```
The metering rectangle defined by the `https://developer.android.com/reference/androidx/camera/core/MeteringPoint` has the same shape as the sensor array.

## Summary

| ### Public methods |
|---|---|
| `float` | `https://developer.android.com/reference/androidx/camera/core/MeteringPoint#getSize()()` Size of the MeteringPoint width and height (ranging from 0 to 1). |

## Public methods

### getSize

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/camera#1.0.0)

```
public float getSize()
```

Size of the MeteringPoint width and height (ranging from 0 to 1). It is the percentage of the sensor width/height (or crop region width/height if crop region is set).

Crop region is set when zoom is set in `https://developer.android.com/reference/androidx/camera/core/CameraControl` and it is the region inside the sensor active array and it defines the output region of the sensor. See formula below:

```
Metering rectangle width = size * sensorSizeOrCropRegion.width
Metering rectangle height = size * sensorSizeOrCropRegion.height
```