ViSP  2.10.0
vpDiskGrabber.h
1 /****************************************************************************
2  *
3  * $Id: vpDiskGrabber.h 4574 2014-01-09 08:48:51Z fspindle $
4  *
5  * This file is part of the ViSP software.
6  * Copyright (C) 2005 - 2014 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  * Disk framegrabber.
36  *
37  * Authors:
38  * Eric Marchand
39  *
40  *****************************************************************************/
41 
42 
47 #ifndef vpDiskGrabber_hh
48 #define vpDiskGrabber_hh
49 
50 #include <visp/vpImageIo.h>
51 #include <visp/vpFrameGrabber.h>
52 #include <visp/vpRGBa.h>
53 #include <visp/vpDebug.h>
54 
110 class VISP_EXPORT vpDiskGrabber : public vpFrameGrabber
111 {
112 private:
113  long image_number ;
114  int image_step ;
115  unsigned int number_of_zero ;
116 
117  char directory[FILENAME_MAX] ;
118  char base_name[FILENAME_MAX] ;
119  char extension[FILENAME_MAX] ;
120 
121  bool useGenericName;
122  char genericName[FILENAME_MAX];
123 
124 public:
125  vpDiskGrabber();
126  vpDiskGrabber(const char *genericName);
127  vpDiskGrabber(const char *dir, const char *basename,
128  long number, int step, unsigned int noz,
129  const char *ext) ;
130  virtual ~vpDiskGrabber() ;
131 
132  void open(vpImage<unsigned char> &I) ;
133  void open(vpImage<vpRGBa> &I) ;
134  void open(vpImage<float> &I) ;
135 
137  void acquire(vpImage<vpRGBa> &I);
138  void acquire(vpImage<float> &I) ;
139  void acquire(vpImage<unsigned char> &I, long image_number);
140  void acquire(vpImage<vpRGBa> &I, long image_number);
141  void acquire(vpImage<float> &I, long image_number) ;
142 
143  void close();
144 
145  void setDirectory(const char *dir);
146  void setBaseName(const char *name);
147  void setImageNumber(long number) ;
148  void setStep(int a);
149  void setNumberOfZero(unsigned int noz);
150  void setExtension(const char *ext);
151  void setGenericName(const char *genericName);
152 
156  long getImageNumber() { return image_number; };
157 } ;
158 
159 #endif
160 
virtual void open(vpImage< unsigned char > &I)=0
Class to grab (ie. read) images from the disk.
Base class for all video devices. It is designed to provide a front end to video sources.
long getImageNumber()
virtual void close()=0
virtual void acquire(vpImage< unsigned char > &I)=0