36 #include <pcl/pcl_config.h>
39 #ifndef __OPENNI_IMAGE__
40 #define __OPENNI_IMAGE__
42 #include <pcl/pcl_exports.h>
44 #include "openni_exception.h"
45 #include <pcl/io/boost.h>
47 namespace openni_wrapper
61 typedef boost::shared_ptr<Image>
Ptr;
62 typedef boost::shared_ptr<const Image>
ConstPtr;
76 inline Image (boost::shared_ptr<xn::ImageMetaData> image_meta_data)
throw ();
82 inline virtual ~
Image () throw ();
92 virtual
bool isResizingSupported (
unsigned input_width,
unsigned input_height,
93 unsigned output_width,
unsigned output_height) const = 0;
103 virtual
void fillRGB (
unsigned width,
unsigned height,
unsigned char* rgb_buffer,
104 unsigned rgb_line_step = 0) const = 0;
111 virtual Encoding getEncoding () const = 0;
119 fillRaw (
unsigned char* rgb_buffer) const throw ()
121 memcpy (rgb_buffer, image_md_->Data (), image_md_->DataSize ());
132 virtual void fillGrayscale (
unsigned width,
unsigned height,
unsigned char* gray_buffer,
133 unsigned gray_line_step = 0)
const = 0;
139 inline unsigned getWidth ()
const throw ();
145 inline
unsigned getHeight () const throw ();
152 inline
unsigned getFrameID () const throw ();
159 inline
unsigned long getTimeStamp () const throw ();
165 inline const xn::ImageMetaData& getMetaData () const throw ();
168 boost::shared_ptr<xn::ImageMetaData> image_md_;
171 Image::
Image (boost::shared_ptr<xn::ImageMetaData> image_meta_data) throw ()
172 : image_md_ (image_meta_data)
181 return image_md_->XRes ();
187 return image_md_->YRes ();
193 return image_md_->FrameID ();
199 return static_cast<unsigned long> (image_md_->Timestamp ());
202 const xn::ImageMetaData&
209 #endif //__OPENNI_IMAGE__
unsigned getWidth() const
virtual ~Image()
virtual Destructor that never throws an exception.
unsigned long getTimeStamp() const
const xn::ImageMetaData & getMetaData() const
boost::shared_ptr< const Image > ConstPtr
boost::shared_ptr< Image > Ptr
unsigned getFrameID() const
Image class containing just a reference to image meta data.
unsigned getHeight() const