ViSP  2.8.0
vpDirectShowGrabber.h
1 /****************************************************************************
2  *
3  * $Id: vpDirectShowGrabber.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  * DirectShow framegrabber.
36  *
37  * Authors:
38  * Bruno Renier
39  * Anthony Saunier
40  *
41  *****************************************************************************/
42 
43 
44 #ifndef vpDirectShowGrabber_hh
45 #define vpDirectShowGrabber_hh
46 
47 #include <visp/vpConfig.h>
48 #if ( defined(VISP_HAVE_DIRECTSHOW) )
49 
50 #include <visp/vpImage.h>
51 #include <visp/vpRGBa.h>
52 #include <visp/vpFrameGrabber.h>
53 
54 class vpDirectShowGrabberImpl;
55 
67 class VISP_EXPORT vpDirectShowGrabber : public vpFrameGrabber
68 {
69  vpDirectShowGrabberImpl * grabber;
70 
71 
72  public:
73 
74  unsigned int getHeight();
75  unsigned int getWidth();
76 
78  virtual ~vpDirectShowGrabber();
79 
80  void open();
82  void open(vpImage<vpRGBa> &I);
83 
85  void acquire(vpImage<vpRGBa> &I);
86 
87  void close();
88 
89  //get the number of capture devices
90  unsigned int getDeviceNumber();
91 
92  //change the capture device
93  bool setDevice(unsigned int id);
94 
95  //displays a list of available devices
96  void displayDevices();
97 
98  //set image size
99  bool setImageSize(unsigned int width,unsigned int height);
100 
101  //set source framerate
102  bool setFramerate(double framerate);
103 
104 
105  //set capture format
106  bool setFormat(unsigned int width,unsigned int height, double framerate);
107 
108  //get capture format
109  void getFormat(unsigned int &width,unsigned int &height, double &framerate);
110 
111  //Get the available capture formats
112  bool getStreamCapabilities();
113 
114  //Set capture MediaType
115  bool setMediaType(int mediaTypeID);
116 
117  //Get current capture MediaType
118  int getMediaType();
119 
120 };
121 #endif
122 #endif
class for windows direct show devices
virtual void open(vpImage< unsigned char > &I)=0
unsigned int getWidth() const
Return the number of columns in the image.
Base class for all video devices. It is designed to provide a front end to video sources.
virtual void close()=0
virtual void acquire(vpImage< unsigned char > &I)=0
unsigned int getHeight() const
Return the number of rows in the image.