Maps SDK for C++ 1.0.0
Loading...
Searching...
No Matches
gem::AbstractGeometryImage Class Reference

AbstractGeometryImage object. More...

Inheritance diagram for gem::AbstractGeometryImage:
Collaboration diagram for gem::AbstractGeometryImage:

Public Member Functions

 AbstractGeometryImage (const AbstractGeometryImage &)=default
 Default copy constructor.
 AbstractGeometryImage (AbstractGeometryImage &&)=default
 Default move constructor noexcept is deduced.
AbstractGeometryImage & operator= (const AbstractGeometryImage &image)=default
 Default copy assignment.
AbstractGeometryImage & operator= (AbstractGeometryImage &&image)=default
 Default move assignment noexcept is deduced.
bool operator== (const AbstractGeometryImage &img) const
 Comparison operator.
bool operator!= (const AbstractGeometryImage &img) const
 Comparison operator not equal.
int render (IBitmap &bitmap, const AbstractGeometryImageRenderSettings &settings) const noexcept
 Render the specified AbstractGeometryImage into the provided IBitmap.
DataBuffer exportAs (const Size &size, int format, const AbstractGeometryImageRenderSettings &settings) const noexcept
 Export image as a data buffer in the specified format.
int exportAs (const Size &size, int format, const String &path, const AbstractGeometryImageRenderSettings &settings) const noexcept
 Export image to a file in the specified format.
bool operator== (const Image &img) const noexcept
 Equal operator.
unsigned getType () const noexcept
 Get the type of the image, see EImageType.
unsigned getUid () const noexcept
 Get the unique ID of the image.
int render (IBitmap &bitmap) const noexcept
 Render the Image into the provided IBitmap.
Size getSize () const noexcept
 Get the preferred size of the image.
SizeF getAspectRatio () const noexcept
 Get the icon aspect ratio as pair of ( width_aspect, height_aspect ).
float getAspectRatioF () const noexcept
 Get the icon aspect ratio as a direct raport width / height.
