Android Dev Summit, October 23-24: two days of technical content, directly from the Android team. Sign-up for livestream updates.

TextureViewMeteringPointFactory

public class TextureViewMeteringPointFactory
extends MeteringPointFactory

java.lang.Object
   ↳ androidx.camera.core.MeteringPointFactory
     ↳ androidx.camera.view.TextureViewMeteringPointFactory


A MeteringPointFactory for creating a MeteringPoint by TextureView and (x,y).

SurfaceTexture in TextureView could be cropped, scaled or rotated by TextureView.getTransform(Matrix). This factory translates the (x, y) into the sensor crop region normalized (x,y) by this transform. SurfaceTexture.getTransformMatrix(float[]) is also used during the translation. No lens facing information is required because SurfaceTexture.getTransformMatrix(float[]) contains the necessary transformation corresponding to the lens face of current camera ouput.

Summary

Inherited constants

Inherited fields

Public constructors

TextureViewMeteringPointFactory(TextureView textureView)

Protected methods

PointF translatePoint(float x, float y)

Translates a (x,y) from TextureView.

Inherited methods

Public constructors

TextureViewMeteringPointFactory

public TextureViewMeteringPointFactory (TextureView textureView)

Parameters
textureView TextureView

Protected methods

translatePoint

protected PointF translatePoint (float x, 
                float y)

Translates a (x,y) from TextureView.

Parameters
x float: the logical x to be translated.

y float: the logical y to be translated.

Returns
PointF a PointF consisting of translated normalized crop region x/y,