Visual Servoing Platform
version 3.7.0
Toggle main menu visibility
Loading...
Searching...
No Matches
vpDirectShowGrabber.cpp
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
* DirectShow framegrabber.
32
*
33
* Authors:
34
* Bruno Renier
35
* Anthony Saunier
36
*/
37
38
#include <visp3/core/vpConfig.h>
39
#if (defined(VISP_HAVE_DIRECTSHOW))
40
41
#include <visp3/sensor/vpDirectShowGrabber.h>
42
#include <visp3/sensor/vpDirectShowGrabberImpl.h>
43
44
BEGIN_VISP_NAMESPACE
48
unsigned
int
vpDirectShowGrabber::getHeight
() {
return
grabber->getHeight(); }
49
53
unsigned
int
vpDirectShowGrabber::getWidth
() {
return
grabber->getWidth(); }
54
59
vpDirectShowGrabber::vpDirectShowGrabber
() { grabber =
new
vpDirectShowGrabberImpl(); }
60
64
vpDirectShowGrabber::~vpDirectShowGrabber
() {
delete
grabber; }
69
void
vpDirectShowGrabber::open
() { grabber->open(); }
70
75
void
vpDirectShowGrabber::open
(
vpImage<unsigned char>
&I) { grabber->open(); }
76
81
void
vpDirectShowGrabber::open
(
vpImage<vpRGBa>
&I) { grabber->open(); }
82
91
void
vpDirectShowGrabber::acquire
(
vpImage<unsigned char>
&I) { grabber->acquire(I); }
92
101
void
vpDirectShowGrabber::acquire
(
vpImage<vpRGBa>
&I) { grabber->acquire(I); }
102
106
void
vpDirectShowGrabber::close
() { grabber->close(); }
107
112
unsigned
int
vpDirectShowGrabber::getDeviceNumber
() {
return
grabber->getDeviceNumber(); }
113
120
bool
vpDirectShowGrabber::setDevice
(
unsigned
int
id
) {
return
grabber->setDevice(
id
); }
121
125
void
vpDirectShowGrabber::displayDevices
() { grabber->displayDevices(); }
133
bool
vpDirectShowGrabber::setImageSize
(
unsigned
int
width
,
unsigned
int
height
)
134
{
135
return
grabber->setImageSize(
width
,
height
);
136
}
137
143
bool
vpDirectShowGrabber::setFramerate
(
double
framerate) {
return
grabber->setFramerate(framerate); }
152
bool
vpDirectShowGrabber::setFormat
(
unsigned
int
width
,
unsigned
int
height
,
double
framerate)
153
{
154
return
grabber->setFormat(
width
,
height
, framerate);
155
}
156
/*
157
Get capture format
158
\param width : Pointer to a variable that receives the width in pixel
159
\param height : Pointer to a variable that receives the height in
160
pixel \param framerate : Pointer to a variable that receives the framerate
161
in fps
162
*/
163
void
vpDirectShowGrabber::getFormat
(
unsigned
int
&
width
,
unsigned
int
&
height
,
double
&framerate)
164
{
165
grabber->getFormat(
width
,
height
, framerate);
166
}
167
173
bool
vpDirectShowGrabber::getStreamCapabilities
() {
return
grabber->getStreamCapabilities(); }
174
182
bool
vpDirectShowGrabber::setMediaType
(
int
mediaTypeID) {
return
grabber->setMediaType(mediaTypeID); }
183
184
/*
185
Get current capture MediaType
186
187
\return the current mediaTypeID
188
*/
189
int
vpDirectShowGrabber::getMediaType
() {
return
grabber->getMediaType(); }
190
END_VISP_NAMESPACE
191
#elif !defined(VISP_BUILD_SHARED_LIBS)
192
// Work around to avoid warning: libvisp_sensor.a(vpDirectShowGrabber.cpp.o)
193
// has no symbols
194
void
dummy_vpDirectShowGrabber() { }
195
#endif
vpDirectShowGrabber::getWidth
unsigned int getWidth()
Definition
vpDirectShowGrabber.cpp:53
vpDirectShowGrabber::~vpDirectShowGrabber
virtual ~vpDirectShowGrabber()
Definition
vpDirectShowGrabber.cpp:64
vpDirectShowGrabber::vpDirectShowGrabber
vpDirectShowGrabber()
Definition
vpDirectShowGrabber.cpp:59
vpDirectShowGrabber::acquire
void acquire(vpImage< unsigned char > &I)
Definition
vpDirectShowGrabber.cpp:91
vpDirectShowGrabber::getHeight
unsigned int getHeight()
Definition
vpDirectShowGrabber.cpp:48
vpDirectShowGrabber::displayDevices
void displayDevices()
Definition
vpDirectShowGrabber.cpp:125
vpDirectShowGrabber::getFormat
void getFormat(unsigned int &width, unsigned int &height, double &framerate)
Definition
vpDirectShowGrabber.cpp:163
vpDirectShowGrabber::open
void open()
Definition
vpDirectShowGrabber.cpp:69
vpDirectShowGrabber::setDevice
bool setDevice(unsigned int id)
Definition
vpDirectShowGrabber.cpp:120
vpDirectShowGrabber::getDeviceNumber
unsigned int getDeviceNumber()
Definition
vpDirectShowGrabber.cpp:112
vpDirectShowGrabber::getStreamCapabilities
bool getStreamCapabilities()
Definition
vpDirectShowGrabber.cpp:173
vpDirectShowGrabber::setImageSize
bool setImageSize(unsigned int width, unsigned int height)
Definition
vpDirectShowGrabber.cpp:133
vpDirectShowGrabber::setMediaType
bool setMediaType(int mediaTypeID)
Definition
vpDirectShowGrabber.cpp:182
vpDirectShowGrabber::setFramerate
bool setFramerate(double framerate)
Definition
vpDirectShowGrabber.cpp:143
vpDirectShowGrabber::getMediaType
int getMediaType()
Definition
vpDirectShowGrabber.cpp:189
vpDirectShowGrabber::setFormat
bool setFormat(unsigned int width, unsigned int height, double framerate)
Definition
vpDirectShowGrabber.cpp:152
vpDirectShowGrabber::close
void close()
Definition
vpDirectShowGrabber.cpp:106
vpFrameGrabber::height
unsigned int height
Number of rows in the image.
Definition
vpFrameGrabber.h:139
vpFrameGrabber::width
unsigned int width
Number of columns in the image.
Definition
vpFrameGrabber.h:140
vpImage
Definition of the vpImage class member functions.
Definition
vpImage.h:131
BEGIN_VISP_NAMESPACE
Definition
vpMbtDistanceCircle.cpp:55
modules
sensor
src
framegrabber
directshow
vpDirectShowGrabber.cpp
Generated by
1.17.0