Open3D (C++ API)  0.18.0+252c867
Data Structures | Public Member Functions
open3d::visualization::gui::ImageWidget Class Reference

#include <ImageWidget.h>

Inheritance diagram for open3d::visualization::gui::ImageWidget:
open3d::visualization::gui::Widget

Data Structures

struct  Impl
 

Public Member Functions

 ImageWidget ()
 
 ImageWidget (const char *image_path)
 
 ImageWidget (std::shared_ptr< geometry::Image > image)
 Uses existing image. Each ImageWidget will use one draw call. More...
 
 ImageWidget (std::shared_ptr< t::geometry::Image > image)
 Uses existing image. Each ImageWidget will use one draw call. More...
 
 ImageWidget (visualization::rendering::TextureHandle texture_id, float u0=0.0f, float v0=0.0f, float u1=1.0f, float v1=1.0f)
 
 ImageWidget (std::shared_ptr< UIImage > image)
 
 ~ImageWidget ()
 
void UpdateImage (std::shared_ptr< geometry::Image > image)
 
void UpdateImage (std::shared_ptr< t::geometry::Image > image)
 
std::shared_ptr< UIImageGetUIImage () const
 
void SetUIImage (std::shared_ptr< UIImage > image)
 
Size CalcPreferredSize (const LayoutContext &context, const Constraints &constraints) const override
 
void Layout (const LayoutContext &context) override
 
DrawResult Draw (const DrawContext &context) override
 
- Public Member Functions inherited from open3d::visualization::gui::Widget
 Widget ()
 
 Widget (const std::vector< std::shared_ptr< Widget >> &children)
 
virtual ~Widget ()
 
virtual void AddChild (std::shared_ptr< Widget > child)
 
virtual const std::vector< std::shared_ptr< Widget > > GetChildren () const
 
virtual const RectGetFrame () const
 Returns the frame size in pixels. More...
 
virtual void SetFrame (const Rect &f)
 
virtual const ColorGetBackgroundColor () const
 
virtual bool IsDefaultBackgroundColor () const
 
virtual void SetBackgroundColor (const Color &color)
 
virtual bool IsVisible () const
 
virtual void SetVisible (bool vis)
 
virtual bool IsEnabled () const
 
virtual void SetEnabled (bool enabled)
 
virtual void SetTooltip (const char *text)
 
virtual const char * GetTooltip () const
 
virtual Size CalcMinimumSize (const LayoutContext &context) const
 
virtual EventResult Mouse (const MouseEvent &e)
 
virtual EventResult Key (const KeyEvent &e)
 
virtual DrawResult Tick (const TickEvent &e)
 

Additional Inherited Members

- Public Types inherited from open3d::visualization::gui::Widget
enum class  DrawResult { NONE , REDRAW , RELAYOUT }
 
enum class  EventResult { IGNORED , CONSUMED , DISCARD }
 
- Static Public Attributes inherited from open3d::visualization::gui::Widget
static constexpr int DIM_GROW = 10000
 
- Protected Member Functions inherited from open3d::visualization::gui::Widget
void DrawImGuiPushEnabledState ()
 
void DrawImGuiPopEnabledState ()
 
void DrawImGuiTooltip ()
 

Constructor & Destructor Documentation

◆ ImageWidget() [1/6]

open3d::visualization::gui::ImageWidget::ImageWidget ( )

◆ ImageWidget() [2/6]

open3d::visualization::gui::ImageWidget::ImageWidget ( const char *  image_path)
explicit

Uses image from the specified path. Each ImageWidget will use one draw call.

◆ ImageWidget() [3/6]

open3d::visualization::gui::ImageWidget::ImageWidget ( std::shared_ptr< geometry::Image image)
explicit

Uses existing image. Each ImageWidget will use one draw call.

◆ ImageWidget() [4/6]

open3d::visualization::gui::ImageWidget::ImageWidget ( std::shared_ptr< t::geometry::Image image)
explicit

Uses existing image. Each ImageWidget will use one draw call.

◆ ImageWidget() [5/6]

open3d::visualization::gui::ImageWidget::ImageWidget ( visualization::rendering::TextureHandle  texture_id,
float  u0 = 0.0f,
float  v0 = 0.0f,
float  u1 = 1.0f,
float  v1 = 1.0f 
)
explicit

Uses an existing texture, using texture coordinates (u0, v0) to (u1, v1). Does not deallocate texture on destruction. This is useful for using an icon atlas to reduce draw calls.

◆ ImageWidget() [6/6]

open3d::visualization::gui::ImageWidget::ImageWidget ( std::shared_ptr< UIImage image)

◆ ~ImageWidget()

open3d::visualization::gui::ImageWidget::~ImageWidget ( )

Member Function Documentation

◆ CalcPreferredSize()

Size open3d::visualization::gui::ImageWidget::CalcPreferredSize ( const LayoutContext context,
const Constraints constraints 
) const
overridevirtual

◆ Draw()

Widget::DrawResult open3d::visualization::gui::ImageWidget::Draw ( const DrawContext context)
overridevirtual

Draws the widget. If this is a Dear ImGUI widget, this is where the actual event processing happens. Return NONE if no action needs to be taken, REDRAW if the widget needs to be redrawn (e.g. its value changed), and RELAYOUT if the widget wishes to change size.

Reimplemented from open3d::visualization::gui::Widget.

◆ GetUIImage()

std::shared_ptr< UIImage > open3d::visualization::gui::ImageWidget::GetUIImage ( ) const

◆ Layout()

void open3d::visualization::gui::ImageWidget::Layout ( const LayoutContext context)
overridevirtual

◆ SetUIImage()

void open3d::visualization::gui::ImageWidget::SetUIImage ( std::shared_ptr< UIImage image)

◆ UpdateImage() [1/2]

void open3d::visualization::gui::ImageWidget::UpdateImage ( std::shared_ptr< geometry::Image image)

Mostly a convenience function for GetUIImage()->UpdateImage(). If 'image' is the same size as the current image, will update the texture with the contents of 'image'. This is the fastest path for setting an image, and is recommended if you are displaying video. If 'image' is a different size, it will allocate a new texture, which is essentially the same as creating a new UIImage and calling SetUIImage(). This is the slow path, and may eventually exhaust internal texture resources.

◆ UpdateImage() [2/2]

void open3d::visualization::gui::ImageWidget::UpdateImage ( std::shared_ptr< t::geometry::Image image)

The documentation for this class was generated from the following files: