MUAN
video.cpp File Reference

This file implements the video.h interface. More...

Functions

void sleep_for_video (int stime)
 Sleep.
void * getFrameFromCameraF (void *p)
 Function executed by the capture thread to get a new frame.
void allocateBuffers ()
 Allocate internal buffers.
bool setupCamera (const char *config_file, int cam_type)
 Read config file and set the camera.
void * get_newframe (unsigned char *buffer)
 Gets a new Frame.
void init_vars ()
int copy_image (Image *i, void *buffer)
int video_w (void)
 Return image horizontal dimension.
int video_h (void)
 Return image vertical dimension.
int video_open (const char *config_fname, int cam_type)
 Open communication with video device.
void video_close (void)
 Close communication with video device.
int video_getframe (Frame *f)
 Gets the frame.
void video_startReceive ()
 Start receiving images from device.
void video_stopReceive ()
 Stop receiving images from device.
void video_stopThread ()
 Stop the thread for receiving images from device.
void video_startThread ()
 Start the thread for receiving images from device.

Variables

static int destDepth_
static int bytesPerDestPixel_
const char * camera_config_ = "none"

Detailed Description

This file implements the video.h interface.


Function Documentation

void allocateBuffers ( )

Allocate internal buffers.

References bytesPerDestPixel_, and destDepth_.

Referenced by video_open().

int copy_image ( Image i,
void *  buffer 
)

References c_make(), Image::h, img_putc(), and Image::w.

Referenced by video_getframe().

void* get_newframe ( unsigned char *  buffer)

Gets a new Frame.

Returns:
the frame captured.

References sleep_for_video().

Referenced by video_getframe().

void* getFrameFromCameraF ( void *  p)

Function executed by the capture thread to get a new frame.

References sleep_for_video().

Referenced by video_startThread().

void init_vars ( )

Referenced by video_open().

bool setupCamera ( const char *  config_file,
int  cam_type 
)

Read config file and set the camera.

Returns:
success or failure.

References destDepth_.

Referenced by video_open().

void sleep_for_video ( int  stime)

Sleep.

Referenced by get_newframe(), and getFrameFromCameraF().

void video_close ( void  )

Close communication with video device.

References video_stopReceive().

Referenced by ImageViewer::changeConnectMode().

int video_getframe ( Frame *  f)

Gets the frame.

Parameters:
fthe frame.
Returns:
TRUE if success, else returns FALSE

References Image::c, copy_image(), get_newframe(), and img_create().

Referenced by ImageViewer::draw(), ImageViewer::initialize(), and ImageViewer::insert_frame().

int video_h ( void  )

Return image vertical dimension.

Referenced by main().

int video_open ( const char *  config_fname,
int  cam_type 
)

Open communication with video device.

Returns:
the Image created.

References allocateBuffers(), init_vars(), setupCamera(), and video_startThread().

Referenced by ImageViewer::changeConnectMode(), and main().

void video_startReceive ( )

Start receiving images from device.

void video_startThread ( )

Start the thread for receiving images from device.

References getFrameFromCameraF().

Referenced by video_open().

void video_stopReceive ( )

Stop receiving images from device.

Referenced by ImageViewer::initialize(), and video_close().

void video_stopThread ( )

Stop the thread for receiving images from device.

int video_w ( void  )

Return image horizontal dimension.

Referenced by main().


Variable Documentation

const char* camera_config_ = "none"

Referenced by allocateBuffers(), and setupCamera().