MeteringPoint

interface MeteringPoint extends HybridObject

Represents a point that can be used for focusing AE/AF/AWB on the Camera via CameraController.

You can create a MeteringPoint via a PreviewView's ref (see PreviewViewMethods.createMeteringPoint(...)), or manually via CameraFactory.createNormalizedMeteringPoint(...).

Examples

Creating a Metering Point to the logical center of the Camera:

const controller = ...
const meteringPoint = HybridCameraFactory.createNormalizedMeteringPoint(0.5, 0.5)
await controller.focusTo(meteringPoint, {})

Creating a Metering Point from a Preview View:

function App() {
  const previewView = useRef<PreviewView>(null)
  const controller = ...

  const onTap = async (viewX, viewY) => {
    const meteringPoint = previewView.current?.createMeteringPoint(viewX, viewY)
    await controller.focusTo(meteringPoint, {})
  }

  return (
    <NativePreviewView
      {...props}
      ref={previewView}
    />
  )
}

Properties

normalizedSize

readonly normalizedSize: number

Represents the size of this MeteringPoint, normalized to the Camera's coordinate system after applying orientation, cropping, and scaling.


normalizedX

readonly normalizedX: number

Represents the X coordinate of this MeteringPoint, normalized to the Camera's coordinate system after applying orientation, cropping, and scaling.


normalizedY

readonly normalizedY: number

Represents the Y coordinate of this MeteringPoint, normalized to the Camera's coordinate system after applying orientation, cropping, and scaling.


relativeSize?

readonly optional relativeSize: number

Represents the size/radius of this MeteringPoint, relative to whatever source was used to create this point - or undefined if no relative size was set.


relativeX

readonly relativeX: number

Represents the X coordinate of this MeteringPoint, relative to whatever source was used to create this point.


relativeY

readonly relativeY: number

Represents the Y coordinate of this MeteringPoint, relative to whatever source was used to create this point.