Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Friends | List of all members
openni_wrapper::DeviceONI Class Reference

Concrete implementation of the interface OpenNIDevice for a virtual device playing back an ONI file. More...

#include <openni_device_oni.h>

Inheritance diagram for openni_wrapper::DeviceONI:
Inheritance graph
[legend]

Public Member Functions

 DeviceONI (xn::Context &context, const std::string &file_name, bool repeat=false, bool streaming=true) throw (OpenNIException)
 
virtual bool isDepthStreamRunning () const throw (OpenNIException)
 
virtual bool isImageResizeSupported (unsigned input_width, unsigned input_height, unsigned output_width, unsigned output_height) const throw ()
 
virtual bool isImageStreamRunning () const throw (OpenNIException)
 
virtual bool isIRStreamRunning () const throw (OpenNIException)
 
bool isStreaming () const throw (OpenNIException)
 
virtual void startDepthStream () throw (OpenNIException)
 
virtual void startImageStream () throw (OpenNIException)
 
virtual void startIRStream () throw (OpenNIException)
 
virtual void stopDepthStream () throw (OpenNIException)
 
virtual void stopImageStream () throw (OpenNIException)
 
virtual void stopIRStream () throw (OpenNIException)
 
bool trigger () throw (OpenNIException)
 
virtual ~DeviceONI () throw ()
 
- Public Member Functions inherited from openni_wrapper::OpenNIDevice
virtual bool findCompatibleDepthMode (const XnMapOutputMode &output_mode, XnMapOutputMode &mode) const throw (OpenNIException)
 
virtual bool findCompatibleImageMode (const XnMapOutputMode &output_mode, XnMapOutputMode &mode) const throw (OpenNIException)
 
unsigned char getAddress () const throw ()
 
float getBaseline () const throw ()
 
unsigned char getBus () const throw ()
 
const char * getConnectionString () const throw ()
 returns the connectionstring for current device, which has following format vendorID/productID@BusID/DeviceID More...
 
virtual const XnMapOutputMode & getDefaultDepthMode () const throw ()
 
virtual const XnMapOutputMode & getDefaultImageMode () const throw ()
 
virtual const XnMapOutputMode & getDefaultIRMode () const throw ()
 
float getDepthFocalLength (int output_x_resolution=0) const throw ()
 returns the focal length for the IR camera in pixels. The pixels are assumed to be square. Result depends on the output resolution of the depth image. More...
 
XnMapOutputMode getDepthOutputMode () const throw (OpenNIException)
 
float getImageFocalLength (int output_x_resolution=0) const throw ()
 returns the focal length for the color camera in pixels. The pixels are assumed to be square. Result depends on the output resolution of the image. More...
 
XnMapOutputMode getImageOutputMode () const throw (OpenNIException)
 
XnMapOutputMode getIROutputMode () const throw (OpenNIException)
 
unsigned short getProductID () const throw ()
 
const char * getProductName () const throw ()
 
const char * getSerialNumber () throw ()
 returns the serial number for device. More...
 
unsigned short getVendorID () const throw ()
 
const char * getVendorName () const throw ()
 
bool hasDepthStream () const throw ()
 
bool hasImageStream () const throw ()
 
bool hasIRStream () const throw ()
 
virtual bool isDepthCropped () const throw (OpenNIException)
 
virtual bool isDepthCroppingSupported () const throw ()
 
virtual bool isDepthModeSupported (const XnMapOutputMode &output_mode) const throw (OpenNIException)
 
bool isDepthRegistered () const throw (OpenNIException)
 
virtual bool isDepthRegistrationSupported () const throw (OpenNIException)
 
virtual bool isImageModeSupported (const XnMapOutputMode &output_mode) const throw (OpenNIException)
 
virtual bool isSynchronizationSupported () const throw ()
 
virtual bool isSynchronized () const throw (OpenNIException)
 
CallbackHandle registerDepthCallback (const DepthImageCallbackFunction &callback, void *cookie=NULL) throw ()
 
template<typename T >
CallbackHandle registerDepthCallback (void(T::*callback)(boost::shared_ptr< DepthImage >, void *cookie), T &instance, void *cookie=NULL) throw ()
 
