ImageProxy
public
interface
ImageProxy
implements
AutoCloseable
androidx.camera.core.ImageProxy |
An image proxy which has a similar interface as Image
.
Summary
Nested classes | |
---|---|
interface |
ImageProxy.PlaneProxy
A plane proxy which has an analogous interface as |
Public methods | |
---|---|
abstract
void
|
close()
Closes the underlying |
abstract
Rect
|
getCropRect()
Returns the crop rectangle. |
abstract
int
|
getFormat()
Returns the image format. |
abstract
int
|
getHeight()
Returns the image height. |
abstract
Image
|
getImage()
Returns the android |
abstract
ImageInfo
|
getImageInfo()
Returns the |
abstract
PlaneProxy[]
|
getPlanes()
Returns the array of planes. |
abstract
int
|
getWidth()
Returns the image width. |
abstract
void
|
setCropRect(Rect rect)
Sets the crop rectangle. |
Inherited methods | |
---|---|
Public methods
getFormat
public abstract int getFormat ()
Returns the image format.
Returns | |
---|---|
int |
See also:
getHeight
public abstract int getHeight ()
Returns the image height.
Returns | |
---|---|
int |
See also:
getImage
public abstract Image getImage ()
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
ImageReader
. So an Image
obtained with this method will behave
as such.
Returns | |
---|---|
Image |
the android image. |
See also:
getPlanes
public abstract PlaneProxy[] getPlanes ()
Returns the array of planes.
Returns | |
---|---|
PlaneProxy[] |
See also:
getWidth
public abstract int getWidth ()
Returns the image width.
Returns | |
---|---|
int |
See also:
setCropRect
public abstract void setCropRect (Rect rect)
Sets the crop rectangle.
Parameters | |
---|---|
rect |
Rect |
See also:
Content and code samples on this page are subject to the licenses described in the Content License. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2021-02-24 UTC.