The Android Developer Challenge is back! Submit your idea before December 2.

MeteringPointFactory

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

A Factory to create a MeteringPoint.

MeteringPointFactory implementations must extends this class and implement translatePoint(float x, float y). Users can call createPoint(float x, float y) to create a MeteringPoint with default areaSize and weight. There is a variation of createPoint that accepts areaSize and weight as well.

Summary

Constants

static Float

static Float

Public constructors

A Factory to create a MeteringPoint.

Public methods

MeteringPoint

Creates a MeteringPoint by x, y.

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

Creates a MeteringPoint by x , y , areaSize and weight.

Protected methods

abstract PointF

Translates a logical x/y into the normalized crop region x/y.

Properties

Rational?

Constants

DEFAULT_AREASIZE

static val DEFAULT_AREASIZE: Float
Value: 0.15f

DEFAULT_WEIGHT

static val DEFAULT_WEIGHT: Float
Value: 1.0f

Public constructors

<init>

MeteringPointFactory()

A Factory to create a MeteringPoint.

MeteringPointFactory implementations must extends this class and implement translatePoint(float x, float y). Users can call createPoint(float x, float y) to create a MeteringPoint with default areaSize and weight. There is a variation of createPoint that accepts areaSize and weight as well.

Public methods

createPoint

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

Creates a MeteringPoint by x, y.

The x/y is the position from the area defined by the width, height and the orientation in specific MeteringPointFactory implementation.

createPoint

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

Creates a MeteringPoint by x , y , areaSize and weight.

The x/y is the position from the area defined by the width, height and the orientation in specific MeteringPointFactory implementation.

Parameters
x Float: the logical x to be translated
y Float: the logical y to be translated
size Float: size of the point. The value is ranging from 0 to 1 meaning the percentage of crop region width/height.
weight Float: weight of metering region ranging from 0 to 1.
Return
MeteringPoint: A MeteringPoint that is translated into normalized crop region x/y.

Protected methods

translatePoint

@NonNull protected abstract fun translatePoint(x: Float, y: Float): PointF

Translates a logical x/y into the normalized crop region x/y.

The logical x/y is with respect to related to the implementations. Implementations specify the logical width/height and define the orientation of the area. Some are sensor-oriented and some are display-oriented. The logical x/y is the position from the area defined by the width , height and the orientation. Implementation must implement this method for coordinates translation.

Parameters
x Float: the logical x to be translated.
y Float: the logical y to be translated.
Return
PointF: a PointF consisting of translated normalized crop region x/y,

Properties

mFOVAspectRatio

@Nullable protected var mFOVAspectRatio: Rational?