39 #ifndef __OPENNI_DEPTH_IMAGE__
40 #define __OPENNI_DEPTH_IMAGE__
42 #include <XnCppWrapper.h>
47 #include <boost/shared_ptr.hpp>
49 namespace openni_wrapper
60 typedef boost::shared_ptr<DepthImage> Ptr;
61 typedef boost::shared_ptr<const DepthImage> ConstPtr;
74 inline DepthImage (boost::shared_ptr<xn::DepthMetaData> depth_meta_data,
float baseline,
float focal_length, XnUInt64 shadow_value, XnUInt64 no_sample_value)
throw ();
80 inline virtual ~DepthImage () throw ();
87 inline const xn::DepthMetaData& getDepthMetaData () const throw ();
98 void fillDisparityImage (
unsigned width,
unsigned height,
float* disparity_buffer,
unsigned line_step = 0) const;
109 void fillDepthImage (
unsigned width,
unsigned height,
float* depth_buffer,
unsigned line_step = 0) const;
120 void fillDepthImageRaw (
unsigned width,
unsigned height,
unsigned short* depth_buffer,
unsigned line_step = 0) const;
127 inline
float getBaseline () const throw ();
134 inline
float getFocalLength () const throw ();
141 inline XnUInt64 getShadowValue () const throw ();
148 inline XnUInt64 getNoSampleValue () const throw ();
154 inline
unsigned getWidth () const throw ();
160 inline
unsigned getHeight () const throw ();
167 inline
unsigned getFrameID () const throw ();
175 inline
unsigned long getTimeStamp () const throw ();
177 boost::shared_ptr<xn::DepthMetaData> depth_md_;
180 XnUInt64 shadow_value_;
181 XnUInt64 no_sample_value_;
184 DepthImage::DepthImage (boost::shared_ptr<xn::DepthMetaData> depth_meta_data,
float baseline,
float focal_length, XnUInt64 shadow_value, XnUInt64 no_sample_value) throw ()
185 : depth_md_ (depth_meta_data)
186 , baseline_ (baseline)
187 , focal_length_ (focal_length)
188 , shadow_value_ (shadow_value)
189 , no_sample_value_ (no_sample_value) { }
191 DepthImage::~DepthImage () throw () { }
193 const xn::DepthMetaData&
194 DepthImage::getDepthMetaData ()
const throw ()
200 DepthImage::getBaseline ()
const throw ()
206 DepthImage::getFocalLength ()
const throw ()
208 return focal_length_;
212 DepthImage::getShadowValue ()
const throw ()
214 return shadow_value_;
218 DepthImage::getNoSampleValue ()
const throw ()
220 return no_sample_value_;
224 DepthImage::getWidth ()
const throw ()
226 return depth_md_->XRes ();
230 DepthImage::getHeight ()
const throw ()
232 return depth_md_->YRes ();
236 DepthImage::getFrameID ()
const throw ()
238 return depth_md_->FrameID ();
242 DepthImage::getTimeStamp ()
const throw ()
244 return static_cast<unsigned long> (depth_md_->Timestamp ());
248 #endif //__OPENNI_DEPTH_IMAGE