Fawkes API
Fawkes Development Version
depth_thread.h
1
2
/***************************************************************************
3
* depth_thread.h - OpenNI depth provider thread
4
*
5
* Created: Thu Dec 22 11:35:31 2011
6
* Copyright 2006-2011 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.
14
*
15
* This program is distributed in the hope that it will be useful,
16
* but WITHOUT ANY WARRANTY; without even the implied warranty of
17
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
* GNU Library General Public License for more details.
19
*
20
* Read the full text in the LICENSE.GPL file in the doc directory.
21
*/
22
23
#ifndef _PLUGINS_OPENNI_DEPTH_THREAD_H_
24
#define _PLUGINS_OPENNI_DEPTH_THREAD_H_
25
26
#include <aspect/blocked_timing.h>
27
#include <aspect/clock.h>
28
#include <aspect/configurable.h>
29
#include <aspect/logging.h>
30
#include <core/threading/thread.h>
31
#include <core/utils/lockptr.h>
32
#include <plugins/openni/aspect/openni.h>
33
34
// OpenNI relies on GNU extension to detect Linux
35
#if defined(__linux__) && not defined(linux)
36
# define linux true
37
#endif
38
#if defined(__i386__) && not defined(i386)
39
# define i386 true
40
#endif
41
#include <XnCppWrapper.h>
42
43
namespace
firevision {
44
class
SharedMemoryImageBuffer;
45
}
46
47
class
OpenNiDepthThread
:
public
fawkes::Thread
,
48
public
fawkes::BlockedTimingAspect
,
49
public
fawkes::LoggingAspect
,
50
public
fawkes::ConfigurableAspect
,
51
public
fawkes::ClockAspect
,
52
public
fawkes::OpenNiAspect
53
{
54
public
:
55
OpenNiDepthThread
();
56
virtual
~OpenNiDepthThread
();
57
58
virtual
void
init
();
59
virtual
void
loop
();
60
virtual
void
finalize
();
61
62
/** Stub to see name in backtrace for easier debugging. @see Thread::run() */
63
protected
:
64
virtual
void
65
run
()
66
{
67
Thread::run();
68
}
69
70
private
:
71
xn::DepthGenerator *depth_gen_;
72
xn::DepthMetaData * depth_md_;
73
74
firevision::SharedMemoryImageBuffer
*depth_buf_;
75
76
size_t
depth_bufsize_;
77
unsigned
int
depth_width_;
78
unsigned
int
depth_height_;
79
80
fawkes::Time
*capture_start_;
81
};
82
83
#endif
fawkes::BlockedTimingAspect
Definition:
blocked_timing.h:54
firevision::SharedMemoryImageBuffer
Definition:
shm_image.h:182
OpenNiDepthThread::OpenNiDepthThread
OpenNiDepthThread()
Constructor.
Definition:
depth_thread.cpp:45
OpenNiDepthThread::~OpenNiDepthThread
virtual ~OpenNiDepthThread()
Destructor.
Definition:
depth_thread.cpp:52
OpenNiDepthThread::finalize
virtual void finalize()
Finalize the thread.
Definition:
depth_thread.cpp:98
fawkes::OpenNiAspect
Definition:
openni.h:37
OpenNiDepthThread
Definition:
depth_thread.h:46
OpenNiDepthThread::loop
virtual void loop()
Code to execute in the thread.
Definition:
depth_thread.cpp:109
fawkes::LoggingAspect
Definition:
logging.h:36
fawkes::Time
Definition:
time.h:96
OpenNiDepthThread::init
virtual void init()
Initialize the thread.
Definition:
depth_thread.cpp:57
fawkes::Thread
Definition:
thread.h:44
OpenNiDepthThread::run
virtual void run()
Stub to see name in backtrace for easier debugging.
Definition:
depth_thread.h:64
fawkes::ConfigurableAspect
Definition:
configurable.h:36
fawkes::ClockAspect
Definition:
clock.h:38
src
plugins
openni
depth_thread.h
Generated by
1.8.16