ImageWrapper


public interface ImageWrapper extends UnsafeWrapper, AutoCloseable

Known direct subclasses
MutableImageWrapper

A mutable extension of ImageWrapper that includes write properties.

Known indirect subclasses
AndroidImage

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

FakeImage

Fake implementation of MutableImageWrapper for testing.


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

Summary

Public methods

abstract @NonNull Rect
default int
abstract int
default HardwareBuffer

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

abstract int
abstract @NonNull List<@NonNull ImagePlane>
default SyncFence
abstract long
abstract int

Inherited methods

From java.lang.AutoCloseable
abstract void
From androidx.camera.common.UnsafeWrapper
abstract T
<T extends Object> unwrapAs(@NonNull Class<@NonNull T> type)

Attempt to unwrap this object into an underlying type.

Public methods

getCropRect

Added in 1.7.0-alpha02
abstract @NonNull Rect getCropRect()
See also
getCropRect

getDataSpace

Added in 1.7.0-alpha02
default int getDataSpace()
See also
getDataSpace

getFormat

Added in 1.7.0-alpha02
abstract int getFormat()
See also
getFormat

getHardwareBuffer

Added in 1.7.0-alpha02
default HardwareBuffer getHardwareBuffer()

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.

getHeight

Added in 1.7.0-alpha02
abstract int getHeight()
See also
getHeight

getImagePlanes

Added in 1.7.0-alpha02
abstract @NonNull List<@NonNull ImagePlanegetImagePlanes()
See also
getPlanes

getSyncFence

Added in 1.7.0-alpha02
default SyncFence getSyncFence()
See also
getFence

getTimestamp

Added in 1.7.0-alpha02
abstract long getTimestamp()
See also
getTimestamp

getWidth

Added in 1.7.0-alpha02
abstract int getWidth()
See also
getWidth