ViSP
Main Page
Related Pages
Modules
Classes
Examples
All
Classes
Functions
Variables
Enumerations
Enumerator
Friends
Groups
Pages
vpDisplayWin32.h
1
/****************************************************************************
2
*
3
* $Id: vpDisplayWin32.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
* Windows 32 display base class
36
*
37
* Authors:
38
* Bruno Renier
39
*
40
*****************************************************************************/
41
42
#include <visp/vpConfig.h>
43
44
#if ( defined(VISP_HAVE_GDI) || defined(VISP_HAVE_D3D9) )
45
46
#ifndef vpDisplayWin32_hh
47
#define vpDisplayWin32_hh
48
49
#include <visp/vpImage.h>
50
#include <visp/vpDisplay.h>
51
#include <windows.h>
52
#include <visp/vpWin32Window.h>
53
#include <visp/vpWin32Renderer.h>
54
#include <visp/vpRect.h>
55
#include <visp/vpImagePoint.h>
56
57
#ifndef DOXYGEN_SHOULD_SKIP_THIS
58
61
struct
threadParam
62
{
64
vpDisplayWin32
* vpDisp;
65
67
int
x;
68
70
int
y;
71
73
unsigned
int
w;
74
76
unsigned
int
h;
77
79
char
* title;
80
};
81
#endif
/* DOXYGEN_SHOULD_SKIP_THIS */
82
95
class
VISP_EXPORT
vpDisplayWin32
:
public
vpDisplay
96
{
97
protected
:
99
static
const
int
MAX_INIT_DELAY
;
100
102
HANDLE
hThread
;
103
105
DWORD
threadId
;
106
108
bool
iStatus
;
109
111
vpWin32Window
window
;
112
114
RECT
roi
;
115
117
friend
void
vpCreateWindow(threadParam * param);
118
119
public
:
120
121
vpDisplayWin32
(vpWin32Renderer * rend = NULL);
122
123
vpDisplayWin32
(
vpImage<vpRGBa>
&I,
124
int
winx=-1,
int
winy=-1,
125
const
char
*title=NULL);
126
127
vpDisplayWin32
(
vpImage<unsigned char>
&I,
128
int
winx=-1,
int
winy=-1,
129
const
char
*title=NULL);
130
131
virtual
~
vpDisplayWin32
();
132
133
void
setTitle
(
const
char
*windowtitle);
134
void
setFont
(
const
char
*fontname );
135
void
setWindowPosition
(
int
winx,
int
winy);
136
void
clearDisplay
(
const
vpColor
&color=
vpColor::white
);
137
void
closeDisplay
();
138
void
displayImage
(
const
vpImage<vpRGBa>
&I);
139
void
displayImage
(
const
vpImage<unsigned char>
&I);
140
141
void
displayImageROI
(
const
vpImage<unsigned char>
&I,
const
vpImagePoint
&iP,
const
unsigned
int
width,
const
unsigned
int
height);
142
void
displayImageROI
(
const
vpImage<vpRGBa>
&I,
const
vpImagePoint
&iP,
const
unsigned
int
width,
const
unsigned
int
height);
143
144
void
flushDisplay
();
145
void
flushDisplayROI
(
const
vpImagePoint
&iP,
const
unsigned
int
width,
const
unsigned
int
height);
146
147
void
init
(
vpImage<unsigned char>
&I,
148
int
winx=-1,
int
winy=-1,
149
const
char
*title=NULL) ;
150
151
void
init
(
vpImage<vpRGBa>
&I,
152
int
winx=-1,
int
winy=-1,
153
const
char
*title=NULL) ;
154
155
void
init
(
unsigned
int
width,
unsigned
int
height,
156
int
winx=-1,
int
winy=-1 ,
157
const
char
*title=NULL) ;
158
159
void
getImage
(
vpImage<vpRGBa>
&I);
160
161
protected
:
162
163
void
displayArrow
(
const
vpImagePoint
&ip1,
164
const
vpImagePoint
&ip2,
165
const
vpColor
&color=
vpColor::white
,
166
unsigned
int
w=4,
unsigned
int
h=2,
167
unsigned
int
thickness=1) ;
168
169
void
displayCharString
(
const
vpImagePoint
&ip,
const
char
*text,
170
const
vpColor
&color=
vpColor::green
) ;
171
172
void
displayCircle
(
const
vpImagePoint
¢er,
unsigned
int
radius,
173
const
vpColor
&color,
174
bool
fill =
false
,
175
unsigned
int
thickness=1);
176
177
void
displayCross
(
const
vpImagePoint
&ip,
unsigned
int
size,
178
const
vpColor
&color,
unsigned
int
thickness=1) ;
179
180
void
displayDotLine
(
const
vpImagePoint
&ip1,
181
const
vpImagePoint
&ip2,
182
const
vpColor
&color,
unsigned
int
thickness=1) ;
183
184
void
displayLine
(
const
vpImagePoint
&ip1,
185
const
vpImagePoint
&ip2,
186
const
vpColor
&color,
unsigned
int
thickness=1);
187
188
189
void
displayPoint
(
const
vpImagePoint
&ip,
const
vpColor
&color);
190
191
void
displayRectangle
(
const
vpImagePoint
&topLeft,
192
unsigned
int
width,
unsigned
int
height,
193
const
vpColor
&color,
bool
fill =
false
,
194
unsigned
int
thickness=1);
195
void
displayRectangle
(
const
vpImagePoint
&topLeft,
196
const
vpImagePoint
&bottomRight,
197
const
vpColor
&color,
bool
fill =
false
,
198
unsigned
int
thickness=1) ;
199
void
displayRectangle
(
const
vpRect
&rectangle,
200
const
vpColor
&color,
bool
fill =
false
,
201
unsigned
int
thickness=1) ;
202
203
bool
getClick
(
bool
blocking=
true
);
204
205
bool
getClick
(
vpImagePoint
&ip,
bool
blocking=
true
);
206
207
bool
getClick
(
vpImagePoint
&ip,
208
vpMouseButton::vpMouseButtonType
& button,
bool
blocking=
true
);
209
210
bool
getClickUp
(
vpImagePoint
&ip,
211
vpMouseButton::vpMouseButtonType
& button,
212
bool
blocking=
true
);
213
bool
getKeyboardEvent
(
bool
blocking=
true
);
214
bool
getKeyboardEvent
(
char
*
string
,
bool
blocking);
215
bool
getPointerMotionEvent
(
vpImagePoint
&ip);
216
bool
getPointerPosition
(
vpImagePoint
&ip);
217
218
void
waitForInit();
219
220
};
221
#endif
222
#endif
223
src
device
display
windows
vpDisplayWin32.h
Generated on Thu Nov 7 2013 03:14:01 for ViSP by
1.8.4