Visual Servoing Platform  version 3.0.0
vpDiskGrabber.h
1 /****************************************************************************
2  *
3  * This file is part of the ViSP software.
4  * Copyright (C) 2005 - 2015 by Inria. All rights reserved.
5  *
6  * This software is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * ("GPL") version 2 as published by the Free Software Foundation.
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 http://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  * Disk framegrabber.
32  *
33  * Authors:
34  * Eric Marchand
35  *
36  *****************************************************************************/
37 
38 
43 #ifndef vpDiskGrabber_hh
44 #define vpDiskGrabber_hh
45 
46 #include <visp3/io/vpImageIo.h>
47 #include <visp3/core/vpFrameGrabber.h>
48 #include <visp3/core/vpRGBa.h>
49 #include <visp3/core/vpDebug.h>
50 
106 class VISP_EXPORT vpDiskGrabber : public vpFrameGrabber
107 {
108 private:
109  long image_number ;
110  int image_step ;
111  unsigned int number_of_zero ;
112 
113  char directory[FILENAME_MAX] ;
114  char base_name[FILENAME_MAX] ;
115  char extension[FILENAME_MAX] ;
116 
117  bool useGenericName;
118  char genericName[FILENAME_MAX];
119 
120 public:
121  vpDiskGrabber();
122  vpDiskGrabber(const char *genericName);
123  vpDiskGrabber(const char *dir, const char *basename,
124  long number, int step, unsigned int noz,
125  const char *ext) ;
126  virtual ~vpDiskGrabber() ;
127 
128  void open(vpImage<unsigned char> &I) ;
129  void open(vpImage<vpRGBa> &I) ;
130  void open(vpImage<float> &I) ;
131 
133  void acquire(vpImage<vpRGBa> &I);
134  void acquire(vpImage<float> &I) ;
135  void acquire(vpImage<unsigned char> &I, long image_number);
136  void acquire(vpImage<vpRGBa> &I, long image_number);
137  void acquire(vpImage<float> &I, long image_number) ;
138 
139  void close();
140 
141  void setDirectory(const char *dir);
142  void setBaseName(const char *name);
143  void setImageNumber(long number) ;
144  void setStep(int a);
145  void setNumberOfZero(unsigned int noz);
146  void setExtension(const char *ext);
147  void setGenericName(const char *genericName);
148 
152  long getImageNumber() { return image_number; };
153 } ;
154 
155 #endif
156 
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