CallbackHandle registerImageCallback (const ImageCallbackFunction &callback, void *cookie=NULL) throw ()
 
template<typename T >
CallbackHandle registerImageCallback (void(T::*callback)(boost::shared_ptr< Image >, void *cookie), T &instance, void *cookie=NULL) throw ()
 
CallbackHandle registerIRCallback (const IRImageCallbackFunction &callback, void *cookie=NULL) throw ()
 
template<typename T >
CallbackHandle registerIRCallback (void(T::*callback)(boost::shared_ptr< IRImage >, void *cookie), T &instance, void *cookie=NULL) throw ()
 
virtual void setDepthCropping (unsigned x, unsigned y, unsigned width, unsigned height) throw (OpenNIException)
 
virtual void setDepthOutputMode (const XnMapOutputMode &output_mode) throw (OpenNIException)
 
virtual void setDepthRegistration (bool on_off) throw (OpenNIException)
 
virtual void setImageOutputMode (const XnMapOutputMode &output_mode) throw (OpenNIException)
 
virtual void setIROutputMode (const XnMapOutputMode &output_mode) throw (OpenNIException)
 
virtual void setSynchronization (bool on_off) throw (OpenNIException)
 
void shutdown ()
 
bool unregisterDepthCallback (const CallbackHandle &callbackHandle) throw ()
 
bool unregisterImageCallback (const CallbackHandle &callbackHandle) throw ()
 
bool unregisterIRCallback (const CallbackHandle &callbackHandle) throw ()
 
virtual ~OpenNIDevice () throw ()
 

Protected Member Functions

virtual boost::shared_ptr< ImagegetCurrentImage (boost::shared_ptr< xn::ImageMetaData > image_meta_data) const throw ()
 
void PlayerThreadFunction () throw (OpenNIException)
 
- Protected Member Functions inherited from openni_wrapper::OpenNIDevice
void DepthDataThreadFunction () throw (OpenNIException)
 
virtual void enumAvailableModes () throw (OpenNIException)
 
void ImageDataThreadFunction () throw (OpenNIException)
 
void Init () throw (OpenNIException)
 
void IRDataThreadFunction () throw (OpenNIException)
 
 OpenNIDevice (xn::Context &context, const xn::NodeInfo &device_node, const xn::NodeInfo &image_node, const xn::NodeInfo &depth_node, const xn::NodeInfo &ir_node) throw (OpenNIException)
 
 OpenNIDevice (xn::Context &context, const xn::NodeInfo &device_node, const xn::NodeInfo &depth_node, const xn::NodeInfo &ir_node) throw (OpenNIException)
 
 OpenNIDevice (xn::Context &context) throw (OpenNIException)
 
void setRegistration (bool on_off) throw (OpenNIException)
 

Static Protected Member Functions

static void __stdcall NewONIDepthDataAvailable (xn::ProductionNode &node, void *cookie) throw ()
 
static void __stdcall NewONIImageDataAvailable (xn::ProductionNode &node, void *cookie) throw ()
 
static void __stdcall NewONIIRDataAvailable (xn::ProductionNode &node, void *cookie) throw ()
 
- Static Protected Member Functions inherited from openni_wrapper::OpenNIDevice
static void __stdcall NewDepthDataAvailable (xn::ProductionNode &node, void *cookie) throw ()
 
static void __stdcall NewImageDataAvailable (xn::ProductionNode &node, void *cookie) throw ()
 
static void __stdcall NewIRDataAvailable (xn::ProductionNode &node, void *cookie) throw ()
 

Protected Attributes

bool depth_stream_running_
 
bool image_stream_running_
 
bool ir_stream_running_
 
xn::Player player_
 
boost::condition_variable player_condition_
 
boost::mutex player_mutex_
 
boost::thread player_thread_
 
bool streaming_
 
- Protected Attributes inherited from openni_wrapper::OpenNIDevice
std::vector< XnMapOutputMode > available_depth_modes_
 
std::vector< XnMapOutputMode > available_image_modes_
 
float baseline_
 distance between the projector and the IR camera More...
 
xn::Context & context_
 context to OpenNI driver More...
 
boost::thread_group data_threads_
 
std::map< CallbackHandle, ActualDepthImageCallbackFunctiondepth_callback_
 
