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  Scaling { Scaling::NONE, Scaling::ANY, Scaling::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
 

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)

Constructor & Destructor Documentation

◆ UIImage() [1/4]

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

◆ UIImage() [2/4]

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

References float, and image.

◆ UIImage() [3/4]

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

References float, and 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.

References float, and cloudViewer::visualization::rendering::EngineInstance::GetResourceManager().

◆ ~UIImage()

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

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

◆ SetScaling()

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

References scaling.

◆ 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.

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.

References image.


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