Visual Servoing Platform version 3.7.0
Loading...
Searching...
No Matches
vpDiskGrabber.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 * Disk framegrabber.
32 */
33
38#ifndef VP_DISK_GRABBER_H
39#define VP_DISK_GRABBER_H
40
41#include <string>
42
43#include <visp3/core/vpFrameGrabber.h>
44#include <visp3/core/vpRGBa.h>
45#include <visp3/io/vpImageIo.h>
46
48
108class VISP_EXPORT vpDiskGrabber : public vpFrameGrabber
109{
110private:
111 long m_image_number;
112 long m_image_number_next;
113 long m_image_step;
114 unsigned int m_number_of_zero;
116
117 std::string m_directory;
118 std::string m_base_name;
119 std::string m_extension;
120
121 bool m_use_generic_name;
122 std::string m_generic_name;
123 std::string m_image_name;
124
125public:
130
134 vpDiskGrabber(const vpDiskGrabber &grabber);
135
139 VP_EXPLICIT vpDiskGrabber(const std::string &genericName);
140
145 virtual ~vpDiskGrabber() VP_OVERRIDE { }
146
150 vpDiskGrabber &operator=(const vpDiskGrabber &grabber);
151
162 VP_EXPLICIT vpDiskGrabber(const std::string &dir, const std::string &basename, long number, int step, unsigned int noz,
163 const std::string &ext);
164
171 void acquire(vpImage<unsigned char> &I) VP_OVERRIDE;
172
179 void acquire(vpImage<vpRGBa> &I) VP_OVERRIDE;
180
187 void acquire(vpImage<float> &I);
188
196 void acquire(vpImage<unsigned char> &I, long image_number);
197
205 void acquire(vpImage<vpRGBa> &I, long image_number);
206
214 void acquire(vpImage<float> &I, long image_number);
215
221 void close() VP_OVERRIDE { }
222
226 inline long getImageNumber() const { return m_image_number; }
227
231 inline std::string getImageName() const { return m_image_name; }
232
237 void open(vpImage<unsigned char> &I) VP_OVERRIDE;
238
243 void open(vpImage<vpRGBa> &I) VP_OVERRIDE;
244
249 void open(vpImage<float> &I);
250
254 void setBaseName(const std::string &name) { m_base_name = name; }
255
259 void setDirectory(const std::string &dir) { m_directory = dir; }
260
264 void setExtension(const std::string &ext) { m_extension = ext; }
265
269 void setGenericName(const std::string &genericName);
270
274 void setImageNumber(long number);
275
279 void setNumberOfZero(unsigned int noz) { m_number_of_zero = noz; }
280
284 void setStep(long step) { m_image_step = step; }
285};
286
287END_VISP_NAMESPACE
288
289#endif
Class to grab (ie. read) images from the disk.
void setStep(long step)
void setDirectory(const std::string &dir)
void setExtension(const std::string &ext)
void close() VP_OVERRIDE
std::string getImageName() const
void setNumberOfZero(unsigned int noz)
virtual ~vpDiskGrabber() VP_OVERRIDE
void setBaseName(const std::string &name)
long getImageNumber() const
virtual void open(vpImage< unsigned char > &I)=0
vpFrameGrabber & operator=(const vpFrameGrabber &)=default
virtual void acquire(vpImage< unsigned char > &I)=0
Definition of the vpImage class member functions.
Definition vpImage.h:131