XnCallbackHandle depth_callback_handle_
 
OpenNIDevice::CallbackHandle depth_callback_handle_counter_
 
boost::condition_variable depth_condition_
 
float depth_focal_length_SXGA_
 focal length for IR camera producing depth information in native SXGA mode More...
 
xn::DepthGenerator depth_generator_
 Depth generator object. More...
 
boost::mutex depth_mutex_
 
xn::NodeInfo device_node_info_
 node object for current device More...
 
std::map< CallbackHandle, ActualImageCallbackFunctionimage_callback_
 
XnCallbackHandle image_callback_handle_
 
OpenNIDevice::CallbackHandle image_callback_handle_counter_
 
boost::condition_variable image_condition_
 
xn::ImageGenerator image_generator_
 Image generator object. More...
 
boost::mutex image_mutex_
 
std::map< CallbackHandle, ActualIRImageCallbackFunctionir_callback_
 
XnCallbackHandle ir_callback_handle_
 
OpenNIDevice::CallbackHandle ir_callback_handle_counter_
 
boost::condition_variable ir_condition_
 
xn::IRGenerator ir_generator_
 IR generator object. More...
 
boost::mutex ir_mutex_
 
XnUInt64 no_sample_value_
 
bool quit_
 
XnUInt64 shadow_value_
 

Friends

class OpenNIDriver
 

Additional Inherited Members

- Public Types inherited from openni_wrapper::OpenNIDevice
typedef unsigned CallbackHandle
 
typedef boost::function< void(boost::shared_ptr< DepthImage >, void *cookie) > DepthImageCallbackFunction
 
typedef boost::function< void(boost::shared_ptr< Image >, void *cookie) > ImageCallbackFunction
 
typedef boost::function< void(boost::shared_ptr< IRImage >, void *cookie) > IRImageCallbackFunction
 
- Protected Types inherited from openni_wrapper::OpenNIDevice
typedef boost::function< void(boost::shared_ptr< DepthImage >) > ActualDepthImageCallbackFunction
 
typedef boost::function< void(boost::shared_ptr< Image >) > ActualImageCallbackFunction
 
typedef boost::function< void(boost::shared_ptr< IRImage >) > ActualIRImageCallbackFunction
 
- Static Protected Attributes inherited from openni_wrapper::OpenNIDevice
static const float rgb_focal_length_SXGA_ = 1050
 focal length for regular camera producing color images in native SXGA mode More...
 

Detailed Description

Concrete implementation of the interface OpenNIDevice for a virtual device playing back an ONI file.

Author
Suat Gedikli
Date
19. june 2011

Definition at line 53 of file openni_device_oni.h.

Constructor & Destructor Documentation

openni_wrapper::DeviceONI::DeviceONI ( xn::Context &  context,
const std::string &  file_name,
bool  repeat = false,
bool  streaming = true 
)
throw (OpenNIException
)

Definition at line 46 of file openni_device_oni.cpp.

openni_wrapper::DeviceONI::~DeviceONI ( )
throw (
)
virtual

Definition at line 91 of file openni_device_oni.cpp.

Member Function Documentation

boost::shared_ptr< Image > openni_wrapper::DeviceONI::getCurrentImage ( boost::shared_ptr< xn::ImageMetaData >  image_meta_data) const
throw (
)
protectedvirtual

Implements openni_wrapper::OpenNIDevice.

Definition at line 196 of file openni_device_oni.cpp.

bool openni_wrapper::DeviceONI::isDepthStreamRunning ( ) const
throw (OpenNIException
)
virtual

Reimplemented from openni_wrapper::OpenNIDevice.

Definition at line 141 of file openni_device_oni.cpp.

bool openni_wrapper::DeviceONI::isImageResizeSupported ( unsigned  input_width,
unsigned  input_height,
unsigned  output_width,
unsigned  output_height 
) const
throw (
)
virtual

Implements openni_wrapper::OpenNIDevice.

Definition at line 201 of file openni_device_oni.cpp.

bool openni_wrapper::DeviceONI::isImageStreamRunning ( ) const
throw (OpenNIException
)
virtual

Reimplemented from openni_wrapper::OpenNIDevice.

