#include <Imagine/Graphics.h>
#include <iostream>
#include <fstream>
#include <cmath>
#include <cstdlib>
using namespace std;
void windows() {
cout << "Testing Window functions!" << endl;
#ifdef IMAGINE_OPENGL
#endif
#ifdef IMAGINE_OPENGL
string names[]={"2D a","2D b","3D"};
WindowType types[]={WINDOW_2D,WINDOW_2D,WINDOW_3D};
#else
string names[]={"2D a","2D b"};
#endif
cout << "Click in red tab" << endl;
cout << "Click" << endl;
#ifdef IMAGINE_OPENGL
#endif
}
void draw2D() {
cout << "Testing 2D functions!" << endl;
int x[]={100,200,170},y[]={200,250,220};
int xy[]={120,30,200,60,160,80};
for (int i=0;i<200;i+=5)
for (int i=0;i<200;i+=5)
cout << "Please click" << endl;
}
void events2() {
int w=300, h=50;
bool b = false;
do {
case EVT_NONE:
cout << "No event" << endl;
break;
case EVT_MOTION: {
if(P1.x()<=x && x<P1.x()+w && P1.y()<=y && y<P1.y()+h) {
} else if(P2.x()<=x && x<P2.x()+w && P2.y()<=y && y<P2.y()+h) {
} else {
}
break;
}
case EVT_KEY_ON:
cout << "Use your mouse!"<< endl;
break;
case EVT_BUT_ON: {
if(P1.x()<=x && x<P1.x()+w && P1.y()<=y && y<P1.y()+h) {
cout << "Starting a new Tetris game !!" << endl;
b = true;
}
break;
}
default: break;
}
}
while ((ev.
type!=EVT_KEY_ON || ev.
key!=
'q' )&& !b);
cout << "Use your arrow keys. Press 'q' to quit." << endl;
int x=50, y=200, r=5;
int xt=x, yt=y;
while(true) {
if(k == 'q')
break;
bool update = true;
switch(k){
case KEY_UP: y-=5; break;
case KEY_DOWN: y+=5; break;
case KEY_LEFT: x-=5; break;
case KEY_RIGHT:x+=5; break;
default: update=false; break;
}
if(update) {
xt = x; yt = y;
}
}
}
void events() {
cout << "Testing event functions!" << endl;
cout << "Please click in first tab" << endl;
cout << "button clicked: " << button << endl;
cout << "click again in any tab" << endl;
cout << "button clicked: " << button << endl;
int sw;
cout << "click again in any tab" << endl;
cout << "button clicked: " << button << endl;
int x,y;
cout << "click again in first tab" << endl;
cout << "button clicked: " << button << " pos: " << x << ',' << y << endl;
cout << "click again in first tab" << endl;
cout << "button clicked: " << button << " pos: " << p << endl;
cout << "click again in any tab" << endl;
cout << "button clicked: " << button << " pos: " << x << ',' << y
<< " subWin: " << sw << endl;
cout << "click again" << endl;
cout << "button clicked: " << button << " pos: " << p
<< " subWin: " << sw << endl;
do {
cout << "Please press UP arrow in first tab" << endl;
cout << "Press key, check modifier keys let you proceed" << endl;
cout << "Press key, check modifier keys do *not* let you proceed" << endl;
cout << "Please press some key in any tab (modifier keys ignored)" << endl;
cout << "Please press some key in any tab (modifier keys OK)" << endl;
cout << "Key: " << key << " subWin: " << sw << endl;
for (int i=0;i<4;i++) {
cout << i << endl;
}
cout << "Generate events, press 'q' key done" << endl;
do {
case EVT_NONE:
cout << "No event for 500ms" << endl;
break;
case EVT_MOTION:
cout << "Motion" << endl;
break;
case EVT_KEY_ON:
cout <<
"Key " << ev.
key <<
" pressed"<< endl;
break;
case EVT_KEY_OFF:
cout <<
"Key " << ev.
key <<
" released"<< endl;
break;
case EVT_BUT_ON:
cout <<
"Button " << ev.
button <<
" pressed"<< endl;
break;
case EVT_BUT_OFF:
cout <<
"Button " << ev.
button <<
" released"<< endl;
break;
}
cout <<
" Mouse=[" << ev.
pix.
x() <<
','<<ev.
pix.
y() <<
"] ,State="<< ev.
state
<<
",Win=" << ev.
win <<
",SubWin=" << ev.
subWin << endl;
}
while (ev.
type!=EVT_KEY_ON || ev.
key!=
'q');
cout << "Please click" << endl;
}
void transparency() {
cout << "Testing image transparency" << endl;
int W, H;
int w,h,w1,h1;
cout << "Transparent image (R,G,B,A) from PNG" << endl;
cout << "Two opaque images" << endl;
cout << "Tranparent image (RGBA) from PNG" << endl;
cout << "First Mask" << endl;
cout << "Image saved" << endl;
else
cout << "Image is *not* saved -> something is wrong" << endl;
int Aw, Ah;
cout << "out.png loaded" << endl;
cout << "Transparent image saved and reloaded on black background" << endl;
delete [] AC;
cout << "2nd Mask for AlphaColor" << endl;
delete[] C;
delete[] R; delete[] G; delete[] B; delete[] A;
delete[] r; delete[] g; delete[] b; delete[] a;
cout << "3rd mask for RGBA" << endl;
delete[] r1; delete[] g1; delete[] b1;
delete[] rgba;
delete[] RGBA1;
octet *ri, *gi, *bi, *ai;
int wi, hi;
for(int i = 0; i < 50; i++)
{
for(int j=0; j<wi*hi; j++)
{
ai[j] = i;
}
}
delete[] C1; delete[] aC;
delete[] ri; delete[] gi; delete[] bi; delete[] ai;
}
void bitmaps() {
cout << "Testing bitmap functions!" << endl;
octet r[256*256],g[256*256],b[256*256];
for (int j=0;j<256;j++) {
for (int i=0;i<256;i++) {
r[i+256*j]=i;
g[i+256*j]=255-i;
b[i+256*j]=(j<128)?255:0;
}
}
for (int j=0;j<256;j++)
for (int i=0;i<256;i++)
cols[i+256*j]=
Color(i,(2*j)%256,(i+j)%256);
delete [] cols;
for (int j=0;j<256;j++)
for (int i=0;i<256;i++) {
rgb[3*(i+256*j)]=i/2;
rgb[3*(i+256*j)+1]=255-j/2;
rgb[3*(i+256*j)+2]=128;
}
delete [] rgb;
for (int j=0;j<256;j++)
for (int i=0;i<256;i++)
int w,h;
delete[]R;
delete[]G;
delete[]B;
delete[]C;
delete[]I;
delete[]R;
delete[]G;
delete[]B;
delete[]C;
cout << "Color at (10,10): " << c1 << endl;
cout << "Color at (10,10): " << c2 << endl;
octet r1[100*50],g1[100*50],b1[100*50];
#ifdef IMAGINE_OPENGL
cout << "Click on cone window to capture" << endl;
delete[]R;
delete[]G;
delete[]B;
delete[]C;
#if 0
float *Z;
captureZBuffer(Z,w,h);
float mn=1e10,mx=-1e10;
for (int i=0;i<w*h;i++) {
mn=min(mn,Z[i]);
mx=max(mx,Z[i]);
}
for (int i=0;i<w*h;i++)
I[i]=
octet(255*(Z[i]-mn)/(mx-mn));
delete[]Z;
delete[]I;
#endif
#endif
const int sz=128;
octet r2[sz*sz],g2[sz*sz],b2[sz*sz];
for (int y=0;y<sz;y++) {
for (int x=0;x<sz;x++) {
r2[x+sz*y]=x;
g2[x+sz*y]=y;
b2[x+sz*y]=(x+y);
}
}
bm.setColorImage(0,0,r2,g2,b2,sz,sz);
bm.setColorImage(
IntPoint2(0,0),r2,g2,b2,sz,sz);
for (int y=0;y<64;y++)
for (int x=0;x<64;x++)
cols2[x+64*y]=
Color((x+y)%256,0,0);
bm.setColorImage(32,32,cols2,64,64);
bm.setColorImage(
IntPoint2(32,32),cols2,64,64);
for (int y=0;y<64;y++)
for (int x=0;x<64;x++) {
rgb2[3*(x+64*y)]=x;
rgb2[3*(x+64*y)+1]=y;
rgb2[3*(x+64*y)+2]=x+y;
}
bm.setColorImage(64,0,rgb2,64,64);
bm.setColorImage(
IntPoint2(64,0),rgb2,64,64);
for (int y=0;y<64;y++)
for (int x=0;x<64;x++)
grey2[(x+64*y)]=x+2*y;
bm.setGreyImage(0,64,grey2,64,64);
bm.setGreyImage(
IntPoint2(0,64),grey2,64,64);
for (int x=0;x<sz;x++) {
}
for (int i=0;i<1024;i+=8) {
}
cout << "Please click" << endl;
#ifdef IMAGINE_OPENGL
#endif
}
#ifdef IMAGINE_OPENGL
void draw3D() {
cout << "Testing 3D functions!" << endl;
DoublePoint3 dP[8]={
DoublePoint3(-1,-1,-1),
DoublePoint3(1,-1,-1),
DoublePoint3(1,1,-1),
DoublePoint3(-1,1,-1),
DoublePoint3(-1,-1,1),
DoublePoint3(1,-1,1),
DoublePoint3(1,1,1),
DoublePoint3(-1,1,1)
};
Triangle dT[12]={
Triangle(0,2,1),
Triangle(2,0,3),
Triangle(4,5,6),
Triangle(6,7,4),
Triangle(0,1,5),
Triangle(5,4,0),
Triangle(1,2,6),
Triangle(6,5,1),
Triangle(2,3,7),
Triangle(7,6,2),
Triangle(3,0,4),
Triangle(4,7,3)
};
FloatPoint3 fP[8]={
FloatPoint3(3,-1,-1),
FloatPoint3(5,-1,-1),
FloatPoint3(5,1,-1),
FloatPoint3(3,1,-1),
FloatPoint3(3,-1,1),
FloatPoint3(5,-1,1),
FloatPoint3(5,1,1),
FloatPoint3(3,1,1)
};
Triangle fT[12]={
Triangle(0,2,1),
Triangle(2,0,3),
Triangle(4,5,6),
Triangle(6,7,4),
Triangle(0,1,5),
Triangle(5,4,0),
Triangle(1,2,6),
Triangle(6,5,1),
Triangle(2,3,7),
Triangle(7,6,2),
Triangle(3,0,4),
Triangle(4,7,3)
};
cout << "Two cubes" << endl;
fM.setOpacity(.5f);
cout << "Play with navigation (use SHIFT + mouse and kb)" << endl;
cout << "Then click..." << endl;
int n=10;
for (int j=0;j<n;j++)
for (int i=0;i<n;i++)
P[i+n*j]=
DoublePoint3(
double(i)/n,
double(j)/n,.2f*cos(
double(i)*6/n)*sin(
double(j)*6/n));
for (int j=0;j<n-1;j++) {
for (int i=0;i<n-1;i++) {
T[2*(i+(n-1)*j)]=
Triangle(i+n*j,i+1+n*j,i+n*(j+1));
T[2*(i+(n-1)*j)+1]=
Triangle(i+1+n*j,i+1+n*(j+1),i+n*(j+1));
}
}
S=
Mesh(P,n*n,T,2*(n-1)*(n-1),0,0,CONSTANT_COLOR,FLAT_SHADING);
cout << "Flat shading, computed normals" << endl;
const float theta=0.05f;
const float rot[3*3] = {
cos(theta), sin(theta), 0,
-sin(theta), cos(theta), 0,
0, 0, 1};
cout << "Change light direction" << endl;
while(true) {
break;
dir = rotz*dir;
}
S=
Mesh(P,n*n,T,2*(n-1)*(n-1),0,0,CONSTANT_COLOR,SMOOTH_SHADING);
cout << "Smooth shading, computed normals" << endl;
for (int j=0;j<n;j++) {
for (int i=0;i<n;i++) {
double fx=-6*.2*sin(double(i)*6/n)*sin(double(j)*6/n);
double fy=6*.2*cos(double(i)*6/n)*cos(double(j)*6/n);
}
}
S=
Mesh(P,n*n,T,2*(n-1)*(n-1),0,0,CONSTANT_COLOR,SMOOTH_SHADING,N);
cout << "Smooth shading, true normals" << endl;
S=
Mesh(P,n*n,T,2*(n-1)*(n-1),0,0,FACE_COLOR,SMOOTH_SHADING);
for (int i=0;i<2*(n-1)*(n-1);i++)
delete[] cols;
cout << "Random triangle colors" << endl;
S=
Mesh(P,n*n,T,2*(n-1)*(n-1),0,0,VERTEX_COLOR,SMOOTH_SHADING);
for (int i=0;i<n*n;i++)
delete[] cols;
cout << "Random vertex colors" << endl;
float *vals=new float[2*(n-1)*(n-1)];
S=
Mesh(P,n*n,T,2*(n-1)*(n-1),0,0,FACE_VALUE,SMOOTH_SHADING);
for (int i=0;i<2*(n-1)*(n-1);i++)
vals[i]=float(i)/(2*(n-1)*(n-1));
delete[] vals;
cout << "Face value coloring" << endl;
S=
Mesh(P,n*n,T,2*(n-1)*(n-1),0,0,VERTEX_VALUE,SMOOTH_SHADING);
vals=new float[n*n];
for (int i=0;i<n*n;i++)
vals[i]=float(i)/(n*n);
delete[] vals;
cout << "Vertex value coloring" << endl;
cout << "Vertex value coloring with custom LUT" << endl;
cout << "Vertex value coloring with default LUT" << endl;
#if 0
MeshClipping cut;
cut.clipOn();
S=VtkMesh(P,n*n,T,2*(n-1)*(n-1),CONSTANT_COLOR,PHONG_SHADING);
cut.showClippedOn();
cut.setClipOpacity(.3);
#endif
delete[] P;
delete[] T;
delete[] N;
S=
Mesh(P3,3,&T3,1,0,0,CONSTANT_COLOR);
cout << "Triangle" << endl;
cout << "Bigger triangle" << endl;
DoublePoint3 P4[]={
DoublePoint3(0,0,0),
DoublePoint3(1,0,0),
DoublePoint3(0,1,0),
DoublePoint3(1,1,1)};
cout << "Two triangles" << endl;
#if 0
int id,but;
cout << "Use shift and mouse to pick a triangle" << endl;
pickMeshCell(M,id,but,-1);
cout << "Use shift and mouse to pick a vertex" << endl;
pickMeshPoint(M,id,but,-1);
#endif
DoublePoint3 PTSCL[]={
DoublePoint3(0,0,2),
DoublePoint3(1,0,2),
DoublePoint3(0,1,2),
DoublePoint3(1,1,2),
DoublePoint3(0,0,1),
DoublePoint3(1,0,1),
DoublePoint3(0,1,1),
DoublePoint3(1,1,1)
};
Mesh Cp=Mesh::PointCloud(PTSCL,8);
Mesh Cpl=Mesh::PolyLine(PTSCL,8,
true);
Mesh Cb=Mesh::Cube(
DoublePoint3(0,-2,0),
DoubleVector3(.1,0,0),
DoubleVector3(.1,.2,0),
DoubleVector3(0,.1,.3));
#if 0
for (int i=0;i<50;i++) {
Ar.landMarkTransform(src,dest,2,false,false,true);
}
Ar.resetPosition();
setAmbient(.2);
double zoom;
getCamera(pos,dir,up,zoom);
for (int i=0;i<50;i++) {
zoom*=1.05;
}
reInitCamera();
#endif
}
#endif
int main(int argc, char** argv) {
typedef void (*FUNC)();
std::vector< pair<string,FUNC> > tests;
#define ADD_TEST(func) \
tests.push_back(make_pair(string(#func), func));
ADD_TEST(windows);
ADD_TEST(transparency);
ADD_TEST(draw2D);
ADD_TEST(events);
ADD_TEST(bitmaps);
ADD_TEST(events2);
#ifdef IMAGINE_OPENGL
ADD_TEST(draw3D);
#endif
std::vector< pair<string,FUNC> >::const_iterator it;
if(argc<=1)
for(it=tests.begin(); it!=tests.end(); ++it) {
cout << "---" << it->first << "---" << std::endl;
it->second();
}
else {
bool fail=false;
for(int i=1; i<argc; i++) {
for(it=tests.begin(); it!=tests.end(); ++it) {
if(it->first == argv[i]) {
cout << "---" << it->first << "---" << std::endl;
it->second();
break;
}
}
if(it==tests.end()) {
std::cout << "Unknown test " << argv[i] << endl;
fail = true;
}
}
if(fail) {
cout << "--- Available tests:" << endl;
for(it=tests.begin(); it!=tests.end(); ++it)
cout << it->first << ' ';
cout << endl;
}
}
return 0;
}
Array of fixed size.
Definition: FArray.h:17
Matrix of fixed dimension.
Definition: FMatrix.h:17
Vector of fixed size.
Definition: FVector.h:17
const T & y() const
Read alias.
Definition: FVector.h:118
const T & x() const
Read alias.
Definition: FVector.h:104
A mesh representing a 3D object.
Definition: Mesh.h:151
void setValues(MeshData data, const float *val)
Set values.
void setColors(MeshData data, const Color *col)
Set colors.
void setColor(Color col)
Set color.
void setGeometry(const FloatPoint3 *vertices, int nvertices, const Triangle *triangles=0, int ntriangles=0, const Quad *quads=0, int nquads=0, const FloatVector3 *normals=0)
Set geometry (float).
void setVertices(const FloatPoint3 *vertices, const FloatVector3 *normals=0)
Set points (float).
void setDefaultLookupTable()
Default LUT.
void setLookupTable(Color col0, Color col1)
Set LUT.
void setRange(float v0, float v1)
Default LUT.
Native bitmap: image stored in graphics card format, fast to display.
Definition: ImageIO.h:514
RED GREEN BLUE Alpha color.
Definition: Color.h:140
RED GREEN BLUE color.
Definition: Color.h:28
const Color WHITE(255, 255, 255)
Predefined color.
const Color YELLOW(255, 255, 0)
Predefined color.
#define srcPath(s)
Transform relative file path to absolute path.
Definition: Base.h:43
const Color BLACK(0, 0, 0)
Predefined color.
const Color MAGENTA(255, 0, 255)
Predefined color.
const Color RED(255, 0, 0)
Predefined color.
const Color CYAN(0, 255, 255)
Predefined color.
unsigned char octet
0 to 255 integer type.
Definition: Color.h:18
int intRandom(int a, int b)
Uniform int.
Definition: Random.h:55
RGBA< octet > AlphaColor
RGBA<byte> alias.
Definition: Color.h:356
const Color GREEN(0, 255, 0)
Predefined color.
const Color BLUE(0, 0, 255)
Predefined color.
RGB< octet > Color
RGB<octet> alias.
Definition: Color.h:283
void closeWindow(Window w)
Close window.
void putGreyImage(int x, int y, const octet *g, int w, int h, bool xorMode=false, double fact=1.)
Display grey bitmap.
DoublePoint3 DoubleVector3
Double space vector.
Definition: Types.h:21
void getEvent(int ms, Event &ev)
Get keyboard and mouse events.
bool saveColorImage(const std::string &name, const Color *cols, int w, int h, int quality=85)
Save color image.
void captureRectangle(int x, int y, Color *c, int w, int h)
Capture (sub window).
int getKey(bool ignoreModifier=true)
Wait for key press in active window.
void setLight(bool b)
Set/unset lighting in 3D rendering.
void setBackGround(const Color &col)
Set ackground color of window.
void hideMesh(const Mesh &M, bool reinitCam=true)
Hide mesh.
int anyGetKey(Window &win, int &subWin, bool ignoreModifier=true)
Wait for key press in any window.
FVector< float, 3 > FloatPoint3
Float space point.
Definition: Types.h:23
int anyGetMouse(int &x, int &y, Window &win, int &subWin)
Wait for mouse click in any window (returning window and position).
void putNativeBitmap(int x, int y, const NativeBitmap &bm, bool xorMode=false, double fact=1.)
Display native bitmap.
Window openWindow(int w, int h, const std::string &windowTitle="Imagine++", int x=-1, int y=-1)
New window for 2D graphics.
void drawPoint(int x, int y, const Color &col, bool xorMode=false)
Point.
void setActiveWindow(Window w, int subWin=0)
Set active window.
void drawPoly(const int x[], const int y[], int n, const Color &col, int width=1, bool xorMode=false)
Draw a polygon.
void drawEllipse(int x, int y, int w, int h, const Color &col, int penWidth=1, bool xorMode=false)
Ellipse.
int getMouse(int &x, int &y)
Wait for mouse click in active window (returning position).
void setMaskFromColor(octet *&r, octet *&g, octet *&b, octet *&a, int w, int h, const Color &col)
Create a transparency mask from a specified color-key.
bool saveAlphaColorImage(const std::string &name, Imagine::AlphaColor *cols, int w, int h, int quality=85)
Save color image with alpha channel.
bool loadAlphaColorImage(const std::string &name, AlphaColor *&acols, int &w, int &h)
Load color image with alpha channel.
int click()
Wait for mouse click in active window.
void showWindow(Window w, int subWin=0)
Show window.
Window openWindow3D(int w, int h, const std::string &windowTitle="Imagine++", int x=-1, int y=-1)
New window for 3D graphics.
FVector< double, 3 > DoublePoint3
Double space point.
Definition: Types.h:19
Window openComplexWindow(int w, int h, const std::string &name="Imagine++", int tabsNb=1, const std::string *tabsNames=0, const WindowType *tabsTypes=0, int x=-1, int y=-1)
New complex window.
bool loadGreyImage(const std::string &name, octet *&g, int &w, int &h)
Load grey image.
void fillCircle(int xc, int yc, int r, const AlphaColor &col, bool xorMode=false)
Filled Circle.
bool saveGreyImage(const std::string &name, const octet *g, int w, int h, int quality=85)
Save grey image.
void showMesh(const Mesh &M, bool reinitCam=true)
Show mesh.
void drawString(int x, int y, const std::string &s, const AlphaColor &col, int fontSize=12, double alpha=0, bool italic=false, bool bold=false, bool underlined=false, bool xorMode=false)
String.
void drawCircle(int xc, int yc, int r, const Color &col, int penWidth=1, bool xorMode=false)
Circle.
void unGetEvent(const Event &ev)
Unget event.
void noRefreshPop()
Norefresh pop.
Definition: Draw.h:413
WindowInternal * Window
Handle to a display window.
Definition: Types.h:48
void noRefreshEnd()
Norefresh end.
void endGraphics()
Terminate graphics application.
void drawRect(int x, int y, int w, int h, const Color &col, int penWidth=1, bool xorMode=false)
Rectangle.
Color capturePoint(int x, int y)
Capture (point).
int anyClick()
Wait for mouse click in any window.
void fillRect(int x, int y, int w, int h, const AlphaColor &col, bool xorMode=false)
Filled rectangle.
bool loadColorImage(const std::string &name, Color *&cols, int &w, int &h)
Load color image.
void fillEllipse(int x, int y, int w, int h, const AlphaColor &col, bool xorMode=false)
Filled Ellipse.
FArray< int, 3 > Triangle
Triangle to insert in a mesh, built from three space point indices.
Definition: Types.h:27
void noRefreshPush()
Norefresh push.
Definition: Draw.h:405
void milliSleep(int msec)
... Pause program for a certain period.
void captureWindow(Color *&cols, int &w, int &h)
Window capture.
void enableMouseTracking(bool en)
Mouse tracking, controlling whether pointer motion triggers an event.
void fillPoly(const int x[], const int y[], int n, const AlphaColor &col, bool xorMode=false)
Filled Polygon.
void clearWindow()
clearWindow.
void setCamera(const DoublePoint3 &pos, const DoublePoint3 &dir, const DoubleVector3 &up)
Sets the camera pose.
void putAlphaColorImage(int x, int y, Imagine::AlphaColor *cols, int w, int h, bool xorMode=false, double fact=1.)
Display color bitmap with alpha channel.
void flushEvents()
Flush event queue, discarding unhandled events.
AlphaColor * convertColorToAlphaColor(const Imagine::Color *cols, int w, int h)
Convert a Color Image to a AlphaColor Image.
void noRefreshBegin()
Norefresh begin.
Coords< 2 > IntPoint2
Plane point with integral coordinates.
Definition: Types.h:17
void putColorImage(int x, int y, const Color *cols, int w, int h, bool xorMode=false, double fact=1.)
Display color bitmap.
void drawArrow(int x1, int y1, int x2, int y2, const AlphaColor &col, int arrowWidth=8, int arrowHeight=5, int style=0, int width=1, bool xorMode=false)
Arrow.
void drawLine(int x1, int y1, int x2, int y2, const Color &col, int penWidth=1, bool xorMode=false)
Line.
WindowType
Type of Window.
Definition: Types.h:42
Image< octet, dim > grey(const Image< T, dim > &I, T m, T M)
Grey level representation.
Definition: IO.h:289
Event info.
Definition: Events.h:69
int key
Key code that triggered the event, if any (only for types EVT_KEY_ON and EVT_KEY_OFF).
Definition: Events.h:78
int subWin
SubWindow where the event occurred.
Definition: Events.h:84
EventType type
Event type.
Definition: Events.h:71
int button
Mouse button (1,2,3) that triggered the event, if any.
Definition: Events.h:75
Window win
Window where the event occurred.
Definition: Events.h:82
EventState state
Keyboard state (bitfield) just before the event occured.
Definition: Events.h:80
IntPoint2 pix
Mouse position (only for EVT_BUT_ON, EVT_BUT_OFF and EVT_MOTION).
Definition: Events.h:73