00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 #ifndef __OPENNI_IR_IMAGE__
00038 #define __OPENNI_IR_IMAGE__
00039
00040 #include <XnCppWrapper.h>
00041 #include "openni_exception.h"
00042 #include <boost/shared_ptr.hpp>
00043
00044 namespace openni_wrapper
00045 {
00046
00050 class IRImage
00051 {
00052 public:
00053 typedef boost::shared_ptr<IRImage> Ptr;
00054 typedef boost::shared_ptr<const IRImage> ConstPtr;
00055
00056 inline IRImage (boost::shared_ptr<xn::IRMetaData> ir_meta_data) throw ();
00057 inline virtual ~IRImage () throw ();
00058
00059 inline void
00060 fillRaw (unsigned short* ir_buffer) const throw (OpenNIException)
00061 {
00062 memcpy (ir_buffer, ir_md_->Data(), ir_md_->DataSize ());
00063 }
00064
00065 inline unsigned getWidth () const throw ();
00066 inline unsigned getHeight () const throw ();
00067 inline unsigned getFrameID () const throw ();
00068 inline unsigned long getTimeStamp () const throw ();
00069 inline const xn::IRMetaData& getMetaData () const throw ();
00070
00071 protected:
00072 boost::shared_ptr<xn::IRMetaData> ir_md_;
00073 };
00074
00075 IRImage::IRImage (boost::shared_ptr<xn::IRMetaData> ir_meta_data) throw ()
00076 : ir_md_ (ir_meta_data)
00077 {
00078 }
00079
00080 IRImage::~IRImage () throw ()
00081 {
00082 }
00083
00084 unsigned IRImage::getWidth () const throw ()
00085 {
00086 return ir_md_->XRes ();
00087 }
00088
00089 unsigned IRImage::getHeight () const throw ()
00090 {
00091 return ir_md_->YRes ();
00092 }
00093
00094 unsigned IRImage::getFrameID () const throw ()
00095 {
00096 return ir_md_->FrameID ();
00097 }
00098
00099 unsigned long IRImage::getTimeStamp () const throw ()
00100 {
00101 return ir_md_->Timestamp ();
00102 }
00103
00104 const xn::IRMetaData& IRImage::getMetaData () const throw ()
00105 {
00106 return *ir_md_;
00107 }
00108 }
00109 #endif //__OPENNI_IR_IMAGE__