FAST  3.2.0
Framework for Heterogeneous Medical Image Computing and Visualization
KinectStreamer.hpp
Go to the documentation of this file.
1 #ifndef FAST_KINECT_STREAMER_HPP_
2 #define FAST_KINECT_STREAMER_HPP_
3 
4 #include "FAST/ProcessObject.hpp"
5 #include "Streamer.hpp"
6 #include <thread>
7 #include <stack>
8 
9 namespace libfreenect2 {
10 class Frame;
11 class Registration;
12 }
13 
14 namespace fast {
15 
16 class MeshVertex;
17 
28 class FAST_EXPORT KinectStreamer : public Streamer {
30  public:
31  void producerStream();
32  void setPointCloudFiltering(bool enabled);
37  void setMaxRange(float range);
42  void setMinRange(float range);
43  bool hasReachedEnd();
44  uint getNrOfFrames() const;
51  MeshVertex getPoint(int x, int y);
52  ~KinectStreamer();
53  void stop();
54  private:
56 
57  void execute();
58 
59  bool mStreamIsStarted;
60  bool mFirstFrameIsInserted;
61  bool mHasReachedEnd;
62  bool mStop;
63  bool mPointCloudFilterEnabled;
64  float mMaxRange = std::numeric_limits<float>::max(), mMinRange = 0;
65  uint mNrOfFrames;
66 
67  std::thread* mThread;
68  std::mutex mFirstFrameMutex;
69  std::mutex mStopMutex;
70  std::condition_variable mFirstFrameCondition;
71  libfreenect2::Registration* registration;
72  libfreenect2::Frame* mUndistorted;
73  libfreenect2::Frame* mRegistered;
74 
75  static bool mInitialized;
76  static std::stack<std::string> mAvailableDevices;
77 };
78 
79 }
80 
81 #endif
fast::Streamer
Definition: Streamer.hpp:19
Streamer.hpp
fast
Definition: AffineTransformation.hpp:7
FAST_OBJECT
#define FAST_OBJECT(className)
Definition: Object.hpp:9
fast::MeshVertex
Definition: MeshVertex.hpp:10
libfreenect2
Definition: KinectStreamer.hpp:9
fast::max
T max(T a, T b)
Definition: Utility.hpp:46
fast::KinectStreamer
Streams data RGB and depth data from a kinect device.
Definition: KinectStreamer.hpp:28
ProcessObject.hpp
uint
unsigned int uint
Definition: DataTypes.hpp:16