MUAN
|
#include <imgviewer.h>
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 |
ImgList * | imgl |
ImgList * | clipboard |
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 |
ImageViewer::ImageViewer | ( | int | x, |
int | y, | ||
int | w, | ||
int | h | ||
) |
ImageViewer Creates a new ImageViewer from an OpenGL Window.
x | the x coordinate of window position. |
y | the y coordinate of window position. |
w | the image width. |
h | the image height. |
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.
void ImageViewer::calcule_c_scale | ( | ) | [private] |
Calculates c_scale of the GLWindow.
Referenced by initialize(), and resize().
void ImageViewer::changeConnectMode | ( | int | mode | ) |
Sets the camera connection mode.
mode | the type of connection |
References config_filename(), video_close(), video_on, and video_open().
void ImageViewer::copy_frame | ( | int | begin = -1 , |
int | end = -1 |
||
) |
References clipboard, ImgList::current, imgl, imglist_clear(), imglist_go_to_frame(), and imgnode_copy().
void ImageViewer::draw | ( | ) | [private] |
Draws an image from the ImageList (captured image) or from the camera.
References c_scale, filter_on, flick(), flick_on, frm, ImgList::img_h, ImgList::img_w, imgl, imglist_peek_current_frame(), imgnode_alloc(), init_GL(), is_saving, setMessage(), transp_fac, transp_on, ui_setfilter(), video_getframe(), and video_on.
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.
frameNumber | the 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.
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.
delay | the frame delay. |
frame_duration | the 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 | ( | ) |
Plays a video.
References ImgList::current, imgl, imglist_rew(), imglist_step_foward(), is_looping, is_playing, ImgNode::next, and ImgNode::time_stamp.
void ImageViewer::playInRange | ( | int | begin, |
int | end | ||
) |
Plays specified range from a video.
begin | the begin of the range. |
end | the 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.
X | the x coordinate of window position |
Y | the y coordinate of window position |
W | the window width. |
H | the 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.
_camera_on | true to CAMERA mode or false to MEMORY mode. |
_mem_alert | defines if display an alert or not. |
setLabel | the function that sets the label of UI. |
void ImageViewer::stop | ( | ) |
Stops the video.
References is_playing.
double ImageViewer::c_scale [private] |
Referenced by calcule_c_scale(), draw(), and ImageViewer().
Referenced by copy_frame(), ImageViewer(), initialize(), and paste_frame().
Referenced by draw(), ImageViewer(), and insert_frame().
double ImageViewer::flick_delay |
Referenced by flick(), and ImageViewer().
Referenced by draw(), flick(), ImageViewer(), and setModeViewer().
Frame* ImageViewer::frm |
Referenced by calcule_c_scale(), draw(), ImageViewer(), and initialize().
Referenced by copy_frame(), draw(), goToFrame(), ImageViewer(), initialize(), insert_frame(), paste_frame(), play(), and playInRange().
Referenced by initialize().
Referenced by ImageViewer(), play(), and playInRange().
Referenced by ImageViewer(), play(), playInRange(), and stop().
Referenced by draw(), and ImageViewer().
double ImageViewer::transp_fac |
Referenced by draw(), and ImageViewer().
Referenced by draw(), and ImageViewer().
int ImageViewer::video_on [private] |
Referenced by changeConnectMode(), draw(), flick(), get_video_on(), ImageViewer(), initialize(), and setModeViewer().