#include <flexCAM.h>
Public Member Functions | |
FlexCAM () | |
Initializes the private members. | |
bool | set_image_type (unsigned char type, unsigned char size, bool is_video) |
Set the image stream properties. | |
void | set_baud_rate_pc (unsigned long int b) |
Set Flex-PC baud rate. | |
unsigned int | get_error () |
Get the last error code. | |
unsigned int | get_width () |
Get the image width. | |
unsigned int | get_height () |
Get the image height. | |
unsigned int | get_channel () |
Get the number of channels. | |
bool | connect (const char *serial_name) |
Open the serial port. | |
void | close () |
Close the serial port. | |
bool | configure (const char *serial_name) |
Configure the Flex Driver. | |
bool | get_image (unsigned char *&image) |
Configure the Flex Driver. |
bool FlexCAM::set_image_type | ( | unsigned char | type, | |
unsigned char | size, | |||
bool | is_video | |||
) |
Set the image stream properties.
type | The type of image | |
size | The resolution of image | |
is_video | Stream type is video or single snapshot |
true
if no error occurs, false
otherwise void FlexCAM::set_baud_rate_pc | ( | unsigned long int | b | ) | [inline] |
Set Flex-PC baud rate.
b | Baud Rate in bps |
unsigned int FlexCAM::get_error | ( | ) | [inline] |
Get the last error code.
unsigned int FlexCAM::get_width | ( | ) | [inline] |
Get the image width.
unsigned int FlexCAM::get_height | ( | ) | [inline] |
Get the image height.
unsigned int FlexCAM::get_channel | ( | ) | [inline] |
Get the number of channels.
The number of channels for the image can be 1(for gray images) or 3(for color images).
bool FlexCAM::connect | ( | const char * | serial_name | ) |
Open the serial port.
If the serial_name
is NULL
than the default FLEX_DEFAULT_SERIAL_PORT name is used.
serial_name | A valid serial port name |
true
if no error occurs, false
otherwise. bool FlexCAM::configure | ( | const char * | serial_name | ) |
Configure the Flex Driver.
Set the Flex driver according to the configuration selected with the set_image_type method.
true
if no error occurs, false
otherwise. bool FlexCAM::get_image | ( | unsigned char *& | image | ) |
Configure the Flex Driver.
Query, grab and pre-process the next image from the Flex according the Flex driver configuration.
For the jpeg images the data size is unknown so it is performed byte to byte reading, looking for the jpeg starting and ending delimiters.
The pre-processing step converts images for future showing; color images in RGB24, gray images in Gray8.
image | The result pre-processed image data |
true
if no error occurs, false
otherwise.