ViSP
Main Page
Related Pages
Modules
Classes
Examples
All
Classes
Functions
Variables
Enumerations
Enumerator
Friends
Groups
Pages
vpDisplayGTK.h
1
/****************************************************************************
2
*
3
* $Id: vpDisplayGTK.h 4056 2013-01-05 13:04:42Z fspindle $
4
*
5
* This file is part of the ViSP software.
6
* Copyright (C) 2005 - 2013 by INRIA. All rights reserved.
7
*
8
* This software is free software; you can redistribute it and/or
9
* modify it under the terms of the GNU General Public License
10
* ("GPL") version 2 as published by the Free Software Foundation.
11
* See the file LICENSE.txt at the root directory of this source
12
* distribution for additional information about the GNU GPL.
13
*
14
* For using ViSP with software that can not be combined with the GNU
15
* GPL, please contact INRIA about acquiring a ViSP Professional
16
* Edition License.
17
*
18
* See http://www.irisa.fr/lagadic/visp/visp.html for more information.
19
*
20
* This software was developed at:
21
* INRIA Rennes - Bretagne Atlantique
22
* Campus Universitaire de Beaulieu
23
* 35042 Rennes Cedex
24
* France
25
* http://www.irisa.fr/lagadic
26
*
27
* If you have questions regarding the use of this file, please contact
28
* INRIA at visp@inria.fr
29
*
30
* This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
31
* WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
32
*
33
*
34
* Description:
35
* Image display.
36
*
37
* Authors:
38
* Christophe Collewet
39
* Eric Marchand
40
*
41
*****************************************************************************/
42
43
#ifndef vpDisplayGTK_h
44
#define vpDisplayGTK_h
45
46
#include <visp/vpConfig.h>
47
#if ( defined(VISP_HAVE_GTK) )
48
49
#include <visp/vpImage.h>
50
#include <visp/vpDisplay.h>
51
52
#include <gtk/gtk.h>
53
#include <gdk/gdkrgb.h>
54
55
145
class
VISP_EXPORT
vpDisplayGTK
:
public
vpDisplay
146
{
147
private
:
149
GtkWidget *widget;
150
GdkPixmap *background;
151
GdkGC *gc;
152
GdkColor blue,red,yellow,green,cyan,orange,white, black, gdkcolor,
153
lightBlue, darkBlue, lightRed, darkRed,lightGreen, darkGreen,
154
purple, lightGray, gray, darkGray;
155
GdkColormap *colormap;
156
157
GdkFont *Police1,*Police2;
158
guchar *vectgtk;
159
int
windowXPosition
;
int
windowYPosition
;
160
GdkColor **col ;
161
int
ncol, nrow ;
162
163
typedef
enum
{
164
id_black=0,
165
id_white,
166
id_lightGray,
167
id_gray,
168
id_darkGray,
169
id_lightRed,
170
id_red,
171
id_darkRed,
172
id_lightGreen,
173
id_green,
174
id_darkGreen,
175
id_lightBlue,
176
id_blue,
177
id_darkBlue,
178
id_yellow,
179
id_cyan,
180
id_orange,
181
id_purple,
182
id_npredefined
// Number of predefined colors
183
} vpColorIdentifier;
184
185
public
:
186
vpDisplayGTK
() ;
187
vpDisplayGTK
(
int
winx,
int
winy,
const
char
*title=NULL) ;
188
vpDisplayGTK
(
vpImage<unsigned char>
&I,
int
winx=-1,
int
winy=-1,
189
const
char
*title=NULL) ;
190
vpDisplayGTK
(
vpImage<vpRGBa>
&I,
int
winx=-1,
int
winy=-1,
191
const
char
*title=NULL) ;
192
193
virtual
~
vpDisplayGTK
() ;
194
195
void
init
(
vpImage<unsigned char>
&I,
196
int
winx=-1,
int
winy=-1,
197
const
char
*title=NULL) ;
198
void
init
(
vpImage<vpRGBa>
&I,
199
int
winx=-1,
int
winy=-1,
200
const
char
*title=NULL) ;
201
202
void
init
(
unsigned
int
width,
unsigned
int
height,
203
int
winx=-1,
int
winy=-1 ,
204
const
char
*title=NULL) ;
205
206
unsigned
int
getScreenDepth();
207
void
getScreenSize(
unsigned
int
&width,
unsigned
int
&height);
208
void
getImage
(
vpImage<vpRGBa>
&I) ;
209
210
protected
:
211
212
void
setFont
(
const
char
*font );
213
void
setTitle
(
const
char
*title) ;
214
void
setWindowPosition
(
int
winx,
int
winy);
215
216
void
clearDisplay
(
const
vpColor
&color=
vpColor::white
) ;
217
218
void
closeDisplay
() ;
219
220
void
displayArrow
(
const
vpImagePoint
&ip1,
221
const
vpImagePoint
&ip2,
222
const
vpColor
&color=
vpColor::white
,
223
unsigned
int
w=4,
unsigned
int
h=2,
224
unsigned
int
thickness=1) ;
225
void
displayCharString
(
const
vpImagePoint
&ip,
const
char
*text,
226
const
vpColor
&color=
vpColor::green
) ;
227
228
void
displayCircle
(
const
vpImagePoint
¢er,
unsigned
int
radius,
229
const
vpColor
&color,
230
bool
fill =
false
,
231
unsigned
int
thickness=1);
232
void
displayCross
(
const
vpImagePoint
&ip,
unsigned
int
size,
233
const
vpColor
&color,
unsigned
int
thickness=1) ;
234
void
displayDotLine
(
const
vpImagePoint
&ip1,
235
const
vpImagePoint
&ip2,
236
const
vpColor
&color,
unsigned
int
thickness=1) ;
237
238
void
displayImage
(
const
vpImage<vpRGBa>
&I) ;
239
void
displayImage
(
const
vpImage<unsigned char>
&I) ;
240
void
displayImage
(
const
unsigned
char
*I) ;
241
242
void
displayImageROI
(
const
vpImage<unsigned char>
&I,
const
vpImagePoint
&iP,
const
unsigned
int
width,
const
unsigned
int
height);
243
void
displayImageROI
(
const
vpImage<vpRGBa>
&I,
const
vpImagePoint
&iP,
const
unsigned
int
width,
const
unsigned
int
height);
244
245
void
displayLine
(
const
vpImagePoint
&ip1,
246
const
vpImagePoint
&ip2,
247
const
vpColor
&color,
unsigned
int
thickness=1) ;
248
249
void
displayPoint
(
const
vpImagePoint
&ip,
const
vpColor
&color) ;
250
void
displayRectangle
(
const
vpImagePoint
&topLeft,
251
unsigned
int
width,
unsigned
int
height,
252
const
vpColor
&color,
bool
fill =
false
,
253
unsigned
int
thickness=1) ;
254
void
displayRectangle
(
const
vpImagePoint
&topLeft,
255
const
vpImagePoint
&bottomRight,
256
const
vpColor
&color,
bool
fill =
false
,
257
unsigned
int
thickness=1) ;
258
void
displayRectangle
(
const
vpRect
&rectangle,
259
const
vpColor
&color,
bool
fill =
false
,
260
unsigned
int
thickness=1) ;
261
262
void
flushDisplay
() ;
263
void
flushDisplayROI
(
const
vpImagePoint
&iP,
const
unsigned
int
width,
const
unsigned
int
height) ;
264
265
bool
getClick
(
bool
blocking=
true
) ;
266
bool
getClick
(
vpImagePoint
&ip,
bool
blocking=
true
) ;
267
bool
getClick
(
vpImagePoint
&ip,
268
vpMouseButton::vpMouseButtonType
& button,
269
bool
blocking=
true
) ;
270
bool
getClickUp
(
vpImagePoint
&ip,
271
vpMouseButton::vpMouseButtonType
& button,
272
bool
blocking=
true
) ;
273
bool
getKeyboardEvent
(
bool
blocking=
true
);
274
bool
getKeyboardEvent
(
char
*
string
,
bool
blocking=
true
);
275
bool
getPointerMotionEvent
(
vpImagePoint
&ip);
276
bool
getPointerPosition
(
vpImagePoint
&ip);
277
278
inline
unsigned
int
getWidth
()
const
{
return
width
; }
279
inline
unsigned
int
getHeight
()
const
{
return
height
; }
280
} ;
281
282
#endif
283
#endif
284
285
/*
286
* Local variables:
287
* c-basic-offset: 2
288
* End:
289
*/
src
device
display
vpDisplayGTK.h
Generated on Fri Apr 26 2013 19:54:33 for ViSP by
1.8.1.2