ImageProxy
interface ImageProxy : AutoCloseable
androidx.camera.core.ImageProxy |
An image proxy which has a similar interface as android.media.Image
.
Summary
Nested classes | |
---|---|
abstract |
A plane proxy which has an analogous interface as |
Public methods | |
---|---|
abstract Unit |
close() Closes the underlying |
abstract Rect |
Returns the crop rectangle. |
abstract Int |
Returns the image format. |
abstract Int |
Returns the image height. |
abstract Image? |
getImage() Returns the android |
abstract ImageInfo |
Returns the |
abstract Array<ImageProxy.PlaneProxy!> |
Returns the array of planes. |
abstract Int |
getWidth() Returns the image width. |
abstract Unit |
setCropRect(@Nullable rect: Rect?) Sets the crop rectangle. |
Public methods
getImage
@Nullable abstract fun getImage(): Image?
Returns the android Image
.
If the ImageProxy is a wrapper for an android Image
, it will return the Image
. It is possible for an ImageProxy to wrap something that isn't an Image
. If that's the case then it will return null.
The returned image should not be closed by the application. Instead it should be closed by the ImageProxy, which happens, for example, on return from the ImageAnalysis.Analyzer
function. Destroying the ImageAnalysis
will close the underlying android.media.ImageReader
. So an Image
obtained with this method will behave as such.
Return | |
---|---|
Image? |
the android image. |
See Also
getPlanes
@NonNull abstract fun getPlanes(): Array<ImageProxy.PlaneProxy!>
Returns the array of planes.
See Also