178 |
kaklik |
1 |
#ifndef __CALIBRATEWIDGET_HH |
|
|
2 |
#define __CALIBRATEWIDGET_HH |
|
|
3 |
|
|
|
4 |
|
|
|
5 |
#include <boost/array.hpp> |
|
|
6 |
#include <boost/numeric/ublas/vector.hpp> |
|
|
7 |
#include <boost/smart_ptr.hpp> |
|
|
8 |
#include <QtOpenGL/QGLWidget> |
|
|
9 |
#include "image.h" |
|
|
10 |
#include "image_input.h" |
|
|
11 |
|
|
|
12 |
/// Widget for displaying calibration pattern. |
|
|
13 |
class CalibrateWidget: public QGLWidget |
|
|
14 |
{ |
|
|
15 |
Q_OBJECT |
|
|
16 |
public: |
|
|
17 |
/// |
|
|
18 |
typedef boost::numeric::ublas::vector< double > Vector; |
|
|
19 |
/// |
|
|
20 |
CalibrateWidget( QWidget *parent = 0, Qt::WFlags f = 0 ); |
|
|
21 |
/// |
|
|
22 |
CalibrateWidget( const mimas::image< unsigned char > &_projectedPattern, |
|
|
23 |
QWidget *parent = 0, Qt::WFlags f = 0 ); |
|
|
24 |
/** ith position of projected pattern. |
|
|
25 |
<ul> |
|
|
26 |
<li><b>i=1</b> left-top corner</li> |
|
|
27 |
<li><b>i=2</b> right-top corner</li> |
|
|
28 |
<li><b>i=3</b> left-bottom corner</li> |
|
|
29 |
<li><b>i=4</b> right-bottom corner</li> |
|
|
30 |
<li><b>i=5</b> center of screen</li> |
|
|
31 |
</ul> |
|
|
32 |
@param i index of position |
|
|
33 |
@return coordinates to display patten at. */ |
|
|
34 |
Vector getPos( int i ); |
|
|
35 |
public slots: |
|
|
36 |
/** Display pattern at specified position |
|
|
37 |
@see pattern |
|
|
38 |
@see getPos */ |
|
|
39 |
void setPattern(int); |
|
|
40 |
protected: |
|
|
41 |
/// |
|
|
42 |
void initializeGL(void); |
|
|
43 |
/// |
|
|
44 |
void resizeGL( int w, int h ); |
|
|
45 |
/// |
|
|
46 |
void paintGL(void); |
|
|
47 |
/// Image storing projection pattern |
|
|
48 |
mimas::image< unsigned char > projectedPattern; |
|
|
49 |
/** Index of current pattern-position. |
|
|
50 |
@see setPattern */ |
|
|
51 |
int pattern; |
|
|
52 |
}; |
|
|
53 |
|
|
|
54 |
#endif |
|
|
55 |
|