androidx.camera.common


CameraX Common is a collection of well documented common types, interfaces, wrappers, math and utilities designed to enable library and application developers to build on a shared set of types regardless of CameraX or Camera2 usage. This library is intentionally designed to be lightweight to ensure that libraries or applications that depend on it have minimal impact to their library and code size.

Library developers that can consume media content from a camera are encouraged to use these interfaces and types as part of their permanent public API surface instead of library-specific subtypes when possible. Developers that expose or develop camera libraries or applications that utilize Camera2 directly are encouraged to depend on and supply instances of these public API types directly.

Interfaces

ImagePlane
ImageWrapper

Wrapper interfaces that mirrors the primary read-only properties of android.media.Image.

MutableImageWrapper

A mutable extension of ImageWrapper that includes write properties.

UnsafeWrapper

An interface for wrapper objects that should not normally be accessed directly.

Classes

AndroidImage

ImageWrapper implementation that wraps an android.media.Image object.

AndroidImage.Plane

A Plane backed by an ImagePlane.

DiscreteRotation

Kotlin value class that represents fixed 0, 90, 180, 270 degree rotations with utility functions for adding and subtracting discrete rotations from each other.

Objects

CameraMath

Utility functions for doing common transformations of camera and sensor coordinate spaces.

DiscreteRotationMath

Utility functions for working with discrete rotations values 0, 90, 180, 270.

Extension functions summary

inline T?

Attempts to unwrap this object into an underlying type.

Extension functions

UnsafeWrapper.unwrapAs

inline fun <T : Any> UnsafeWrapper.unwrapAs(): T?

Attempts to unwrap this object into an underlying type.

See also
unwrapAs