Definition at line 136 of file openni_device_oni.cpp.

bool openni_wrapper::DeviceONI::isIRStreamRunning ( ) const
throw (OpenNIException
)
virtual

Reimplemented from openni_wrapper::OpenNIDevice.

Definition at line 146 of file openni_device_oni.cpp.

bool openni_wrapper::DeviceONI::isStreaming ( ) const
throw (OpenNIException
)

Definition at line 163 of file openni_device_oni.cpp.

void __stdcall openni_wrapper::DeviceONI::NewONIDepthDataAvailable ( xn::ProductionNode &  node,
void *  cookie 
)
throw (
)
staticprotected

Definition at line 175 of file openni_device_oni.cpp.

void __stdcall openni_wrapper::DeviceONI::NewONIImageDataAvailable ( xn::ProductionNode &  node,
void *  cookie 
)
throw (
)
staticprotected

Definition at line 182 of file openni_device_oni.cpp.

void __stdcall openni_wrapper::DeviceONI::NewONIIRDataAvailable ( xn::ProductionNode &  node,
void *  cookie 
)
throw (
)
staticprotected

Definition at line 189 of file openni_device_oni.cpp.

void openni_wrapper::DeviceONI::PlayerThreadFunction ( )
throw (OpenNIException
)
protected

Definition at line 168 of file openni_device_oni.cpp.

void openni_wrapper::DeviceONI::startDepthStream ( )
throw (OpenNIException
)
virtual

Reimplemented from openni_wrapper::OpenNIDevice.

Definition at line 112 of file openni_device_oni.cpp.

void openni_wrapper::DeviceONI::startImageStream ( )
throw (OpenNIException
)
virtual

Reimplemented from openni_wrapper::OpenNIDevice.

Definition at line 100 of file openni_device_oni.cpp.

void openni_wrapper::DeviceONI::startIRStream ( )
throw (OpenNIException
)
virtual

Reimplemented from openni_wrapper::OpenNIDevice.

Definition at line 124 of file openni_device_oni.cpp.

void openni_wrapper::DeviceONI::stopDepthStream ( )
throw (OpenNIException
)
virtual

Reimplemented from openni_wrapper::OpenNIDevice.

Definition at line 118 of file openni_device_oni.cpp.

void openni_wrapper::DeviceONI::stopImageStream ( )
throw (OpenNIException
)
virtual

Reimplemented from openni_wrapper::OpenNIDevice.

Definition at line 106 of file openni_device_oni.cpp.

void openni_wrapper::DeviceONI::stopIRStream ( )
throw (OpenNIException
)
virtual

Reimplemented from openni_wrapper::OpenNIDevice.

Definition at line 130 of file openni_device_oni.cpp.

bool openni_wrapper::DeviceONI::trigger ( )
throw (OpenNIException
)

Definition at line 151 of file openni_device_oni.cpp.

Friends And Related Function Documentation

friend class OpenNIDriver
friend

Definition at line 55 of file openni_device_oni.h.

Member Data Documentation

bool openni_wrapper::DeviceONI::depth_stream_running_
protected

Definition at line 90 of file openni_device_oni.h.

bool openni_wrapper::DeviceONI::image_stream_running_
protected

Definition at line 91 of file openni_device_oni.h.

bool openni_wrapper::DeviceONI::ir_stream_running_
protected

Definition at line 92 of file openni_device_oni.h.

xn::Player openni_wrapper::DeviceONI::player_
protected

Definition at line 85 of file openni_device_oni.h.

boost::condition_variable openni_wrapper::DeviceONI::player_condition_
protected

Definition at line 88 of file openni_device_oni.h.

boost::mutex openni_wrapper::DeviceONI::player_mutex_
mutableprotected

Definition at line 87 of file openni_device_oni.h.

boost::thread openni_wrapper::DeviceONI::player_thread_
protected

Definition at line 86 of file openni_device_oni.h.

bool openni_wrapper::DeviceONI::streaming_
protected

Definition at line 89 of file openni_device_oni.h.


The documentation for this class was generated from the following files:


openni_camera
Author(s): Patrick Mihelich, Suat Gedikli, Radu Bogdan Rusu
autogenerated on Wed Jun 5 2019 20:15:22