Package lejos.hardware.video
Interface Video
-
public interface Video
-
-
Field Summary
Fields Modifier and Type Field Description static intFIELD_ANYstatic intFIELD_INTERLACEDstatic intFIELD_NONEstatic intPIX_FMT_JPEGstatic intPIX_FMT_MJPEGstatic intPIX_FMT_YUYV
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclose()Close the webcam, the device will not be available after this callbyte[]createFrame()Create a byte array suitable for holding a single video frameintgetHeight()return the frame heightintgetWidth()Return the frame widthintgrabFrame(byte[] frame)Grab a single frame from the device and store the image into the supplied arrayvoidopen(int w, int h)Open the device and make it available for use, specify the desired frame size.voidopen(int w, int h, int format, int field, int fps)Open the device and make it available for use, specify the desired frame size.
-
-
-
Field Detail
-
PIX_FMT_MJPEG
static final int PIX_FMT_MJPEG
-
PIX_FMT_JPEG
static final int PIX_FMT_JPEG
-
PIX_FMT_YUYV
static final int PIX_FMT_YUYV
-
FIELD_ANY
static final int FIELD_ANY
- See Also:
- Constant Field Values
-
FIELD_NONE
static final int FIELD_NONE
- See Also:
- Constant Field Values
-
FIELD_INTERLACED
static final int FIELD_INTERLACED
- See Also:
- Constant Field Values
-
-
Method Detail
-
open
void open(int w, int h, int format, int field, int fps) throws java.io.IOExceptionOpen the device and make it available for use, specify the desired frame size. Note that the actual frame size may be adjusted to conform to the capabilities of the device.- Parameters:
w- the desired frame widthh- the desired frame heightformat- desired pixel formatfield- desired field layoutfps- the desired frame rate- Throws:
java.io.IOException
-
open
void open(int w, int h) throws java.io.IOExceptionOpen the device and make it available for use, specify the desired frame size. Note that the actual frame size may be adjusted to conform to the capabilities of the device.- Parameters:
w- the desired frame widthh- the desired frame height- Throws:
java.io.IOException
-
grabFrame
int grabFrame(byte[] frame) throws java.io.IOExceptionGrab a single frame from the device and store the image into the supplied array- Parameters:
frame- array to store the frame- Returns:
- the size of the frame grabbed (in bytes)
- Throws:
java.io.IOException
-
close
void close() throws java.io.IOExceptionClose the webcam, the device will not be available after this call- Throws:
java.io.IOException
-
createFrame
byte[] createFrame()
Create a byte array suitable for holding a single video frame- Returns:
- the frame array
-
getWidth
int getWidth()
Return the frame width- Returns:
- width in pixels
-
getHeight
int getHeight()
return the frame height- Returns:
- height in pixels
-
-