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 4323 2013-07-18 09:24:01Z 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
#include <visp/vpDisplay.h>
48
#if ( defined(VISP_HAVE_GTK) )
49
50
#include <visp/vpImage.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
GdkColor **col ;
160
int
ncol, nrow ;
161
162
typedef
enum
{
163
id_black=0,
164
id_white,
165
id_lightGray,
166
id_gray,
167
id_darkGray,
168
id_lightRed,
169
id_red,
170
id_darkRed,
171
id_lightGreen,
172
id_green,
173
id_darkGreen,
174
id_lightBlue,
175
id_blue,
176
id_darkBlue,
177
id_yellow,
178
id_cyan,
179
id_orange,
180
id_purple,
181
id_npredefined
// Number of predefined colors
182
} vpColorIdentifier;
183
184
public
:
185
vpDisplayGTK
() ;
186
vpDisplayGTK
(
int
winx,
int
winy,
const
char
*title=NULL) ;
187
vpDisplayGTK
(
vpImage<unsigned char>
&I,
int
winx=-1,
int
winy=-1,
188
const
char
*title=NULL) ;
189
vpDisplayGTK
(
vpImage<vpRGBa>
&I,
int
winx=-1,
int
winy=-1,
190
const
char
*title=NULL) ;
191
192
virtual
~
vpDisplayGTK
() ;
193
194
void
init
(
vpImage<unsigned char>
&I,
195
int
winx=-1,
int
winy=-1,
196
const
char
*title=NULL) ;
197
void
init
(
vpImage<vpRGBa>
&I,
198
int
winx=-1,
int
winy=-1,
199
const
char
*title=NULL) ;
200
201
void
init
(
unsigned
int
width,
unsigned
int
height,
202
int
winx=-1,
int
winy=-1 ,
203
const
char
*title=NULL) ;
204
205
unsigned
int
getScreenDepth();
206
void
getScreenSize(
unsigned
int
&width,
unsigned
int
&height);
207
void
getImage
(
vpImage<vpRGBa>
&I) ;
208
209
protected
:
210
211
void
setFont
(
const
char
*font );
212
void
setTitle
(
const
char
*title) ;
213
void
setWindowPosition
(
int
winx,
int
winy);
214
215
void
clearDisplay
(
const
vpColor
&color=
vpColor::white
) ;
216
217
void
closeDisplay
() ;
218
219
void
displayArrow
(
const
vpImagePoint
&ip1,
220
const
vpImagePoint
&ip2,
221
const
vpColor
&color=
vpColor::white
,
222
unsigned
int
w=4,
unsigned
int
h=2,
223
unsigned
int
thickness=1) ;
224
void
displayCharString
(
const
vpImagePoint
&ip,
const
char
*text,
225
const
vpColor
&color=
vpColor::green
) ;
226
227
void
displayCircle
(
const
vpImagePoint
¢er,
unsigned
int
radius,
228
const
vpColor
&color,
229
bool
fill =
false
,
230
unsigned
int
thickness=1);
231
void
displayCross
(
const
vpImagePoint
&ip,
unsigned
int
size,
232
const
vpColor
&color,
unsigned
int
thickness=1) ;
233
void
displayDotLine
(
const
vpImagePoint
&ip1,
234
const
vpImagePoint
&ip2,
235
const
vpColor
&color,
unsigned
int
thickness=1) ;
236
237
void
displayImage
(
const
vpImage<vpRGBa>
&I) ;
238
void
displayImage
(
const
vpImage<unsigned char>
&I) ;
239
void
displayImage
(
const
unsigned
char
*I) ;
240
241
void
displayImageROI
(
const
vpImage<unsigned char>
&I,
const
vpImagePoint
&iP,
const
unsigned
int
width,
const
unsigned
int
height);
242
void
displayImageROI
(
const
vpImage<vpRGBa>
&I,
const
vpImagePoint
&iP,
const
unsigned
int
width,
const
unsigned
int
height);
243
244
void
displayLine
(
const
vpImagePoint
&ip1,
245
const
vpImagePoint
&ip2,
246
const
vpColor
&color,
unsigned
int
thickness=1) ;
247
248
void
displayPoint
(
const
vpImagePoint
&ip,
const
vpColor
&color) ;
249
void
displayRectangle
(
const
vpImagePoint
&topLeft,
250
unsigned
int
width,
unsigned
int
height,
251
const
vpColor
&color,
bool
fill =
false
,
252
unsigned
int
thickness=1) ;
253
void
displayRectangle
(
const
vpImagePoint
&topLeft,
254
const
vpImagePoint
&bottomRight,
255
const
vpColor
&color,
bool
fill =
false
,
256
unsigned
int
thickness=1) ;
257
void
displayRectangle
(
const
vpRect
&rectangle,
258
const
vpColor
&color,
bool
fill =
false
,
259
unsigned
int
thickness=1) ;
260
261
void
flushDisplay
() ;
262
void
flushDisplayROI
(
const
vpImagePoint
&iP,
const
unsigned
int
width,
const
unsigned
int
height) ;
263
264
bool
getClick
(
bool
blocking=
true
) ;
265
bool
getClick
(
vpImagePoint
&ip,
bool
blocking=
true
) ;
266
bool
getClick
(
vpImagePoint
&ip,
267
vpMouseButton::vpMouseButtonType
& button,
268
bool
blocking=
true
) ;
269
bool
getClickUp
(
vpImagePoint
&ip,
270
vpMouseButton::vpMouseButtonType
& button,
271
bool
blocking=
true
) ;
272
bool
getKeyboardEvent
(
bool
blocking=
true
);
273
bool
getKeyboardEvent
(
char
*
string
,
bool
blocking=
true
);
274
bool
getPointerMotionEvent
(
vpImagePoint
&ip);
275
bool
getPointerPosition
(
vpImagePoint
&ip);
276
277
inline
unsigned
int
getWidth
()
const
{
return
width
; }
278
inline
unsigned
int
getHeight
()
const
{
return
height
; }
279
} ;
280
281
#endif
282
#endif
283
284
/*
285
* Local variables:
286
* c-basic-offset: 2
287
* End:
288
*/
src
device
display
vpDisplayGTK.h
Generated on Fri Sep 27 2013 21:09:14 for ViSP by
1.8.4