Visual Servoing Platform
version 3.7.0
Toggle main menu visibility
Loading...
Searching...
No Matches
vp1394CMUGrabber.h
1
/*
2
* ViSP, open source Visual Servoing Platform software.
3
* Copyright (C) 2005 - 2025 by Inria. All rights reserved.
4
*
5
* This software is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation; either version 2 of the License, or
8
* (at your option) any later version.
9
* See the file LICENSE.txt at the root directory of this source
10
* distribution for additional information about the GNU GPL.
11
*
12
* For using ViSP with software that can not be combined with the GNU
13
* GPL, please contact Inria about acquiring a ViSP Professional
14
* Edition License.
15
*
16
* See https://visp.inria.fr for more information.
17
*
18
* This software was developed at:
19
* Inria Rennes - Bretagne Atlantique
20
* Campus Universitaire de Beaulieu
21
* 35042 Rennes Cedex
22
* France
23
*
24
* If you have questions regarding the use of this file, please contact
25
* Inria at visp@inria.fr
26
*
27
* This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
28
* WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
29
*
30
* Description:
31
* Firewire cameras video capture based on CMU 1394 Digital Camera SDK.
32
*/
33
38
39
#ifndef VP_1394_CMU_GRABBER_H
40
#define VP_1394_CMU_GRABBER_H
41
42
#include <visp3/core/vpConfig.h>
43
44
#ifdef VISP_HAVE_CMU1394
45
46
// Include WinSock2.h before windows.h to ensure that winsock.h is not
47
// included by windows.h since winsock.h and winsock2.h are incompatible
48
#include <1394Camera.h>
// CMU library
49
50
// Mute warning with clang-cl
51
// warning : non-portable path to file '<WinSock2.h>'; specified path differs in case from file name on disk [-Wnonportable-system-include-path]
52
// warning : non-portable path to file '<Windows.h>'; specified path differs in case from file name on disk [-Wnonportable-system-include-path]
53
#if defined(__clang__)
54
# pragma clang diagnostic push
55
# pragma clang diagnostic ignored "-Wnonportable-system-include-path"
56
#endif
57
58
#include <WinSock2.h>
59
#include <windows.h>
60
61
#if defined(__clang__)
62
# pragma clang diagnostic pop
63
#endif
64
65
#include <visp3/core/vpFrameGrabber.h>
66
#include <visp3/core/vpFrameGrabberException.h>
67
#include <visp3/core/vpImage.h>
68
#include <visp3/core/vpRGBa.h>
69
70
BEGIN_VISP_NAMESPACE
161
162
class
VISP_EXPORT
vp1394CMUGrabber
:
public
vpFrameGrabber
163
{
164
public
:
168
typedef
enum
{
YUV444
,
YUV422
,
YUV411
,
RGB8
,
MONO8
,
MONO16
,
UNKNOWN
} vpColorCodingType;
169
170
private
:
172
C1394Camera *camera;
174
int
index;
176
unsigned
long
_format;
178
unsigned
long
_mode;
180
unsigned
long
_fps;
182
bool
_modeauto;
184
unsigned
short
_gain;
186
unsigned
short
_shutter;
188
vpColorCodingType _color;
189
190
public
:
191
// Constructor.
192
vp1394CMUGrabber
();
193
// Destructor.
194
virtual
~vp1394CMUGrabber
();
195
196
// Acquire one frame in a greyscale image.
197
void
acquire
(
vpImage<unsigned char>
&I);
198
199
// Acquire one frame in a color image.
200
void
acquire
(
vpImage<vpRGBa>
&I);
201
202
// Stop the acquisition.
203
void
close
();
204
205
// Display information about the camera on the standard output.
206
void
displayCameraDescription(
int
cam_id);
207
208
// Display camera model on the standard output. Call it after open the
209
// grabber.
210
void
displayCameraModel();
211
212
// Get the video framerate
213
int
getFramerate();
214
215
// Get the gain min and max values.
216
void
getGainMinMax(
unsigned
short
&min,
unsigned
short
&max);
217
218
// Get the number of connected cameras.
219
int
getNumberOfConnectedCameras()
const
;
220
221
// Get the shutter min and max values.
222
void
getShutterMinMax(
unsigned
short
&min,
unsigned
short
&max);
223
225
vpColorCodingType
getVideoColorCoding
()
const
226
{
227
vpColorCodingType
color =
vp1394CMUGrabber::UNKNOWN
;
228
if
(_format == 0) {
229
switch
(_mode) {
230
case
0:
231
color =
vp1394CMUGrabber::YUV444
;
232
break
;
233
case
1:
234
color =
vp1394CMUGrabber::YUV422
;
235
break
;
236
case
2:
237
color =
vp1394CMUGrabber::YUV411
;
238
break
;
239
case
3:
240
color =
vp1394CMUGrabber::YUV422
;
241
break
;
242
case
4:
243
color =
vp1394CMUGrabber::RGB8
;
244
break
;
245
case
5:
246
color =
vp1394CMUGrabber::MONO8
;
247
break
;
248
case
6:
249
color =
vp1394CMUGrabber::MONO16
;
250
break
;
251
}
252
}
253
else
if
(_format == 1) {
254
switch
(_mode) {
255
case
0:
256
color =
vp1394CMUGrabber::YUV422
;
257
break
;
258
case
1:
259
color =
vp1394CMUGrabber::RGB8
;
260
break
;
261
case
2:
262
color =
vp1394CMUGrabber::MONO8
;
263
break
;
264
case
3:
265
color =
vp1394CMUGrabber::YUV422
;
266
break
;
267
case
4:
268
color =
vp1394CMUGrabber::RGB8
;
269
break
;
270
case
5:
271
color =
vp1394CMUGrabber::MONO8
;
272
break
;
273
case
6:
274
color =
vp1394CMUGrabber::MONO16
;
275
break
;
276
case
7:
277
color =
vp1394CMUGrabber::MONO16
;
278
break
;
279
}
280
}
281
else
if
(_format == 2) {
282
switch
(_mode) {
283
case
0:
284
color =
vp1394CMUGrabber::YUV422
;
285
break
;
286
case
1:
287
color =
vp1394CMUGrabber::RGB8
;
288
break
;
289
case
2:
290
color =
vp1394CMUGrabber::MONO8
;
291
break
;
292
case
3:
293
color =
vp1394CMUGrabber::YUV422
;
294
break
;
295
case
4:
296
color =
vp1394CMUGrabber::RGB8
;
297
break
;
298
case
5:
299
color =
vp1394CMUGrabber::MONO8
;
300
break
;
301
case
6:
302
color =
vp1394CMUGrabber::MONO16
;
303
break
;
304
case
7:
305
color =
vp1394CMUGrabber::MONO16
;
306
break
;
307
}
308
}
309
310
return
color;
311
}
312
313
// Initialization of the grabber using a greyscale image.
314
void
open
(
vpImage<unsigned char>
&I);
315
316
// Initialization of the grabber using a color image.
317
void
open
(
vpImage<vpRGBa>
&I);
318
319
vp1394CMUGrabber
&operator>>(
vpImage<unsigned char>
&I);
320
vp1394CMUGrabber
&operator>>(
vpImage<vpRGBa>
&I);
321
322
// Select the camera on the bus. Call it before open the grabber.
323
void
selectCamera(
int
cam_id);
324
325
// Enable auto gain
326
void
setAutoGain();
327
328
// Enable auto shutter
329
void
setAutoShutter();
330
331
// Set the gain and the shutter values. Call it before open the grabber
332
void
setControl(
unsigned
short
gain,
unsigned
short
shutter);
333
334
// Set the frame rate. Call it before open the grabber.
335
void
setFramerate(
unsigned
long
fps);
336
337
// Set the shutter value. Call it before open the grabber
338
void
setShutter(
unsigned
short
shutter);
339
340
// Set the gain value. Call it before open the grabber
341
void
setGain(
unsigned
short
gain);
342
343
// Set the video format and mode. Call it before open the grabber.
344
void
setVideoMode(
unsigned
long
format,
unsigned
long
mode);
345
346
private
:
347
void
initCamera();
348
};
349
END_VISP_NAMESPACE
350
#endif
351
#endif
vp1394CMUGrabber
Firewire cameras video capture based on CMU 1394 Digital Camera SDK.
Definition
vp1394CMUGrabber.h:163
vp1394CMUGrabber::getVideoColorCoding
vpColorCodingType getVideoColorCoding() const
Get the video color coding format.
Definition
vp1394CMUGrabber.h:225
vp1394CMUGrabber::vp1394CMUGrabber
vp1394CMUGrabber()
Definition
vp1394CMUGrabber.cpp:48
vp1394CMUGrabber::vpColorCodingType
vpColorCodingType
Definition
vp1394CMUGrabber.h:168
vp1394CMUGrabber::UNKNOWN
@ UNKNOWN
Definition
vp1394CMUGrabber.h:168
vp1394CMUGrabber::RGB8
@ RGB8
Definition
vp1394CMUGrabber.h:168
vp1394CMUGrabber::YUV444
@ YUV444
Definition
vp1394CMUGrabber.h:168
vp1394CMUGrabber::YUV422
@ YUV422
Definition
vp1394CMUGrabber.h:168
vp1394CMUGrabber::MONO8
@ MONO8
Definition
vp1394CMUGrabber.h:168
vp1394CMUGrabber::YUV411
@ YUV411
Definition
vp1394CMUGrabber.h:168
vp1394CMUGrabber::MONO16
@ MONO16
Definition
vp1394CMUGrabber.h:168
vpFrameGrabber::open
virtual void open(vpImage< unsigned char > &I)=0
vpFrameGrabber::vpFrameGrabber
vpFrameGrabber()
Definition
vpFrameGrabber.h:114
vpFrameGrabber::acquire
virtual void acquire(vpImage< unsigned char > &I)=0
vpFrameGrabber::close
virtual void close()=0
vpImage
Definition of the vpImage class member functions.
Definition
vpImage.h:131
BEGIN_VISP_NAMESPACE
Definition
vpMbtDistanceCircle.cpp:55
modules
sensor
include
visp3
sensor
vp1394CMUGrabber.h
Generated by
1.17.0