AUI Framework
develop
Cross-platform base for C++ UI apps
|
An abstract image that determines itself how it is displayed. Essentially an abstraction from vector and raster graphics. More...
#include <AUI/Image/IDrawable.h>
Classes | |
struct | Params |
Public Member Functions | |
virtual AImage | rasterize (glm::ivec2 imageSize) |
Converts possibly vector drawable to a raster image. | |
virtual void | draw (IRenderer &render, const IDrawable::Params ¶ms)=0 |
Called when the image needs to be displayed. It is assumed that the renderer is already set to the desired state (coordinates, color, etc.) | |
virtual glm::ivec2 | getSizeHint ()=0 |
virtual bool | isDpiDependent () const |
Static Public Member Functions | |
static API_AUI_VIEWS _< IDrawable > | fromUrl (const AUrl &url) noexcept |
Creates a drawable from an url. | |
An abstract image that determines itself how it is displayed. Essentially an abstraction from vector and raster graphics.
|
pure virtual |
Called when the image needs to be displayed. It is assumed that the renderer is already set to the desired state (coordinates, color, etc.)
Implemented in AAnimatedDrawable, AImageDrawable, ANoiseDrawable, and AVectorDrawable.
Creates a drawable from an url.
url | url to create a drawable from |
If some kind of error occurs during loading the drawable, a log entry [Drawable] is outputted with detailed description of an error. The reason is we don't want to crash our application if we didn't loaded some graphics, which is usually pretty optional stuff. The user can still do his job with the application without fancy images.
|
pure virtual |
Implemented in AAnimatedDrawable, AImageDrawable, ANoiseDrawable, and AVectorDrawable.
|
inlinevirtual |
Reimplemented in AVectorDrawable.
|
virtual |
Converts possibly vector drawable to a raster image.
imageSize | image size |
TODO Unimplemented for all drawables except raster image and svg
Reimplemented in AImageDrawable, and AVectorDrawable.