com.buglabs.bug.module.camera.pub
Interface ICamera2Device

All Known Implementing Classes:
CameraModlet

public interface ICamera2Device

An interface for a device that can return images.


Field Summary
static java.lang.String DEFAULT_MEDIA_NODE
          The default media node to specify when calling bug_camera_open().
 
Method Summary
 int bug_camera_close()
          Closes the camera - allowing other processes to access it.
 byte[] bug_camera_grab_full()
          Grabs a JPEG-encoded full image.
 boolean bug_camera_grab_preview(int[] pixelBuffer)
          Grabs a raw RGB-encoded preview image.
 int bug_camera_open_default()
          Calls bug_camera_open with reasonable default values.
 int bug_camera_open(java.lang.String media_node, int slot_num, int full_height, int full_width, int preview_height, int preview_width)
          Opens a connection with a camera module and configure it.
 int bug_camera_start()
          Start acquiring frames.
 int bug_camera_stop()
          Stop acquiring frames.
 boolean is_camera_open()
           
 boolean is_camera_started()
           
 

Field Detail

DEFAULT_MEDIA_NODE

static final java.lang.String DEFAULT_MEDIA_NODE
The default media node to specify when calling bug_camera_open().

See Also:
Constant Field Values
Method Detail

is_camera_open

boolean is_camera_open()

is_camera_started

boolean is_camera_started()

bug_camera_open

int bug_camera_open(java.lang.String media_node,
                    int slot_num,
                    int full_height,
                    int full_width,
                    int preview_height,
                    int preview_width)
Opens a connection with a camera module and configure it.

Parameters:
media_node -
slot_num - the slot number of the camera module to use, or -1 to use the default (if there's only 1)
full_height - height in pixels to capture full images at
full_width - width in pixels to capture full images at
preview_height - height in pixels to capture preview images at
preview_width - width in pixels to capture preview images at
Returns:
0 if open was successful

bug_camera_open_default

int bug_camera_open_default()
Calls bug_camera_open with reasonable default values. (DEFAULT_MEDIA_NODE, -1, 2048, 1536, 320, 240)

Returns:
0 if open was successful

bug_camera_close

int bug_camera_close()
Closes the camera - allowing other processes to access it.

Returns:
0 if open was successful

bug_camera_start

int bug_camera_start()
Start acquiring frames. Must be called before the grab methods may be called.

Returns:
0 if start was successful

bug_camera_stop

int bug_camera_stop()
Stop acquiring frames.

Returns:
0 if stop was successful.

bug_camera_grab_preview

boolean bug_camera_grab_preview(int[] pixelBuffer)
Grabs a raw RGB-encoded preview image. bug_camera_open() and bug_camera_start() must already have been called.

Parameters:
pixelBuffer - array of size preview width * preview height from the call to bug_camera_open
Returns:
true if grab succeeded

bug_camera_grab_full

byte[] bug_camera_grab_full()
Grabs a JPEG-encoded full image. bug_camera_open() and bug_camera_start() must already have been called.

Returns: