-
Notifications
You must be signed in to change notification settings - Fork 0
/
glut.h
executable file
·135 lines (114 loc) · 2.99 KB
/
glut.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
#pragma once
#include "global.h"
#include "clust_knn.h"
#include "zpr.h"
#include "pick.h"
#include "console.h"
void quit();
void idle();
// namespace myglut{
#define WindowX NCol
#define WindowY NRow
class GLUTWindow;
class GLUT3d;
class GLUT2d;
class clust_knn;
static void display3d();
static void display2d();
static void displayd();
static void processKeys(unsigned char key, int x, int y) ;
//previously key functionality
void extern show_classes();
void extern toggle_display();
class GLUTWindow{
public:
clust_knn * myclust;
unsigned int curband[3];
SA<float> * b1;
SA<float> * b2;
SA<float> * b3;
int writelock;
int busy(){
return writelock;
}
void setBusy(){
writelock = true;
}
void setNotBusy(){
writelock = false;
}
int isClassification;
GLUTWindow();
void focus();
int initGLUT(int _NRow, int _NCol, const char * title_string);
void setRGB( SA<float> * r, SA<float> * g, SA<float> * b,
unsigned int A, unsigned int B, unsigned int C);
void setDisplayFunc( void (*f)());
void setKeys( void (*f)(unsigned char, int, int) , void (*g)(int, int, int) );
void setPos(int x, int y);
void setRightOf(GLUTWindow * other);
void setBelow(GLUTWindow * other);
void set_clust(clust_knn * k){
myclust = k;
}
int myID();
int nCol();
int nRow();
int myX();
int myY();
int XPos, YPos;
int WindowX, WindowY;
int WindowID;
int Update;
};
class GLUT2d;
class GLUT2d: public GLUTWindow{
public:
SA<float> * dat;
SA<float> datClust; //data transformed to display clusters...
SA<float> datBinary; //black or white image (to reveal one class).
SA<int> datResult; //class centre index image...
SA<int> indClosest; //record the index of the pixel (from the clustered pixels) that's closest so far to the given (full image) pixel.
SA<int> indCentre; //records the cluster index.
SA<int> surprise;
int render_clusters; //true/false
GLUT2d(int _NRow, int _NCol, const char * title_string);
int initGLUT(int _NRow, int _NCol, const char * title_string);
void setView();
void quickdraw();
void draw2d();
void rebuffer();
void refresh();
void mark();
void lock(){
render_clusters = false;
}
void unlock(){
render_clusters = true;
}
void recalc_binary_quick(int mypick);
void recalc_binary(int mypick);
void reclass_point(int i, int j);
int reboot();
int recalc_classes();
void draw_classes();
void idlethreadfunc();
int thread_exists;
int glbusy;
};
class GLUT3d: public GLUTWindow{
public:
int lock;
int N;
vector<float> class_centres;
GLUT3d(int _NRow, int _NCol, int _N);
int initGLUT(int _NRow, int _NCol);
void set_clust( clust_knn * k);
void runclust();
void setView();
void display_picked_points(int PickThis);
void draw3d();
void refresh();
void mark();
};
// }