LuciadCPillar 2023.1.04
luciad::ImageIcon::Builder Class Referencefinal

Builder which takes images as input to create an IIcon. More...

#include <luciad/drawing/ImageIcon.h>

Public Member Functions

 Builder (Builder &&other) noexcept
 
 Builder (const Builder &other)
 
 ~Builder ()
 
BuilderaddImage (const std::shared_ptr< luciad::Image > &image, double anchorX, double anchorY, double displayScale)
 Adds an Image to the icon builder. More...
 
BuilderaddImage (const std::shared_ptr< luciad::Image > &image, double displayScale)
 Adds an Image to the icon builder. More...
 
std::shared_ptr< IIconbuild ()
 Returns the IIcon based on the provided images. More...
 
Builderoperator= (Builder other) noexcept
 

Detailed Description

Builder which takes images as input to create an IIcon.

Since
2023.1

Constructor & Destructor Documentation

◆ Builder() [1/2]

luciad::ImageIcon::Builder::Builder ( const Builder other)

◆ Builder() [2/2]

luciad::ImageIcon::Builder::Builder ( Builder &&  other)
noexcept

◆ ~Builder()

luciad::ImageIcon::Builder::~Builder ( )

Member Function Documentation

◆ addImage() [1/2]

Builder & luciad::ImageIcon::Builder::addImage ( const std::shared_ptr< luciad::Image > &  image,
double  anchorX,
double  anchorY,
double  displayScale 
)

Adds an Image to the icon builder.

When an image is already provided for a given display scale the last call overrides the previous image.

Parameters
imageThe image. Cannot be nullptr.
anchorXThe x coordinate of the anchor point in pixels. This must be a value in the [0, getWidth()] range.
anchorYThe y coordinate of the anchor point in pixels. This must be a value in the [0, getHeight()] range.
displayScaleThe display scale factor for the image. Must be > 0.
Returns
this builder.
Exceptions
luciad::NullArgumentExceptionwhen the image is a nullptr value.
luciad::InvalidArgumentExceptionwhen the display scale is <= 0 or an invalid value is provided for the anchor point.
See also
IIconPainter

◆ addImage() [2/2]

Builder & luciad::ImageIcon::Builder::addImage ( const std::shared_ptr< luciad::Image > &  image,
double  displayScale 
)

Adds an Image to the icon builder.

The anchor point is place at the center of the image.

When an image is already provided for a given display scale the last call overrides the previous image.

Parameters
imageThe image. Cannot be nullptr.
displayScaleThe display scale factor for the image. Must be > 0.
Returns
this builder.
Exceptions
luciad::NullArgumentExceptionwhen the image is a nullptr value.
luciad::InvalidArgumentExceptionwhen the display scale is <= 0.

◆ build()

std::shared_ptr< IIcon > luciad::ImageIcon::Builder::build ( )

Returns the IIcon based on the provided images.

Returns
the IIcon based on the provided images.
Exceptions
luciad::LogicExceptionIf no images have been set.

◆ operator=()

Builder & luciad::ImageIcon::Builder::operator= ( Builder  other)
noexcept