39 #include <pcl/pcl_config.h>
43 #include "openni_device.h"
44 #include "openni_driver.h"
46 #include <pcl/io/openni_camera/openni_image.h>
48 #include <condition_variable>
65 using Ptr = pcl::shared_ptr<DeviceONI>;
66 using ConstPtr = pcl::shared_ptr<const DeviceONI>;
68 DeviceONI (xn::Context& context,
const std::string& file_name,
bool repeat =
false,
bool streaming =
true);
84 bool isImageResizeSupported (
unsigned input_width,
unsigned input_height,
unsigned output_width,
unsigned output_height) const noexcept override;
Concrete implementation of the interface OpenNIDevice for a virtual device playing back an ONI file.
~DeviceONI() noexcept override
void stopIRStream() override
stops the IR stream.
Image::Ptr getCurrentImage(pcl::shared_ptr< xn::ImageMetaData > image_meta_data) const noexcept override
void startIRStream() override
starts the IR stream.
static void __stdcall NewONIIRDataAvailable(xn::ProductionNode &node, void *cookie) noexcept
void stopDepthStream() override
stops the depth stream.
bool depth_stream_running_
bool isIRStreamRunning() const noexcept override
void startDepthStream() override
starts the depth stream.
bool trigger(int relative_offset=0)
Trigger a new frame in the ONI stream.
bool isImageResizeSupported(unsigned input_width, unsigned input_height, unsigned output_width, unsigned output_height) const noexcept override
static void __stdcall NewONIImageDataAvailable(xn::ProductionNode &node, void *cookie) noexcept
bool hasDataLeft()
Check if there is any data left in the ONI file to process.
DeviceONI(xn::Context &context, const std::string &file_name, bool repeat=false, bool streaming=true)
bool image_stream_running_
void startImageStream() override
starts the image stream.
bool isDepthStreamRunning() const noexcept override
std::thread player_thread_
bool isImageStreamRunning() const noexcept override
std::condition_variable player_condition_
void PlayerThreadFunction()
bool isStreaming() const noexcept
static void __stdcall NewONIDepthDataAvailable(xn::ProductionNode &node, void *cookie) noexcept
void stopImageStream() override
stops the image stream.
pcl::shared_ptr< Image > Ptr
Class representing an astract device for OpenNI devices: Primesense PSDK, Microsoft Kinect,...
pcl::shared_ptr< OpenNIDevice > Ptr
pcl::shared_ptr< const OpenNIDevice > ConstPtr
Driver class implemented as Singleton.
Defines functions, macros and traits for allocating and using memory.