public interface CameraFrame
CameraFrame
represents one frame of captured video.Modifier and Type | Field and Description |
---|---|
static long |
UnknownFrameNumber
A frame number that never appears in a real camera frame.
|
Modifier and Type | Method and Description |
---|---|
void |
addRef()
Adds a counted reference to the camera frame to facilitate it's deterministic reclamation
when no longer needed.
|
CameraFrame |
copy()
Returns a copy of this frame, one whose data is guaranteed to be accessible as
long as the instance is extant.
|
void |
copyToBitmap(Bitmap bitmap)
Copies the contents of the
CameraFrame into the indicated bitmap. |
CameraCaptureSequenceId |
getCaptureSequenceId()
The sequence ID for this frame that was returned by the
CameraCaptureSession.startCapture(org.firstinspires.ftc.robotcore.external.hardware.camera.CameraCaptureRequest, org.firstinspires.ftc.robotcore.external.hardware.camera.CameraCaptureSession.CaptureCallback, org.firstinspires.ftc.robotcore.external.function.Continuation<? extends org.firstinspires.ftc.robotcore.external.hardware.camera.CameraCaptureSession.StatusCallback>) family of functions. |
long |
getCaptureTime()
Returns the time on the System.nanoTime() clock at which this frame was captured.
|
long |
getFrameNumber()
Get the frame number associated with this result.
|
long |
getImageBuffer()
Returns access to the data of the image.
|
int |
getImageSize()
Returns the number of bytes in the image
|
CameraCaptureRequest |
getRequest()
Returns the request associated with this result.
|
Size |
getSize()
Returns the dimensions of the image
|
int |
getStride()
Number of bytes per horizontal line (undefined/zero for compressed format)
|
UvcFrameFormat |
getUvcFrameFormat()
Returns the format of this frame using the
UvcFrameFormat enumeration. |
int |
releaseRef() |
static final long UnknownFrameNumber
CameraCaptureRequest getRequest()
long getFrameNumber()
Whenever a request has been processed, regardless of failure or success, it gets a unique frame number assigned to its future result/failure.
For the same type of request (capturing from the camera device or reprocessing), this
value monotonically increments, starting with 0, for every new result or failure and the
scope is the lifetime of the Camera
. Between different types of requests,
the frame number may not monotonically increment. For example, the frame number of a newer
reprocess result may be smaller than the frame number of an older result of capturing new
images from the camera device, but the frame number of a newer reprocess result will never be
smaller than the frame number of an older reprocess result.
Camera.createCaptureRequest(int, org.firstinspires.ftc.robotcore.external.android.util.Size, int)
Size getSize()
int getImageSize()
long getImageBuffer()
getImageSize()
in length.long getCaptureTime()
UvcFrameFormat getUvcFrameFormat()
UvcFrameFormat
enumeration.int getStride()
CameraCaptureSequenceId getCaptureSequenceId()
CameraCaptureSession.startCapture(org.firstinspires.ftc.robotcore.external.hardware.camera.CameraCaptureRequest, org.firstinspires.ftc.robotcore.external.hardware.camera.CameraCaptureSession.CaptureCallback, org.firstinspires.ftc.robotcore.external.function.Continuation<? extends org.firstinspires.ftc.robotcore.external.hardware.camera.CameraCaptureSession.StatusCallback>)
family of functions.
The sequence ID is a unique monotonically-increasing value starting from 0, incremented every time a new group of requests is submitted to the Camera.
CameraCaptureSession.CaptureCallback#onCaptureSequenceCompleted
void copyToBitmap(Bitmap bitmap)
CameraFrame
into the indicated bitmap. The size
of the bitmap must be compatible with this result.CameraCaptureRequest.createEmptyBitmap()
CameraFrame copy()
releaseRef()
'd
when no longer needed in order to help improve memory usage (this is not required).releaseRef()
void addRef()
releaseRef()