#include <glbox.h>
Public Member Functions | |
GLBox (QWidget *parent=0, const char *name=0, const QGLWidget *shareWidget=0) | |
Create a GLBox widget. | |
GLBox (const QGLFormat &format, QWidget *parent=0, const char *name=0, const QGLWidget *shareWidget=0) | |
~GLBox () | |
Release allocated resources. | |
void | screenToImageCoord (int sx, int sy, float *imx, float *imy) const |
void | imageToScreenCoord (float x, float y, int *sx, int *sy) const |
void | translate (float dx, float dy) |
translate image of (dx,dy). | |
void | zoom (float sx, float sy) |
void | setAxisUp (bool up) |
void | setImageSpace () |
void | setImage (IplImage *image) |
void | loadGlTexture (IplImage *im) |
bool | renderAndSave (const char *filename, int w=720, int h=576) |
off screen rendering. | |
void | setupTransform () |
GLBox (QWidget *parent=0, const char *name=0, const QGLWidget *shareWidget=0) | |
GLBox (const QGLFormat &format, QWidget *parent=0, const char *name=0, const QGLWidget *shareWidget=0) | |
~GLBox () | |
void | screenToImageCoord (int sx, int sy, float *imx, float *imy) const |
void | imageToScreenCoord (float x, float y, int *sx, int *sy) const |
void | translate (float dx, float dy) |
translate image of (dx,dy). | |
void | zoom (float sx, float sy) |
void | setAxisUp (bool up) |
void | setImageSpace () |
void | setImage (IplImage *image) |
void | loadGlTexture (IplImage *im) |
bool | renderAndSave (const char *filename, int w=720, int h=576) |
off screen rendering. | |
void | setupTransform () |
Static Public Member Functions | |
static GLuint | genGlTexture (int texWidth, int texHeight, bool smooth=false) |
static GLuint | genGlTexture (int texWidth, int texHeight, bool smooth=false) |
Public Attributes | |
bool | reloadImage |
bool | allowCache |
float | dx |
float | dy |
float | sx |
float | sy |
bool | yAxisUp |
bool | smooth |
Protected Member Functions | |
virtual void | initializeGL () |
Set up the OpenGL rendering state, and define display list. | |
virtual void | paintGL () |
Paint the box. | |
virtual void | resizeGL (int w, int h) |
Set up the OpenGL view port, matrix mode, etc. | |
virtual void | mouseMoveEvent (QMouseEvent *e) |
virtual void | wheelEvent (QWheelEvent *e) |
virtual void | mousePressEvent (QMouseEvent *e) |
virtual void | saveContext () |
virtual void | restoreContext () |
void | loadTexture () |
void | invertAffine () |
virtual void | initializeGL () |
virtual void | paintGL () |
virtual void | resizeGL (int w, int h) |
virtual void | mouseMoveEvent (QMouseEvent *e) |
virtual void | wheelEvent (QWheelEvent *e) |
virtual void | mousePressEvent (QMouseEvent *e) |
virtual void | saveContext () |
virtual void | restoreContext () |
void | loadTexture () |
void | invertAffine () |
Protected Attributes | |
IplImage * | image |
GLuint | texture |
GLuint | savedTexture |
int | textureWidth |
int | textureHeight |
float | affineTransf [2][3] |
float | invAffineTransf [2][3] |
Definition at line 41 of file glbox.h.
GLBox::GLBox | ( | QWidget * | parent = 0 , |
|
const char * | name = 0 , |
|||
const QGLWidget * | shareWidget = 0 | |||
) |
GLBox::GLBox | ( | const QGLFormat & | format, | |
QWidget * | parent = 0 , |
|||
const char * | name = 0 , |
|||
const QGLWidget * | shareWidget = 0 | |||
) |
GLBox::~GLBox | ( | ) |
GLBox::GLBox | ( | QWidget * | parent = 0 , |
|
const char * | name = 0 , |
|||
const QGLWidget * | shareWidget = 0 | |||
) |
GLBox::GLBox | ( | const QGLFormat & | format, | |
QWidget * | parent = 0 , |
|||
const char * | name = 0 , |
|||
const QGLWidget * | shareWidget = 0 | |||
) |
GLBox::~GLBox | ( | ) |
static GLuint GLBox::genGlTexture | ( | int | texWidth, | |
int | texHeight, | |||
bool | smooth = false | |||
) | [static] |
GLuint GLBox::genGlTexture | ( | int | texWidth, | |
int | texHeight, | |||
bool | smooth = false | |||
) | [static] |
void GLBox::imageToScreenCoord | ( | float | x, | |
float | y, | |||
int * | sx, | |||
int * | sy | |||
) | const |
void GLBox::imageToScreenCoord | ( | float | x, | |
float | y, | |||
int * | sx, | |||
int * | sy | |||
) | const |
virtual void GLBox::initializeGL | ( | ) | [protected, virtual] |
void GLBox::initializeGL | ( | ) | [protected, virtual] |
Set up the OpenGL rendering state, and define display list.
Definition at line 159 of file glbox.cpp.
References reloadImage.
void GLBox::invertAffine | ( | ) | [protected] |
void GLBox::invertAffine | ( | ) | [protected] |
Definition at line 470 of file glbox.cpp.
References affineTransf, and invAffineTransf.
Referenced by setupTransform().
void GLBox::loadGlTexture | ( | IplImage * | im | ) |
void GLBox::loadGlTexture | ( | IplImage * | im | ) |
Definition at line 390 of file glbox.cpp.
References genGlTexture(), smooth, texture, textureHeight, and textureWidth.
Referenced by loadTexture().
void GLBox::loadTexture | ( | ) | [protected] |
void GLBox::loadTexture | ( | ) | [protected] |
Definition at line 381 of file glbox.cpp.
References allowCache, image, loadGlTexture(), reloadImage, and texture.
Referenced by paintGL().
virtual void GLBox::mouseMoveEvent | ( | QMouseEvent * | e | ) | [protected, virtual] |
void GLBox::mouseMoveEvent | ( | QMouseEvent * | e | ) | [protected, virtual] |
Definition at line 440 of file glbox.cpp.
References dx, dy, screenToImageCoord(), and setupTransform().
virtual void GLBox::mousePressEvent | ( | QMouseEvent * | e | ) | [protected, virtual] |
Reimplemented in VSView, and vobj_tracker_view.
void GLBox::mousePressEvent | ( | QMouseEvent * | e | ) | [protected, virtual] |
virtual void GLBox::paintGL | ( | ) | [protected, virtual] |
Reimplemented in VSView, and vobj_tracker_view.
void GLBox::paintGL | ( | ) | [protected, virtual] |
Paint the box.
The actual openGL commands for drawing the box are performed here.
Reimplemented in VSView, and vobj_tracker_view.
Definition at line 94 of file glbox.cpp.
References image, loadTexture(), setImageSpace(), smooth, textureHeight, textureWidth, and yAxisUp.
Referenced by renderAndSave().
bool GLBox::renderAndSave | ( | const char * | filename, | |
int | w = 720 , |
|||
int | h = 576 | |||
) |
off screen rendering.
create a GL context, call initializeGL() and paintGL(), and save the result to the PNG or JPG file specified as argument.
w | image width. If 0, uses the current widget width. | |
h | image height. If 0, uses the current widget height. |
bool GLBox::renderAndSave | ( | const char * | filename, | |
int | w = 720 , |
|||
int | h = 576 | |||
) |
off screen rendering.
create a GL context, call initializeGL() and paintGL(), and save the result to the PNG or JPG file specified as argument.
w | image width. If 0, uses the current widget width. | |
h | image height. If 0, uses the current widget height. |
Definition at line 362 of file glbox.cpp.
References paintGL().
Referenced by vobj_tracker_view::keyPressEvent(), VSView::keyPressEvent(), vobj_tracker_view::timerEvent(), and VSView::timerEvent().
virtual void GLBox::resizeGL | ( | int | w, | |
int | h | |||
) | [protected, virtual] |
void GLBox::resizeGL | ( | int | w, | |
int | h | |||
) | [protected, virtual] |
Set up the OpenGL view port, matrix mode, etc.
Definition at line 192 of file glbox.cpp.
Referenced by vobj_tracker_view::paintGL(), and VSView::paintGL().
virtual void GLBox::restoreContext | ( | ) | [protected, virtual] |
void GLBox::restoreContext | ( | ) | [protected, virtual] |
virtual void GLBox::saveContext | ( | ) | [protected, virtual] |
void GLBox::saveContext | ( | ) | [protected, virtual] |
void GLBox::screenToImageCoord | ( | int | sx, | |
int | sy, | |||
float * | imx, | |||
float * | imy | |||
) | const |
void GLBox::screenToImageCoord | ( | int | sx, | |
int | sy, | |||
float * | imx, | |||
float * | imy | |||
) | const |
Definition at line 206 of file glbox.cpp.
References image, and invAffineTransf.
Referenced by mouseMoveEvent().
void GLBox::setAxisUp | ( | bool | up | ) | [inline] |
void GLBox::setAxisUp | ( | bool | up | ) | [inline] |
Definition at line 61 of file glbox.h.
References setupTransform(), and yAxisUp.
Referenced by vobj_tracker_view::paintGL(), and VSView::paintGL().
void GLBox::setImage | ( | IplImage * | image | ) |
void GLBox::setImage | ( | IplImage * | image | ) |
Definition at line 200 of file glbox.cpp.
References reloadImage.
Referenced by vobj_tracker_view::paintGL(), vobj_tracker_view::timerEvent(), VSView::timerEvent(), vobj_tracker_view::vobj_tracker_view(), and VSView::VSView().
void GLBox::setImageSpace | ( | ) |
void GLBox::setImageSpace | ( | ) |
Definition at line 314 of file glbox.cpp.
References affineTransf, and image.
Referenced by vobj_tracker_view::paintGL(), VSView::paintGL(), and paintGL().
void GLBox::setupTransform | ( | ) |
void GLBox::setupTransform | ( | ) |
Definition at line 246 of file glbox.cpp.
References affineTransf, dx, dy, image, invertAffine(), sx, sy, and yAxisUp.
Referenced by mouseMoveEvent(), setAxisUp(), translate(), wheelEvent(), and zoom().
void GLBox::translate | ( | float | dx, | |
float | dy | |||
) | [inline] |
translate image of (dx,dy).
Use 0,0 for normal centered rendering (default). dx points toward right, dy points up. Dx, dy are expressed in pixels.
Definition at line 59 of file glbox.h.
References setupTransform().
void GLBox::translate | ( | float | dx, | |
float | dy | |||
) | [inline] |
translate image of (dx,dy).
Use 0,0 for normal centered rendering (default). dx points toward right, dy points up. Dx, dy are expressed in pixels.
Definition at line 59 of file glbox.h.
References setupTransform().
Referenced by vobj_tracker_view::keyPressEvent(), and VSView::keyPressEvent().
virtual void GLBox::wheelEvent | ( | QWheelEvent * | e | ) | [protected, virtual] |
void GLBox::wheelEvent | ( | QWheelEvent * | e | ) | [protected, virtual] |
void GLBox::zoom | ( | float | sx, | |
float | sy | |||
) | [inline] |
void GLBox::zoom | ( | float | sx, | |
float | sy | |||
) | [inline] |
Definition at line 60 of file glbox.h.
References setupTransform().
Referenced by vobj_tracker_view::keyPressEvent(), VSView::keyPressEvent(), and VSView::VSView().
float GLBox::affineTransf [protected] |
Definition at line 125 of file glbox.h.
Referenced by imageToScreenCoord(), invertAffine(), setImageSpace(), and setupTransform().
bool GLBox::allowCache |
float GLBox::dx |
float GLBox::dy |
IplImage * GLBox::image [protected] |
Definition at line 117 of file glbox.h.
Referenced by imageToScreenCoord(), loadTexture(), paintGL(), vobj_tracker_view::saveCurrentFrame(), VSView::saveCurrentFrame(), screenToImageCoord(), setImageSpace(), setupTransform(), and VSView::timerEvent().
float GLBox::invAffineTransf [protected] |
bool GLBox::reloadImage |
GLuint GLBox::savedTexture [protected] |
bool GLBox::smooth |
float GLBox::sx |
float GLBox::sy |
GLuint GLBox::texture [protected] |
Definition at line 118 of file glbox.h.
Referenced by loadGlTexture(), loadTexture(), restoreContext(), saveContext(), and ~GLBox().
int GLBox::textureHeight [protected] |
int GLBox::textureWidth [protected] |
bool GLBox::yAxisUp |