Aurore
A Switch-like interface for your app, on every screen
Loading...
Searching...
No Matches
aurore::ThemeImage Struct Reference

#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 {}
 

Detailed Description

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.

Member Enumeration Documentation

◆ State

enum class aurore::ThemeImage::State
strong
Enumerator
LOADING 
READY 
FAILED 

Constructor & Destructor Documentation

◆ ThemeImage() [1/2]

aurore::ThemeImage::ThemeImage ( )
default

◆ ThemeImage() [2/2]

aurore::ThemeImage::ThemeImage ( const ThemeImage &  )
delete

◆ ~ThemeImage()

aurore::ThemeImage::~ThemeImage ( )

Member Function Documentation

◆ draw()

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.

◆ operator=()

ThemeImage & aurore::ThemeImage::operator= ( const ThemeImage &  )
delete

◆ ready()

bool aurore::ThemeImage::ready ( ) const
inline

Member Data Documentation

◆ flags

int aurore::ThemeImage::flags = 0

◆ height

int aurore::ThemeImage::height = 0

◆ mask

bool aurore::ThemeImage::mask = false

◆ maxSide

int aurore::ThemeImage::maxSide = 0

◆ mean

NVGcolor aurore::ThemeImage::mean {}

◆ path

std::string aurore::ThemeImage::path

◆ state

State aurore::ThemeImage::state = State::LOADING

◆ texture

int aurore::ThemeImage::texture = 0

◆ width

int aurore::ThemeImage::width = 0

The documentation for this struct was generated from the following file: