MeteringPointFactory

abstract class MeteringPointFactory
kotlin.Any
   ↳ androidx.camera.core.MeteringPointFactory

A factory to create a MeteringPoint.

Users can call createPoint(float, float) to create a MeteringPoint with x, y, default size. There are also another variant, createPoint(float, float, float) for apps that want to also specify size.

Summary

Public methods

MeteringPoint

Creates a MeteringPoint by x, y.

MeteringPoint
createPoint(x: Float, y: Float, size: Float)

Creates a MeteringPoint by x, y, size.

open static Float

Returns default point size.

Public methods

createPoint

@NonNull fun createPoint(x: Float, y: Float): MeteringPoint

Creates a MeteringPoint by x, y.

The (x, y) is a position from the area defined by the specific MeteringPointFactory implementation, such as DisplayOrientedMeteringPointFactory or SurfaceOrientedMeteringPointFactory.

Parameters
x Float: x to be converted.
y Float: y to be converted.
Return
MeteringPoint: A MeteringPoint that is converted into normalized surface (x, y).

createPoint

@NonNull fun createPoint(x: Float, y: Float, size: Float): MeteringPoint

Creates a MeteringPoint by x, y, size.

The (x, y) is a position from the area defined by the specific MeteringPointFactory implementation, such as DisplayOrientedMeteringPointFactory or SurfaceOrientedMeteringPointFactory.

Parameters
x Float: x to be converted.
y Float: y to be converted.
size Float: size of the MeteringPoint width and height(ranging from 0 to 1). It is the (normalized) percentage of the sensor width/height (or crop region width/height if crop region is set).
Return
MeteringPoint: A MeteringPoint that is converted into normalized surface (x, y).

getDefaultPointSize

open static fun getDefaultPointSize(): Float

Returns default point size. It is the default size of the MeteringPoint width and height (ranging from 0 to 1) which is a (noramlized) percentage of the sensor width/height (or crop region width/height if crop region is set).