CameraIntrinsics

data class CameraIntrinsics(val focalLengthMm: Float, val sensorLongMm: Float, val sensorShortMm: Float)(source)

The back camera's focal length and the size of the sensor area the preview shows, both in millimeters.

Constructors

Link copied to clipboard
constructor(focalLengthMm: Float, sensorLongMm: Float, sensorShortMm: Float)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun focalPx(viewWidth: Float, viewHeight: Float): Float

Focal length in view pixels. The preview fills the view and crops the overflow, so the scale is the larger of the two axis ratios; the sensor's long side lies along the view's long side whatever the display rotation.

Link copied to clipboard
fun forStream(streamLong: Int, streamShort: Int, cropLong: Int, cropShort: Int): CameraIntrinsics

The sensor area a preview stream of streamLong by streamShort pixels shows after its cropLong by cropShort crop. The camera fills a stream whose aspect differs from the sensor's by cropping the sensor to that aspect about its center, so a 16:9 stream from a 4:3 sensor loses sensor height before any crop is applied.