Class Overview
Describe a frame to be processed by the vision system.
The supported frame format are (examples are given for an image of size width
x height):
- YV12: Bi-Planar format with one plan containing the Y (luminance)
values of the frame (the plane with thus have width x height byte elements),
followed by one plane with interleaved chrominance values (U and V). This
latest plane will thus have width/2 x height/2 pairs of U,V values yielding
to plane of width*height/2 byte values. The first element of each pair is
the U component.
- NV12: [Android preferred native format] Bi-Planar format
with one plan containing the Y (luminance) values of the frame (the plane
with thus have width x height byte elements), followed by one plane with
interleaved chrominance values (U and V). This latest plane will thus have
width/2 x height/2 pairs of U,V values yielding to plane of width*height/2
byte values. The first element of each pair is the V component.
Summary
Nested Classes |
enum |
VDARFrame.VDARFrameFormat |
Describe the supported frame format |
Public Constructors |
|
VDARFrame(int width, int height, int bufferSizeYUV, VDARFrame.VDARFrameFormat format, boolean needBuffer)
Create a new frame object with the specified format
|
[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()
|
|
Public Constructors
public
VDARFrame
(int width, int height, int bufferSizeYUV, VDARFrame.VDARFrameFormat format, boolean needBuffer)
Create a new frame object with the specified format
Parameters
format
| the format of the frame |
Public Methods
public
ByteBuffer
getFrameBuffer
()
Get and return the buffer to which the frame data should be stored.
Warning: The frame buffer contains only
width*height+width*height/2 bytes. If you try to write more bytes to the
buffer, it is likely that your app will crash. Moreover, before writing
to the buffer, you should rewind the buffer to the index 0 by calling the
position(0) method on the buffer:
myFrame.getFrameBuffer().position(0); //Rewind the buffer before writing to it.
Return the current frame format
public
int
getHeight
()
Return the frame width in height.
Returns
- the frame height in pixels
public
byte[]
getStandardBuffer
()
public
int
getWidth
()
Return the frame width in pixels.
Returns
- the frame width in pixels
Parameters
frameFormat
| the frameFormat to set |
public
void
setStandardBuffer
(byte[] standardBuffer)
public
void
setStandardBufferFromImage
(Image img)