In "rec/robotino/api2/c/Camera.h" you can find functions for reading Robotino's camera.
More...
#include "rec/robotino/api2/c/globals.h"
#include "rec/robotino/api2/c/Com.h"
Go to the source code of this file.
|
DLLEXPORT CameraId | Camera_construct () |
|
DLLEXPORT BOOL | Camera_destroy (CameraId id) |
|
DLLEXPORT BOOL | Camera_setComId (CameraId id, ComId comId) |
|
DLLEXPORT BOOL | Camera_setCameraNumber (CameraId id, unsigned int n) |
|
DLLEXPORT unsigned int | numCameras () |
|
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_setFormat (CameraId id, unsigned int width, unsigned int height) |
|
DLLEXPORT BOOL | Camera_setStreaming (CameraId id, BOOL streaming) |
|
In "rec/robotino/api2/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.
#define INVALID_CAMERAID -1 |
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
-
- 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
-
id | The camera id. |
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_setCameraNumber |
( |
CameraId |
id, |
|
|
unsigned int |
n |
|
) |
| |
Sets the number of this camera device.
- Parameters
-
id | The id of the camera object to be set |
n | The camera number. Range [0 - numCameras()] |
- Exceptions
-
Returns | TRUE (1) on success otherwise FALSE (0) |
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_setFormat |
( |
CameraId |
id, |
|
|
unsigned int |
width, |
|
|
unsigned int |
height |
|
) |
| |
Set the image format
- Parameters
-
id | The camera id. |
width | Image width. |
height | Image height. |
- Returns
- Returns TRUE (1) on success. Returns FALSE (0) if the given CameraId is invalid.
DLLEXPORT BOOL Camera_setStreaming |
( |
CameraId |
id, |
|
|
BOOL |
streaming |
|
) |
| |
Only for compatibility reasons. Function does nothing and always returns TRUE.
- Parameters
-
id | The camera id. |
streaming | |
- Returns
- Returns TRUE.
DLLEXPORT unsigned int numCameras |
( |
| ) |
|
- Returns
- Returns the number of analog inputs.