Represents a camera.
More...
#include <Camera.h>
|
| Camera () |
|
| Camera (const ComId &id) |
|
virtual | ~Camera () |
|
void | setComId (const ComId &id) |
|
void | setCameraNumber (int number) |
|
int | cameraNumber () const |
|
void | setJPGDecodingEnabled (bool enable) |
|
bool | isJPGDecodingEnabled () const |
|
void | processEvents () |
|
void | setReadWrite () |
|
void | setWriteOnly () |
|
void | setJPGImage (const unsigned char *data, unsigned int dataSize) |
|
void | setFormat (unsigned int width, unsigned int height, const char *format) |
|
void | setBrightness (int value) |
|
void | setContrast (int value) |
|
void | setSaturation (int value) |
|
void | setAutoWhiteBalanceEnabled (bool enable) |
|
void | setGain (int value) |
|
void | setWhiteBalanceTemperature (int value) |
|
void | setBacklightCompensation (int value) |
|
void | setAutoExposureEnabled (bool enable) |
|
void | setExposure (int value) |
|
void | setAutoFocusEnabled (bool enable) |
|
void | setFocus (int value) |
|
void | setSharpness (int value) |
|
CameraCapabilities | capabilities () const |
|
int | calibration (double **buffer, unsigned int bufferSize) |
|
bool | isNewImageAvailable (unsigned int *dataSize) const |
|
bool | getImage (unsigned char **data, unsigned int dataSize, unsigned int *width, unsigned int *height, unsigned int *step) |
|
void | setBGREnabled (bool enable) |
|
bool | isBGRenabled () const |
|
bool | isLocalConnection () const |
|
virtual void | imageReceivedEvent (const unsigned char *data, unsigned int dataSize, unsigned int width, unsigned int height, unsigned int step) |
|
virtual void | capabilitiesChangedEvent (const rec::robotino::api2::CameraCapabilities &capablities) |
|
virtual void | settingsChangedEvent (unsigned int width, unsigned int height, const char *format) |
|
virtual void | calibrationChanged (const double *data, unsigned int dataSize) |
|
| ComObject () |
|
virtual | ~ComObject () |
|
ComId | comId () const |
|
rec::robotino::api2::Camera::Camera |
( |
| ) |
|
virtual rec::robotino::api2::Camera::~Camera |
( |
| ) |
|
|
virtual |
int rec::robotino::api2::Camera::calibration |
( |
double ** |
buffer, |
|
|
unsigned int |
bufferSize |
|
) |
| |
Get the current calibration
- Parameters
-
buffer | A array of doubles provided by you to be filled with the calibration |
bufferSize | The size of the buffer provided |
- Returns
- Returns the number of values copied to buffer.
virtual void rec::robotino::api2::Camera::calibrationChanged |
( |
const double * |
data, |
|
|
unsigned int |
dataSize |
|
) |
| |
|
virtual |
int rec::robotino::api2::Camera::cameraNumber |
( |
| ) |
const |
Get the current camera number.
- Returns
- Returns the current camera number or -1 if no camera is selected.
- Exceptions
-
- See also
- setCameraNumber
- Returns
- The camera's capapibilities.
bool rec::robotino::api2::Camera::getImage |
( |
unsigned char ** |
data, |
|
|
unsigned int |
dataSize, |
|
|
unsigned int * |
width, |
|
|
unsigned int * |
height, |
|
|
unsigned int * |
step |
|
) |
| |
Get the latest image.
- Parameters
-
data | Buffer where the RGB interleaved image is copied to. |
dataSize | Maximum dataSize bytes are copied to the buffer data is pointing to. |
width | The number of pixels per line. If width=height=step=0 this is a JPG encoded image. |
height | The number of lines |
step | The number of bytes per line. |
- Returns
- Returns true if the image fits into the provided buffer, i.e. dataSize >= step*height. Returns false otherwise.
- Exceptions
-
- See also
- isNewImageAvailable
virtual void rec::robotino::api2::Camera::imageReceivedEvent |
( |
const unsigned char * |
data, |
|
|
unsigned int |
dataSize, |
|
|
unsigned int |
width, |
|
|
unsigned int |
height, |
|
|
unsigned int |
step |
|
) |
| |
|
virtual |
Called when an image is received.
- Parameters
-
data | Contains the image data as RGB interleaved image. You must not delete this buffer. Instead you should make a copy of this buffer within this function call. |
dataSize | Is the size of the data buffer containing the RGB image. |
width | The number of pixels per line. If width=height=step=0 this is a JPG encoded image. |
height | The number of lines |
step | The number of bytes per line. |
- Exceptions
-
- See also
- Com::processEvents
bool rec::robotino::api2::Camera::isBGRenabled |
( |
| ) |
const |
Get the current channel order.
- Returns
- If true the channel order is BGR. Otherwise the channel order is RGB (the default).
bool rec::robotino::api2::Camera::isJPGDecodingEnabled |
( |
| ) |
const |
Shows the current settings for decoding JPG images.
- Returns
- Returns the current setting. True - decoding enabled, false otherwise.
- Exceptions
-
bool rec::robotino::api2::Camera::isLocalConnection |
( |
| ) |
const |
- Returns
- Returns true if the connection is a local connection. Otherwise returns false.
bool rec::robotino::api2::Camera::isNewImageAvailable |
( |
unsigned int * |
dataSize | ) |
const |
Check for new images.
- Parameters
-
dataSize | Stores the size in bytes of the available image. When you get the image with getImage your buffer must be at least of size dataSize. |
- Exceptions
-
- See also
- getImage
static unsigned int rec::robotino::api2::Camera::numCameras |
( |
| ) |
|
|
static |
- Returns
- Returns the number of supported cameras.
void rec::robotino::api2::Camera::processEvents |
( |
| ) |
|
Call this function from your main thread to get the virtual Camera functions called. The virtual functions are called directly by a call of this function
- Exceptions
-
- See also
- Com::processEvents
void rec::robotino::api2::Camera::setAutoExposureEnabled |
( |
bool |
enable | ) |
|
Enable auto exposure.
- Parameters
-
- Exceptions
-
- See also
- capabilites
void rec::robotino::api2::Camera::setAutoFocusEnabled |
( |
bool |
enable | ) |
|
Enable auto focus.
- Parameters
-
- Exceptions
-
- See also
- capabilites
void rec::robotino::api2::Camera::setAutoWhiteBalanceEnabled |
( |
bool |
enable | ) |
|
Enable auto white balance.
- Parameters
-
- Exceptions
-
- See also
- capabilites
void rec::robotino::api2::Camera::setBacklightCompensation |
( |
int |
value | ) |
|
Set the backlight compensation.
- Parameters
-
- Exceptions
-
- See also
- capabilites
void rec::robotino::api2::Camera::setBGREnabled |
( |
bool |
enable | ) |
|
Swap channels in the received image
By default the channel order is RGB.
- Parameters
-
enable | If true the channel order is set to BGR. |
void rec::robotino::api2::Camera::setBrightness |
( |
int |
value | ) |
|
Set the brightness.
- Parameters
-
- Exceptions
-
- See also
- capabilites
void rec::robotino::api2::Camera::setCameraNumber |
( |
int |
number | ) |
|
Sets the number of this camera device.
Set the number of this camera to number. The default camera number is 0. Setting the camera number only makes sense when your Robotino is equipped with more than one camera.
- Parameters
-
number | The camera number. Range [0; numCameras()-1]. When setting number < 0 no camera is selected. |
- Exceptions
-
- See also
- numCameras
void rec::robotino::api2::Camera::setComId |
( |
const ComId & |
id | ) |
|
Sets the associated communication object.
- Parameters
-
id | The id of the associated communication object. |
- Exceptions
-
void rec::robotino::api2::Camera::setContrast |
( |
int |
value | ) |
|
Set the contrast.
- Parameters
-
- Exceptions
-
- See also
- capabilites
void rec::robotino::api2::Camera::setExposure |
( |
int |
value | ) |
|
Set the exposure.
- Parameters
-
- Exceptions
-
- See also
- capabilites
void rec::robotino::api2::Camera::setFocus |
( |
int |
value | ) |
|
Set the focus.
- Parameters
-
- Exceptions
-
- See also
- capabilites
void rec::robotino::api2::Camera::setFormat |
( |
unsigned int |
width, |
|
|
unsigned int |
height, |
|
|
const char * |
format |
|
) |
| |
Sets this camera to the given resolution (if possible)
- Parameters
-
width | Requested image width |
height | Requested image height |
format | "mjpg" to request JPEG compress images. "raw" to request raw RGB images. |
- Exceptions
-
- See also
- capabilites
void rec::robotino::api2::Camera::setGain |
( |
int |
value | ) |
|
Set the gain.
- Parameters
-
- Exceptions
-
- See also
- capabilites
void rec::robotino::api2::Camera::setJPGDecodingEnabled |
( |
bool |
enable | ) |
|
Enable/Disable decoding of JPG images. The decoding is enabled by default.
On iOS libjpeg is not linked into the API2 libraries. Decoding a jpeg image by this camera class will crash your app. Disable decoding and look for imageReceivedEvents with dataSize>0 and width==0. This is a jpeg image which must be decoded by yourself. If you have a Qt app you can use QImage::fromData(data,dataSize,"jpg") for decoding.
If true, decoding is enabled. If false, decoding is disabled.
- Exceptions
-
void rec::robotino::api2::Camera::setJPGImage |
( |
const unsigned char * |
data, |
|
|
unsigned int |
dataSize |
|
) |
| |
Publish a jpg image to the camera topic.
- Parameters
-
data | The jpg image data. |
dataSize | Number of bytes in the data array. |
void rec::robotino::api2::Camera::setReadWrite |
( |
| ) |
|
Enable this camera to receive images and to write inmages.
void rec::robotino::api2::Camera::setSaturation |
( |
int |
value | ) |
|
Set the saturation.
- Parameters
-
- Exceptions
-
- See also
- capabilites
void rec::robotino::api2::Camera::setSharpness |
( |
int |
value | ) |
|
Set the sharpness.
- Parameters
-
- Exceptions
-
- See also
- capabilites
virtual void rec::robotino::api2::Camera::settingsChangedEvent |
( |
unsigned int |
width, |
|
|
unsigned int |
height, |
|
|
const char * |
format |
|
) |
| |
|
virtual |
void rec::robotino::api2::Camera::setWhiteBalanceTemperature |
( |
int |
value | ) |
|
Set the white balance temperature.
- Parameters
-
- Exceptions
-
- See also
- capabilites
void rec::robotino::api2::Camera::setWriteOnly |
( |
| ) |
|
Enable this camera to write inmages but disable the receiving of images. This disables calls to imageReceivedEvent.
The documentation for this class was generated from the following file:
- C:/srcs/git/openrobotino/api2/lib/rec/robotino/api2/Camera.h