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
shmem.h
1
2
/***************************************************************************
3
* shmem.h - This header defines a reader for shared memory images
4
*
5
* Created: Thu Jan 12 19:41:17 2006
6
* Copyright 2005-2009 Tim Niemueller [www.niemueller.de]
7
*
8
****************************************************************************/
9
10
/* This program is free software; you can redistribute it and/or modify
11
* it under the terms of the GNU General Public License as published by
12
* the Free Software Foundation; either version 2 of the License, or
13
* (at your option) any later version. A runtime exception applies to
14
* this software (see LICENSE.GPL_WRE file mentioned below for details).
15
*
16
* This program is distributed in the hope that it will be useful,
17
* but WITHOUT ANY WARRANTY; without even the implied warranty of
18
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
* GNU Library General Public License for more details.
20
*
21
* Read the full text in the LICENSE.GPL_WRE file in the doc directory.
22
*/
23
24
#ifndef __FIREVISION_CAMS_SHMEM_H_
25
#define __FIREVISION_CAMS_SHMEM_H_
26
27
#include <fvcams/camera.h>
28
#include <fvutils/color/colorspaces.h>
29
#include <fvutils/ipc/shm_image.h>
30
31
namespace
firevision {
32
#if 0
/* just to make Emacs auto-indent happy */
33
}
34
#endif
35
36
class
CameraArgumentParser;
37
38
class
SharedMemoryCamera
:
public
Camera
39
{
40
41
public
:
42
43
SharedMemoryCamera
(
const
char
*image_id,
bool
deep_copy =
false
);
44
SharedMemoryCamera
(
const
CameraArgumentParser
*cap);
45
~
SharedMemoryCamera
();
46
47
virtual
void
open();
48
virtual
void
start();
49
virtual
void
stop();
50
virtual
void
close();
51
virtual
void
flush();
52
virtual
void
capture();
53
virtual
void
print_info();
54
55
virtual
bool
ready();
56
57
virtual
unsigned
char
* buffer();
58
virtual
unsigned
int
buffer_size();
59
virtual
void
dispose_buffer();
60
61
virtual
unsigned
int
pixel_width();
62
virtual
unsigned
int
pixel_height();
63
virtual
colorspace_t colorspace();
64
virtual
fawkes::Time
* capture_time();
65
66
virtual
void
set_image_number(
unsigned
int
n);
67
68
SharedMemoryImageBuffer
* shared_memory_image_buffer();
69
70
virtual
void
lock_for_read();
71
virtual
bool
try_lock_for_read();
72
virtual
void
lock_for_write();
73
virtual
bool
try_lock_for_write();
74
virtual
void
unlock();
75
76
private
:
77
void
init();
78
79
bool
__deep_copy;
80
bool
__opened;
81
unsigned
int
__width;
82
unsigned
int
__height;
83
char
* __image_id;
84
85
SharedMemoryImageBuffer
*__shm_buffer;
86
87
unsigned
char
*__deep_buffer;
88
89
fawkes::Time
*__capture_time;
90
};
91
92
}
// end namespace firevision
93
94
#endif
src
libs
fvcams
shmem.h
Generated by
1.8.1.1