FlexCAM Class Reference

Flex-CAM Serial Driver. More...

#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.


Detailed Description

Flex-CAM Serial Driver.

Member Function Documentation

bool FlexCAM::set_image_type ( unsigned char  type,
unsigned char  size,
bool  is_video 
)

Set the image stream properties.

Parameters:
type The type of image
size The resolution of image
is_video Stream type is video or single snapshot
Returns:
true if no error occurs, false otherwise

void FlexCAM::set_baud_rate_pc ( unsigned long int  b  )  [inline]

Set Flex-PC baud rate.

Parameters:
b Baud Rate in bps

unsigned int FlexCAM::get_error (  )  [inline]

Get the last error code.

Returns:
Last error code

unsigned int FlexCAM::get_width (  )  [inline]

Get the image width.

Returns:
width

unsigned int FlexCAM::get_height (  )  [inline]

Get the image height.

Returns:
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).

Returns:
number of channel

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.

Precondition:
The set_image_type method must be called first.
Parameters:
serial_name A valid serial port name
Returns:
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.

Precondition:
The connect method must be called first.
Returns:
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.

Precondition:
The configure method must be called first.
Parameters:
image The result pre-processed image data
Returns:
true if no error occurs, false otherwise.


The documentation for this class was generated from the following file:
Generated on Wed Apr 23 00:11:08 2008 for Flex CAM Serial by  doxygen 1.5.4