|
Aurore
A Switch-like interface for your app, on every screen
|
#include <aurore/core/theme_image.hpp>
Public Types | |
| enum class | State { LOADING , READY , FAILED } |
Public Member Functions | |
| bool | ready () const |
| bool | draw (NVGcontext *vg, float x, float y, float width, float height, BackgroundFit fit, const NVGcolor *tint=nullptr, float alpha=1.0f, float corner=0.0f) const |
| ThemeImage ()=default | |
| ThemeImage (const ThemeImage &)=delete | |
| ThemeImage & | operator= (const ThemeImage &)=delete |
| ~ThemeImage () | |
Public Attributes | |
| std::string | path |
| int | flags = 0 |
| int | maxSide = 0 |
| bool | mask = false |
| State | state = State::LOADING |
| int | texture = 0 |
| int | width = 0 |
| int | height = 0 |
| NVGcolor | mean {} |
A picture a theme file names (its background_image, its logo, icons, preview, an app's image slots): a texture made from it, at most MAX_WIDTH x MAX_HEIGHT (or its options' maxSide). Only the UI thread reads or changes it.
|
strong |
|
default |
|
delete |
| aurore::ThemeImage::~ThemeImage | ( | ) |
| bool aurore::ThemeImage::draw | ( | NVGcontext * | vg, |
| float | x, | ||
| float | y, | ||
| float | width, | ||
| float | height, | ||
| BackgroundFit | fit, | ||
| const NVGcolor * | tint = nullptr, |
||
| float | alpha = 1.0f, |
||
| float | corner = 0.0f |
||
| ) | const |
Draws it in the box x, y, width, height: CONTAIN fits it whole, centred, its ratio kept; COVER fills the box, centred, cut at its edges, within a rounded rectangle of corner; TILE and CENTER as background_fit says. tint (a mask's colour, ThemeImageOptions::mask) multiplies its pixels; else drawn as is, at alpha. False, nothing drawn, while it is not ready.
|
delete |
|
inline |
| int aurore::ThemeImage::flags = 0 |
| int aurore::ThemeImage::height = 0 |
| bool aurore::ThemeImage::mask = false |
| int aurore::ThemeImage::maxSide = 0 |
| NVGcolor aurore::ThemeImage::mean {} |
| std::string aurore::ThemeImage::path |
| State aurore::ThemeImage::state = State::LOADING |
| int aurore::ThemeImage::texture = 0 |
| int aurore::ThemeImage::width = 0 |