MeteringPoint
interface MeteringPoint extends HybridObjectRepresents 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: numberRepresents the size of this MeteringPoint,
normalized to the Camera's coordinate system after applying
orientation, cropping, and scaling.
normalizedX
readonly normalizedX: numberRepresents the X coordinate of this MeteringPoint,
normalized to the Camera's coordinate system after applying
orientation, cropping, and scaling.
normalizedY
readonly normalizedY: numberRepresents the Y coordinate of this MeteringPoint,
normalized to the Camera's coordinate system after applying
orientation, cropping, and scaling.
relativeSize?
readonly optional relativeSize: numberRepresents 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: numberRepresents the X coordinate of this MeteringPoint,
relative to whatever source was used to create this point.
- If created from a
PreviewView, this will be the given View X coordinate (e.g. of the user tap). - If created from a normalized Point (
CameraFactory.createNormalizedMeteringPoint()), this will be the given normalized X coordinate (0...1)
relativeY
readonly relativeY: numberRepresents the Y coordinate of this MeteringPoint,
relative to whatever source was used to create this point.
- If created from a
PreviewView, this will be the given View Y coordinate (e.g. of the user tap). - If created from a normalized Point (
CameraFactory.createNormalizedMeteringPoint()), this will be the given normalized Y coordinate (0...1)