AndroidImage


class AndroidImage : MutableImageWrapper


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

Summary

Nested types

A Plane backed by an ImagePlane.

Public constructors

Public functions

open Unit
open String
open T?
<T : Any> unwrapAs(type: Class<T>)

Attempt to unwrap this object into an underlying type.

Public properties

open Rect
open Int
open Int
open HardwareBuffer?

Returns a handle to the underlying image's hardware buffer, or null if this image does not support hardware buffer.

open Int
open List<ImagePlane>
open SyncFence?
open Long
open Int

Public constructors

AndroidImage

Added in 1.7.0-alpha02
AndroidImage(image: Image)

Public functions

close

Added in 1.7.0-alpha02
open fun close(): Unit

toString

open fun toString(): String

unwrapAs

open fun <T : Any> unwrapAs(type: Class<T>): T?

Attempt to unwrap this object into an underlying type.

This operation is not safe and should be used with caution as it makes no guarantees about the state of the underlying objects. In particular, implementations should assume that fakes, test wrappers will always return null. Finally this method should return null when unwrapping into the provided type is not supported.

Returns
T?

unwrapped object matching T or null

Public properties

cropRect

open var cropRectRect
See also
setCropRect

dataSpace

open var dataSpaceInt
See also
setDataSpace

format

open val formatInt
See also
getFormat

hardwareBuffer

open val hardwareBufferHardwareBuffer?

Returns a handle to the underlying image's hardware buffer, or null if this image does not support hardware buffer.

The android.hardware.HardwareBuffer follows the lifecycle of its associated image. It is not required to be closed explicitly; however, the image needs to be closed after finishing processing the hardware buffer. In other words, if the hardware buffer is being used, the image cannot be closed.

height

open val heightInt
See also
getHeight

imagePlanes

open val imagePlanesList<ImagePlane>
See also
getPlanes

syncFence

open var syncFenceSyncFence?
See also
setFence

timestamp

open var timestampLong
See also
setTimestamp

width

open val widthInt
See also
getWidth