Fawkes API
Fawkes Development Version
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
All
Classes
Namespaces
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Groups
Pages
fileloader.h
1
2
/***************************************************************************
3
* fileloader.h - A camera which obtains its images from a single image
4
* file or from several image files in a directory
5
*
6
* Generated: Tue Mar 2 12:26:44 2005
7
* Copyright 2005 Tim Niemueller [www.niemueller.de]
8
* 2008 Daniel Beck
9
*
10
****************************************************************************/
11
12
/* This program is free software; you can redistribute it and/or modify
13
* it under the terms of the GNU General Public License as published by
14
* the Free Software Foundation; either version 2 of the License, or
15
* (at your option) any later version. A runtime exception applies to
16
* this software (see LICENSE.GPL_WRE file mentioned below for details).
17
*
18
* This program is distributed in the hope that it will be useful,
19
* but WITHOUT ANY WARRANTY; without even the implied warranty of
20
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
* GNU Library General Public License for more details.
22
*
23
* Read the full text in the LICENSE.GPL_WRE file in the doc directory.
24
*/
25
26
#ifndef __FIREVISION_CAMS_FILELOADER_H_
27
#define __FIREVISION_CAMS_FILELOADER_H_
28
29
#include <fvcams/camera.h>
30
#include <dirent.h>
31
32
namespace
firevision {
33
#if 0
/* just to make Emacs auto-indent happy */
34
}
35
#endif
36
37
class
CameraArgumentParser;
38
39
class
FileLoader
:
public
Camera
40
{
41
#if defined(__GLIBC__) || defined(__FreeBSD__)
42
friend
int
file_select(
const
struct
dirent*);
43
#else
44
friend
int
file_select(
struct
dirent*);
45
#endif
46
47
public
:
48
49
FileLoader
(
const
char
*filename);
50
FileLoader
(colorspace_t cspace,
const
char
* filename,
unsigned
int
width,
unsigned
int
height);
51
FileLoader
(
const
CameraArgumentParser
*cap);
52
~
FileLoader
();
53
54
virtual
void
open();
55
virtual
void
start();
56
virtual
void
stop();
57
virtual
void
close();
58
virtual
void
capture();
59
virtual
void
flush();
60
61
virtual
bool
ready();
62
63
virtual
void
print_info();
64
65
virtual
unsigned
char
* buffer();
66
virtual
unsigned
int
buffer_size();
67
virtual
void
dispose_buffer();
68
69
virtual
unsigned
int
pixel_width();
70
virtual
unsigned
int
pixel_height();
71
virtual
colorspace_t colorspace();
72
73
virtual
void
set_image_number(
unsigned
int
n);
74
75
void
set_colorspace(colorspace_t c);
76
void
set_pixel_width(
unsigned
int
w);
77
void
set_pixel_height(
unsigned
int
h);
78
79
private
:
80
void
read_file();
81
82
bool
started;
83
bool
opened;
84
unsigned
char
* file_buffer;
85
int
_buffer_size;
86
unsigned
int
width;
87
unsigned
int
height;
88
colorspace_t cspace;
89
char
*filename;
90
char
*dirname;
91
static
char
*extension;
92
int
num_files;
93
int
cur_file;
94
struct
dirent **file_list;
95
};
96
97
}
// end namespace firevision
98
99
#endif
src
libs
fvcams
fileloader.h
Generated by
1.8.3.1