MUAN
ImageViewer Class Reference

#include <imgviewer.h>

List of all members.

Public Member Functions

 ImageViewer (int x, int y, int w, int h)
 ImageViewer Creates a new ImageViewer from an OpenGL Window.
bool initialize (int w, int h)
 Initializes ImageViewer depending on imgvmode (_MUAN_PLAYER / _MUAN_FULL) _MUAN_PLAYER: Alloc image _MUAN_FULL : Alloc image and start camera connection.
void changeConnectMode (int mode)
 Sets the camera connection mode.
void play ()
 Plays a video.
void stop ()
 Stops the video.
void flick (void)
 Does the flip operation if the user turns it on, that is, alternates the last captured image and the "live" image.
void insert_frame (int delay, int frame_duration)
 Inserts a new frame.
void copy_frame (int begin=-1, int end=-1)
void paste_frame (bool invert=false)
void goToFrame (int frameNumber)
 Goes to specified frame.
void playInRange (int begin, int end)
 Plays specified range from a video.
void setModeViewer (int _camera_on, int _mem_alert, setLabelModeViewerFunc setLabel=NULL)
 Sets the visualization mode (CAMERA or MEMORY) Starts or stops the connection with the camera depending on the mode.
int get_video_on (void)

Public Attributes

PlayMode imgvmode
int filter_on
int transp_on
int flick_on
int is_playing
int is_looping
int is_saving
double flick_delay
double transp_fac
ImgListimgl
ImgListclipboard
Frame * frm

Private Member Functions

void init_GL ()
 Sets up Viewport and Projection of the GLWindow.
void draw ()
 Draws an image from the ImageList (captured image) or from the camera.
void resize (int X, int Y, int W, int H)
 Resizes the GLwindow.
void calcule_c_scale ()
 Calculates c_scale of the GLWindow.

Private Attributes

int video_on
double c_scale

Constructor & Destructor Documentation

ImageViewer::ImageViewer ( int  x,
int  y,
int  w,
int  h 
)

ImageViewer Creates a new ImageViewer from an OpenGL Window.

Parameters:
xthe x coordinate of window position.
ythe y coordinate of window position.
wthe image width.
hthe image height.
Returns:
The ImageViewer created.

References c_scale, clipboard, filter_on, flick_delay, flick_on, frm, imgl, is_looping, is_playing, is_saving, transp_fac, transp_on, and video_on.


Member Function Documentation

void ImageViewer::calcule_c_scale ( ) [private]

Calculates c_scale of the GLWindow.

References c_scale, and frm.

Referenced by initialize(), and resize().

void ImageViewer::changeConnectMode ( int  mode)

Sets the camera connection mode.

Parameters:
modethe type of connection

References config_filename(), video_close(), video_on, and video_open().

void ImageViewer::copy_frame ( int  begin = -1,
int  end = -1 
)
void ImageViewer::draw ( ) [private]
void ImageViewer::flick ( void  )

Does the flip operation if the user turns it on, that is, alternates the last captured image and the "live" image.

References flick_delay, flick_on, and video_on.

Referenced by draw().

int ImageViewer::get_video_on ( void  ) [inline]

References video_on.

void ImageViewer::goToFrame ( int  frameNumber)

Goes to specified frame.

Parameters:
frameNumberthe frame number in animation.

References ImgList::current, imgl, and imglist_go_to_frame().

void ImageViewer::init_GL ( ) [private]

Sets up Viewport and Projection of the GLWindow.

Referenced by draw().

bool ImageViewer::initialize ( int  w,
int  h 
)

Initializes ImageViewer depending on imgvmode (_MUAN_PLAYER / _MUAN_FULL) _MUAN_PLAYER: Alloc image _MUAN_FULL : Alloc image and start camera connection.

Returns:
true for success or false if can't initialize communication with device.

References _MUAN_FULL, _MUAN_PLAYER, calcule_c_scale(), clipboard, frm, imgl, imglist_alloc(), imgvmode, video_getframe(), video_on, and video_stopReceive().

void ImageViewer::insert_frame ( int  delay,
int  frame_duration 
)

Inserts a new frame.

Parameters:
delaythe frame delay.
frame_durationthe frame duration.

References filter_on, ImgList::img_h, ImgList::img_w, imgl, imgnode_alloc(), and video_getframe().

void ImageViewer::paste_frame ( bool  invert = false)

References clipboard, ImgList::head, and imgl.

void ImageViewer::play ( )
void ImageViewer::playInRange ( int  begin,
int  end 
)

Plays specified range from a video.

Parameters:
beginthe begin of the range.
endthe end of the range.

References ImgList::current, ImgNode::frame_number, imgl, imglist_go_to_frame(), imglist_step_foward(), is_looping, is_playing, ImgNode::next, ImgNode::prev, and ImgNode::time_stamp.

void ImageViewer::resize ( int  X,
int  Y,
int  W,
int  H 
) [private]

Resizes the GLwindow.

Parameters:
Xthe x coordinate of window position
Ythe y coordinate of window position
Wthe window width.
Hthe window height.

References calcule_c_scale().

void ImageViewer::setModeViewer ( int  _camera_on,
int  _mem_alert,
setLabelModeViewerFunc  setLabel = NULL 
)

Sets the visualization mode (CAMERA or MEMORY) Starts or stops the connection with the camera depending on the mode.

In fail case of changing to camera mode (start camera connection), can display a message. Sets the label of the switch mode button.

Parameters:
_camera_ontrue to CAMERA mode or false to MEMORY mode.
_mem_alertdefines if display an alert or not.
setLabelthe function that sets the label of UI.

References flick_on, and video_on.

void ImageViewer::stop ( )

Stops the video.

References is_playing.


Member Data Documentation

double ImageViewer::c_scale [private]

Referenced by calcule_c_scale(), draw(), and ImageViewer().

Referenced by flick(), and ImageViewer().

Referenced by draw(), and ImageViewer().

Referenced by draw(), and ImageViewer().

Referenced by draw(), and ImageViewer().


The documentation for this class was generated from the following files: