ubit
calib.hpp
1 /*************************************************************************
2  *
3  * calib.hpp - UMS Server
4  * Ubit GUI Toolkit - Version 6.0
5  * (C) 2008 Eric Lecolinet / ENST Paris / www.enst.fr/~elc/ubit
6  *
7  * ***********************************************************************
8  * COPYRIGHT NOTICE :
9  * THIS PROGRAM IS DISTRIBUTED WITHOUT ANY WARRANTY AND WITHOUT EVEN THE
10  * IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
11  * YOU CAN REDISTRIBUTE IT AND/OR MODIFY IT UNDER THE TERMS OF THE GNU
12  * GENERAL PUBLIC LICENSE AS PUBLISHED BY THE FREE SOFTWARE FOUNDATION;
13  * EITHER VERSION 2 OF THE LICENSE, OR (AT YOUR OPTION) ANY LATER VERSION.
14  * SEE FILES 'COPYRIGHT' AND 'COPYING' FOR MORE DETAILS.
15  * ***********************************************************************/
16 
17 #ifndef _umscalib_hpp_
18 #define _umscalib_hpp_
19 #include <X11/Xlib.h>
20 
24 struct Calibration {
25  enum {POINT_COUNT = 4};
26  static const int CROSS_XYPOS;
27  static const int CROSS_SIZE;
28  static const float SCREEN_SIZE_PERCENT;
29 
30  Calibration(class UMServer*);
31 
32  bool isCalibrationCompleted() const;
33  void startCalibration(const char* title);
34  void configureCalibrationWin(int x, int y, int w, int h);
35  void setCalibrationPoint(double x, double y);
36  void unsetLastCalibrationPoint();
37  void drawCalibrationPoint();
38 
39  class UMServer& ums;
40  WindowID calwin;
41  bool is_calibrating, is_completed;
42  GC calgc;
43  int curpoint;
44  int x, y, width, height;
45  int xp[POINT_COUNT], yp[POINT_COUNT];
46  double xcm[POINT_COUNT], ycm[POINT_COUNT];
47  int msg_x, msg_y;
48  unsigned long black_pixel, red_pixel;
49 };
50 
51 #endif
52 
double ycm[POINT_COUNT]
position of calpoints in source coords
Definition: calib.hpp:46
int curpoint
completed when == POINT_COUNT
Definition: calib.hpp:43
int height
coords of the calibration window (= its pos. on the screen)
Definition: calib.hpp:44
UMS server main class.
Definition: umserver.hpp:152
int yp[POINT_COUNT]
positions of calpoints in pixels on the screen
Definition: calib.hpp:45
settings of the calibration window (used for absolute positioning devices such as the MIMIO) ...
Definition: calib.hpp:24