/home/ciesla/projects/svn.openrobotino.org/openrobotino1/lib/rec/robotino/com/c/Camera.h File Reference

In "rec/robotino/com/c/Camera.h" you can find functions for reading Robotino's camera. More...

#include "rec/robotino/com/c/globals.h"
#include "rec/robotino/com/c/Com.h"

Go to the source code of this file.

Defines

#define INVALID_CAMERAID   -1

Typedefs

typedef int CameraId

Functions

DLLEXPORT CameraId Camera_construct ()
DLLEXPORT BOOL Camera_destroy (CameraId id)
DLLEXPORT BOOL Camera_setComId (CameraId id, ComId comId)
DLLEXPORT BOOL Camera_grab (CameraId id)
DLLEXPORT BOOL Camera_imageSize (CameraId id, unsigned int *width, unsigned int *height)
DLLEXPORT BOOL Camera_getImage (CameraId id, unsigned char *imageBuffer, unsigned int imageBufferSize, unsigned int *width, unsigned int *height)
DLLEXPORT BOOL Camera_setStreaming (CameraId id, BOOL streaming)


Detailed Description

In "rec/robotino/com/c/Camera.h" you can find functions for reading Robotino's camera.

Use Camera_construct() to create a new camera object. Associate the camera object with a com object using Camera_setComId(). Use Camera_setStreaming() to enable/disable streaming of images. Use Camera_getImage() to get images from Robotino's camera.


Function Documentation

DLLEXPORT CameraId Camera_construct (  ) 

Construct an Camera object

Returns:
Returns the ID of the newly constructed Camera object.

DLLEXPORT BOOL Camera_destroy ( CameraId  id  ) 

Destroy the Camera object assigned to id

Parameters:
id The id of the Camera object to be destroyed
Returns:
Returns TRUE (1) on success. Returns FALSE (0) if the given CameraId is invalid.

DLLEXPORT BOOL Camera_getImage ( CameraId  id,
unsigned char *  imageBuffer,
unsigned int  imageBufferSize,
unsigned int *  width,
unsigned int *  height 
)

Get Robotino's camera image. Do not forget to call Camera_setStreaming( id, TRUE ) and Camera_grab first. Get the size of the image by Camera_imageSize first. imageBufferSize must be at least 3*width*height. The image copied to image buffer is an interleaved RGB image width 3 channels and 1 byte per channel.

Parameters:
id The camera id.
imageBuffer The image is copied to imageBuffer.
imageBufferSize The size (number of bytes) of imageBuffer.
width Image width.
height Image height.
Returns:
Returns TRUE (1) on success. Returns FALSE (0) if the given CameraId.
See also:
Camera_setStreaming Camera_imageSize

DLLEXPORT BOOL Camera_grab ( CameraId  id  ) 

Grab image.

Parameters:
id The camera id.
Returns:
Returns TRUE (1) if a new image is available since the last call of Camera_grab. Returns FALSE (0) otherwise.

DLLEXPORT BOOL Camera_imageSize ( CameraId  id,
unsigned int *  width,
unsigned int *  height 
)

Size of image aquired by grab.

Parameters:
width Image width.
height Image height.
Returns:
Returns TRUE (1) on success. Returns FALSE (0) if the given CameraId is invalid or if no image has been grabed up to this point in time.

DLLEXPORT BOOL Camera_setComId ( CameraId  id,
ComId  comId 
)

Associated an Camera object with a communication interface, i.e. binding the Camera to a specific Robotino

Returns:
Returns TRUE (1) on success. Returns FALSE (0) if the given CameraId or ComId is invalid.

DLLEXPORT BOOL Camera_setStreaming ( CameraId  id,
BOOL  streaming 
)

Start/Stop streaming of camera images

Parameters:
id The camera id.
streaming If TRUE (1) streaming is started. Otherwise streaming is stopped.
Returns:
Returns TRUE (1) on success. Returns FALSE (0) if the given CameraId.


Generated on Fri Aug 17 15:09:42 2012 for rec_robotino_com_c by  doxygen 1.5.5