Go to the documentation of this file.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 #ifndef IMAGE_OVERLAY_H_
00031 #define IMAGE_OVERLAY_H_
00032
00033 #include <sensor_msgs/Image.h>
00034 #include <stereo_msgs/DisparityImage.h>
00035
00036 #include <OGRE/OgreTexture.h>
00037 #include <OGRE/OgreImage.h>
00038 #include <OGRE/OgreMaterial.h>
00039
00040 #include <boost/thread/mutex.hpp>
00041
00042
00043 namespace Ogre
00044 {
00045 class SceneNode;
00046 class Rectangle2D;
00047 }
00048
00049 namespace rviz_interaction_tools
00050 {
00051
00054 class ImageOverlay
00055 {
00056 public:
00057
00058
00059
00060 ImageOverlay( Ogre::SceneNode* scene_root, unsigned char render_queue_group );
00061
00062 virtual ~ImageOverlay();
00063
00067 bool setImage( const sensor_msgs::Image &image, const stereo_msgs::DisparityImage &disparity_image );
00068
00069 bool setImage( const sensor_msgs::Image &image );
00070
00072 bool setImage( unsigned char *rgb_data, int width, int height );
00073
00074
00075
00076 bool update();
00077
00078 void clear();
00079
00080 int getWidth();
00081 int getHeight();
00082
00083 Ogre::MaterialPtr getMaterial() { return texture_material_; }
00084
00085 private:
00086
00087
00088 bool setImageNoLock( const sensor_msgs::Image &image );
00089
00090 boost::mutex mutex_;
00091
00092 int count_;
00093
00094 Ogre::MaterialPtr texture_material_;
00095 Ogre::TexturePtr texture_;
00096 Ogre::Image empty_image_;
00097 Ogre::Rectangle2D* image_rect_;
00098
00099 Ogre::SceneNode* scene_root_;
00100
00101
00102 bool new_image_;
00103 std::vector<unsigned char> image_buffer_;
00104 int width_;
00105 int height_;
00106
00107 std::string resource_group_name_;
00108 };
00109
00110 }
00111
00112 #endif