ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
cloudViewer::visualization::gui::UIImage Class Reference

#include <UIImage.h>

Classes

struct  DrawParams
 
struct  Impl
 

Public Types

enum class  Scaling { NONE , ANY , ASPECT }
 

Public Member Functions

 UIImage (const char *image_path)
 
 UIImage (std::shared_ptr< geometry::Image > image)
 
 UIImage (std::shared_ptr< t::geometry::Image > image)
 
 UIImage (visualization::rendering::TextureHandle texture_id, float u0=0.0f, float v0=0.0f, float u1=1.0f, float v1=1.0f)
 
 ~UIImage ()
 
void UpdateImage (std::shared_ptr< geometry::Image > image)
 
void UpdateImage (std::shared_ptr< t::geometry::Image > image)
 
void SetScaling (Scaling scaling)
 
Scaling GetScaling () const
 
Size CalcPreferredSize (const LayoutContext &context, const Widget::Constraints &constraints) const
 
DrawParams CalcDrawParams (visualization::rendering::Renderer &renderer, const Rect &frame) const
 

Detailed Description

Definition at line 33 of file UIImage.h.

Member Enumeration Documentation

◆ Scaling

Enumerator
NONE 
ANY 

No scaling, fixed size.

ASPECT 

Scales to any size and aspect ratio.

Scales to any size, but fixed aspect ratio (default)

Definition at line 56 of file UIImage.h.

Constructor & Destructor Documentation

◆ UIImage() [1/4]

cloudViewer::visualization::gui::UIImage::UIImage ( const char *  image_path)
explicit

Definition at line 57 of file UIImage.cpp.

References cloudViewer::io::CreateImageFromFile().

◆ UIImage() [2/4]

cloudViewer::visualization::gui::UIImage::UIImage ( std::shared_ptr< geometry::Image image)
explicit

Definition at line 76 of file UIImage.cpp.

References image.

◆ UIImage() [3/4]

cloudViewer::visualization::gui::UIImage::UIImage ( std::shared_ptr< t::geometry::Image image)
explicit

Definition at line 95 of file UIImage.cpp.

References image.

◆ UIImage() [4/4]

cloudViewer::visualization::gui::UIImage::UIImage ( 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.

Definition at line 111 of file UIImage.cpp.

References cloudViewer::visualization::rendering::EngineInstance::GetResourceManager().

◆ ~UIImage()

cloudViewer::visualization::gui::UIImage::~UIImage ( )

Definition at line 135 of file UIImage.cpp.

Member Function Documentation

◆ CalcDrawParams()

◆ CalcPreferredSize()

Size cloudViewer::visualization::gui::UIImage::CalcPreferredSize ( const LayoutContext context,
const Widget::Constraints constraints 
) const

◆ GetScaling()

UIImage::Scaling cloudViewer::visualization::gui::UIImage::GetScaling ( ) const

Definition at line 153 of file UIImage.cpp.

Referenced by cloudViewer::visualization::gui::pybind_gui_classes().

◆ SetScaling()

void cloudViewer::visualization::gui::UIImage::SetScaling ( Scaling  scaling)

Definition at line 151 of file UIImage.cpp.

References scaling.

Referenced by cloudViewer::visualization::gui::pybind_gui_classes().

◆ UpdateImage() [1/2]

void cloudViewer::visualization::gui::UIImage::UpdateImage ( std::shared_ptr< geometry::Image image)

Updates the contents of the texture. If the image is a different size from the original, a new texture will be created.

Definition at line 141 of file UIImage.cpp.

References image.

◆ UpdateImage() [2/2]

void cloudViewer::visualization::gui::UIImage::UpdateImage ( std::shared_ptr< t::geometry::Image image)

Updates the contents of the texture. If the image is a different size from the original, a new texture will be created.

Definition at line 146 of file UIImage.cpp.

References image.


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