@@ -84,6 +84,7 @@ namespace rviz_mesh_tools_plugins
8484ClusterLabelTool::ClusterLabelTool ()
8585:rviz_common::Tool()
8686, m_display(nullptr )
87+ , m_brushSize(MIN_BRUSH_SIZE)
8788, m_selectionCircle(nullptr )
8889, m_selectionMesh(nullptr )
8990, m_selectionVisibilityBit(0 )
@@ -709,7 +710,25 @@ Ogre::Image ClusterLabelTool::renderMeshWithFaceID()
709710 render_texture->update ();
710711
711712 // Copy the data to ram
713+ /* NOTE: Since Ogre 1.12.10 (which is available with ROS Jazzy), Ogre::Image has a constructor
714+ * which creates an Image from a given size and PixelFormat.
715+ * This #if-macro is to keep supporting ROS Humble (which uses Ogre 1.12.1) and can
716+ * be removed when support for ROS Humble is dropped.
717+ */
718+ #if OGRE_VERSION < ((1 << 16) | (12 << 8) | (10))
719+ Ogre::Image img;
720+ const size_t width = render_texture->getWidth ();
721+ const size_t height = render_texture->getHeight ();
722+ const size_t depth = 1 ;
723+ Ogre::uchar* mem = OGRE_ALLOC_T (
724+ Ogre::uchar,
725+ Ogre::PixelUtil::getMemorySize (width, height, depth, Ogre::PF_R8G8B8),
726+ Ogre::MEMCATEGORY_GENERAL
727+ );
728+ img.loadDynamicImage (mem, width, height, depth, Ogre::PF_R8G8B8, true );
729+ #else
712730 Ogre::Image img (Ogre::PF_R8G8B8, render_texture->getWidth (), render_texture->getHeight ());
731+ #endif
713732 Ogre::PixelBox pixels = img.getPixelBox ();
714733 render_texture->copyContentsToMemory (pixels, pixels);
715734
0 commit comments