MutableImageWrapper


public interface MutableImageWrapper extends ImageWrapper

Known direct subclasses
FakeImage

Fake implementation of MutableImageWrapper for testing.


A mutable extension of ImageWrapper that allows modifying properties of the image.

This interface is useful when modifying the metadata of an image, such as its crop rectangle, timestamp, or synchronization fence.

Summary

Public methods

abstract @NonNull Rect

The crop rectangle of the image.

abstract int

The dataspace associated with this image.

abstract SyncFence

The sync fence associated with this image, or null if there is no fence.

abstract long

The timestamp associated with this image, in nanoseconds.

abstract void

The crop rectangle of the image.

abstract void
setDataSpace(int value)

The dataspace associated with this image.

abstract void

The sync fence associated with this image, or null if there is no fence.

abstract void
setTimestamp(long value)

The timestamp associated with this image, in nanoseconds.

Inherited methods

From androidx.camera.common.ImageWrapper
abstract void

Closes the underlying image and releases any associated resources.

abstract int

The format of the image.

default HardwareBuffer

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

abstract int

The height of the image in pixels.

abstract @NonNull List<@NonNull ImagePlane>

The list of pixel planes for this image.

abstract int

The width of the image in pixels.

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

Attempts to unwrap this object into the specified underlying type.

Public methods

getCropRect

abstract @NonNull Rect getCropRect()

The crop rectangle of the image.

See also
setCropRect

getDataSpace

abstract int getDataSpace()

The dataspace associated with this image.

The value set must be one of the constants defined in ImageDataSpace.

getSyncFence

abstract SyncFence getSyncFence()

The sync fence associated with this image, or null if there is no fence.

See also
setFence

getTimestamp

abstract long getTimestamp()

The timestamp associated with this image, in nanoseconds.

See also
setTimestamp

setCropRect

Added in 1.7.0-alpha03
abstract void setCropRect(@NonNull Rect value)

The crop rectangle of the image.

See also
setCropRect

setDataSpace

Added in 1.7.0-alpha03
abstract void setDataSpace(int value)

The dataspace associated with this image.

The value set must be one of the constants defined in ImageDataSpace.

setSyncFence

Added in 1.7.0-alpha03
abstract void setSyncFence(SyncFence value)

The sync fence associated with this image, or null if there is no fence.

See also
setFence

setTimestamp

Added in 1.7.0-alpha03
abstract void setTimestamp(long value)

The timestamp associated with this image, in nanoseconds.

See also
setTimestamp