bool isScalable () const noexcept
 Check if icon is scalable ( i.e.
bool isValid () const noexcept
 Check the validity of the Image.
template<typename TSpecializedImage>
TSpecializedImage & cast () noexcept
 Cast to specialized image.
template<typename TSpecializedImage>
const TSpecializedImage & cast () const noexcept
 Cast to const specialized image.
DataBuffer exportAs (const Size &size, int format) const noexcept
 Export image as a data buffer in the specified format.
int exportAs (const Size &size, int format, const String &path) const noexcept
 Export image to a file in the specified format.

Protected Member Functions

template<typename ... TArgs>
StrongPointer< IBitmaprenderTo (const Size &size, TArgs &&... args) const noexcept
 Render the Image into a new IBitmap of the specified size, using the provided additional arguments if needed.
template<typename ... TArgs>
DataBuffer exportTo (const Size &size, int format, TArgs &&... args) const noexcept
 Export image to a data buffer or file in the specified format, using the provided additional arguments if needed.
template<typename ... TArgs>
int exportTo (const Size &size, int format, const String &path, TArgs &&... args) const noexcept
 Export image to a file in the specified format, using the provided additional arguments if needed.

Detailed Description

Member Function Documentation

◆ cast() [1/2]

template<typename TSpecializedImage>
const TSpecializedImage & gem::Image::cast ( ) const
inlinenoexceptinherited

Cast to const specialized image.

Returns
Specialized image

◆ cast() [2/2]

template<typename TSpecializedImage>
TSpecializedImage & gem::Image::cast ( )
inlinenoexceptinherited

Cast to specialized image.

Returns
Specialized image

◆ exportAs() [1/4]

DataBuffer gem::AbstractGeometryImage::exportAs ( const Size & size,
int format,
const AbstractGeometryImageRenderSettings & settings ) const
inlinenoexcept

Export image as a data buffer in the specified format.

Parameters
[in]sizeThe exported image size in pixels
[in]formatThe exported image format, see EImageFileFormat
[in]settingsSettings of abstract geometry image render.
Returns
Data buffer containing the image in the specified format

◆ exportAs() [2/4]

int gem::AbstractGeometryImage::exportAs ( const Size & size,
int format,
const String & path,
const AbstractGeometryImageRenderSettings & settings ) const
inlinenoexcept

Export image to a file in the specified format.

Parameters
[in]sizeThe exported image size in pixels
[in]formatThe exported image format, see EImageFileFormat
[in]pathThe file path where to save the image
[in]settingsSettings of abstract geometry image render.
Returns
The opration result code

◆ exportAs() [3/4]

DataBuffer gem::Image::exportAs ( const Size & size,
int format ) const
inlinenoexceptinherited

Export image as a data buffer in the specified format.

Parameters
[in]sizeThe exported image size in pixels
[in]formatThe exported image format, see EImageFileFormat
Returns
Data buffer containing the image in the specified format

◆ exportAs() [4/4]

int gem::Image::exportAs ( const Size & size,
int format,
const String & path ) const
inlinenoexceptinherited

Export image to a file in the specified format.

Parameters
[in]sizeThe exported image size in pixels
[in]formatThe exported image format, see EImageFileFormat
[in]pathThe file path where to save the image
Returns
The opration result code

◆ exportTo() [1/2]

template<typename ... TArgs>
int gem::Image::exportTo ( const Size & size,
int format,
const String & path,
TArgs &&... args ) const
inlineprotectednoexceptinherited

Export image to a file in the specified format, using the provided additional arguments if needed.

Parameters
[in]sizeThe exported image size in pixels
[in]formatThe exported image format, see EImageFileFormat
[in]pathThe file path where to save the image
[in]argsAdditional arguments to be forwarded to the Render function, if needed by the specific image type
Returns
The opration result code

◆ exportTo() [2/2]

template<typename ... TArgs>
DataBuffer gem::Image::exportTo ( const Size & size,
int format,
TArgs &&... args ) const
inlineprotectednoexceptinherited

Export image to a data buffer or file in the specified format, using the provided additional arguments if needed.

Parameters
[in]sizeThe exported image size in pixels
[in]formatThe exported image format, see EImageFileFormat
[in]argsAdditional arguments to be forwarded to the Render function, if needed by the specific image type
Returns
If exporting to data buffer, returns the data buffer containing the image in the specified format.

◆ getAspectRatio()

SizeF gem::Image::getAspectRatio ( ) const
inlinenoexceptinherited

Get the icon aspect ratio as pair of ( width_aspect, height_aspect ).

If width > height return { width / height, 1.f ) If width < height return { 1.f, height / width )

Returns
The aspect ratio of the image

◆ getAspectRatioF()

float gem::Image::getAspectRatioF ( ) const
inlinenoexceptinherited

Get the icon aspect ratio as a direct raport width / height.

Returns
The aspect ratio of the image

◆ getSize()

Size gem::Image::getSize ( ) const
inlinenoexceptinherited

Get the preferred size of the image.

Returns
The preferred size of the image

◆ getType()

unsigned gem::Image::getType ( ) const
inlinenoexceptinherited

Get the type of the image, see EImageType.

Returns
The type of the image

◆ getUid()

unsigned gem::Image::getUid ( ) const
inlinenoexceptinherited

Get the unique ID of the image.

Returns
The unique ID of the image

◆ isScalable()

bool gem::Image::isScalable ( ) const
inlinenoexceptinherited

Check if icon is scalable ( i.e.

it has vectorial format )

Returns
True if the image is scalable, false otherwise

◆ isValid()

bool gem::Image::isValid ( ) const
inlinenoexceptinherited

Check the validity of the Image.

Returns
True if the image is valid, false otherwise

◆ operator!=()

bool gem::AbstractGeometryImage::operator!= ( const AbstractGeometryImage & img) const
inline

Comparison operator not equal.

Parameters
imgOther image
Returns
True if the images are not equal, false otherwise

◆ operator=() [1/2]

AbstractGeometryImage & gem::AbstractGeometryImage::operator= ( AbstractGeometryImage && image)
default

Default move assignment noexcept is deduced.

Parameters
imageOther image
Returns
Reference to this object

◆ operator=() [2/2]

AbstractGeometryImage & gem::AbstractGeometryImage::operator= ( const AbstractGeometryImage & image)
default

Default copy assignment.

Parameters
imageOther image
Returns
Reference to this object

◆ operator==() [1/2]

bool gem::AbstractGeometryImage::operator== ( const AbstractGeometryImage & img) const
inline

Comparison operator.

Parameters
imgOther image
Returns
True if the images are equal, false otherwise

◆ operator==() [2/2]

bool gem::Image::operator== ( const Image & img) const
inlinenoexceptinherited

Equal operator.

Parameters
imgOther image.
Returns
True if the images are equal, false otherwise.

◆ render() [1/2]

int gem::AbstractGeometryImage::render ( IBitmap & bitmap,
const AbstractGeometryImageRenderSettings & settings ) const
inlinenoexcept

Render the specified AbstractGeometryImage into the provided IBitmap.

Parameters
bitmapBitmap to render into.
settingsSettings of abstract geometry image render.
Returns
KNotFound - image not found
KGeneral - any other error
KNotSupported in case of unsupported encoding.
KNoError on success.

◆ render() [2/2]

int gem::Image::render ( IBitmap & bitmap) const
inlinenoexceptinherited

Render the Image into the provided IBitmap.

Parameters
[in]bitmapThe IBitmap object where to render the image
Returns
KNoError on success. KNotSupported in case of unsupported encoding.

◆ renderTo()

template<typename ... TArgs>
StrongPointer< IBitmap > gem::Image::renderTo ( const Size & size,
TArgs &&... args ) const
inlineprotectednoexceptinherited

Render the Image into a new IBitmap of the specified size, using the provided additional arguments if needed.

Parameters
[in]sizeThe size of the bitmap to render into
[in]argsAdditional arguments to be forwarded to the Render function, if needed by the specific image type
Returns
A StrongPointer to the rendered IBitmap, or an empty StrongPointer if rendering failed.