Summary: Nested Classes | Constants | Methods | Inherited Methods | [Expand All]
public class

# Frame

extends Object

java.lang.Object
↳ | com.google.android.gms.vision.Frame

## Class Overview

Image data with associated `metadata`.

A frame is constructed via the `builder` class, specifying the image data, dimensions, and sequencing information (frame ID, timestamp).

## Summary

Nested Classes
class | Frame.Builder | Builder for creating a frame instance.
class | Frame.Metadata | Frame metadata, describing the image dimensions, rotation, and sequencing information.

Constants
int | ROTATION_0 |
int | ROTATION_180 |
int | ROTATION_270 |
int | ROTATION_90 |

Public Methods
Bitmap | getBitmap() Returns the bitmap which was specified in creating this frame, or null if no bitmap was used to create this frame.
ByteBuffer | getGrayscaleImageData() Returns the grayscale version of the frame data, with one byte per pixel.
Frame.Metadata | getMetadata() Returns the metadata associated with the frame.

[Expand] Inherited Methods
From class java.lang.Object
Object | clone()
boolean | equals(Object arg0)
void | finalize()
final Class<?> | getClass()
int | hashCode()
final void | notify()
final void | notifyAll()
String | toString()
final void | wait(long arg0, int arg1)
final void | wait(long arg0)
final void | wait()

## Constants

#### public static final int ROTATION_0

Constant Value: 0 (0x00000000)

#### public static final int ROTATION_180

Constant Value: 2 (0x00000002)

#### public static final int ROTATION_270

Constant Value: 3 (0x00000003)

#### public static final int ROTATION_90

Constant Value: 1 (0x00000001)

## Public Methods

#### public Bitmap getBitmap ()

Returns the bitmap which was specified in creating this frame, or null if no bitmap was used to create this frame. If the bitmap is not available, then `getGrayscaleImageData()` should be called instead.

#### public ByteBuffer getGrayscaleImageData ()

Returns the grayscale version of the frame data, with one byte per pixel. Note that the returned byte buffer will be prefixed by the Y channel (i.e., the grayscale image data), but may optionally include additional image data beyond the Y channel (this can be ignored).

If a bitmap was specified when creating this frame, the bitmap is first converted to a grayscale byte[] (allocation / copy required). It is recommended that you use the bitmap directly through `getBitmap()` if the associated native detection code supports it, since this would move the grayscale conversion into native code where it will be faster.

#### public Frame.Metadata getMetadata ()

Returns the metadata associated with the frame.