73 void draw(NVGcontext* vg,
float x,
float y,
float width,
float height,
Style style,
FrameContext* ctx)
override;
146 void setImageAsync(std::function<
void(std::function<
void(
const std::string&,
size_t length)>)> cb);
216 std::string themeImageKey;
217 std::shared_ptr<ThemeImage> themeImage;
218 std::shared_ptr<ThemeImage> themeImagePending;
219 bool settingThemeImage =
false;
220 bool followingTheme =
false;
223 std::shared_ptr<char> themeToken;
226 void refreshThemeImage();
227 void stopFollowingTheme();
CallbacksList::iterator Subscription
Definition event.hpp:45
Definition frame_context.hpp:30
const std::string & getThemeImage() const
The image slot followed (setThemeImage()), "" for none.
Definition image.hpp:138
float originalImageWidth
Definition image.hpp:198
float originalImageHeight
Definition image.hpp:199
unsigned asyncGeneration
Bumped each time the image is set: an async load set before is stale.
Definition image.hpp:209
void draw(NVGcontext *vg, float x, float y, float width, float height, Style style, FrameContext *ctx) override
float getOriginalImageHeight()
float imageX
Definition image.hpp:201
void setImageFromRGBA(const unsigned char *pixels, int width, int height)
float imageWidth
Definition image.hpp:204
ImageScalingType scalingType
Definition image.hpp:186
bool freeTexture
Definition image.hpp:206
void setImageFromRes(const std::string &name)
void releaseTexture()
Deletes the texture if owned, or hands it back to TextureCache.
ImageScalingType getScalingType()
See setScalingType().
Image()
An empty image (FIT, centred, linear interpolation).
void invalidateImageBounds()
float getOriginalImageWidth()
The size of the picture shown, in pixels.
void setInterpolation(ImageInterpolation interpolation)
ImageInterpolation interpolation
Definition image.hpp:188
float imageY
Definition image.hpp:202
NVGpaint paint
Definition image.hpp:192
size_t checkCache(const std::string &path)
virtual void innerSetImage(int texture)
Shows the nanovg image texture (what every setImage* ends with).
void clear()
Shows nothing (the texture freed when the image owns it).
void setFreeTexture(bool value)
void setImageAsync(std::function< void(std::function< void(const std::string &, size_t length)>)> cb)
void setThemeImage(const std::string &key)
void setImageFromFile(const std::string &path)
int getTexture()
The nanovg image shown, 0 for none.
float imageHeight
Definition image.hpp:203
void setImageAlign(ImageAlignment align)
int texture
Definition image.hpp:190
void setImageFromFileAsync(const std::string &path)
ImageAlignment align
Definition image.hpp:187
void setScalingType(ImageScalingType scalingType)
void setImageFromMem(const unsigned char *data, int size)
static View * create()
Makes an image for XML (<aurore:Image>).
Simple wrapper around StyleValues for the array operator.
Definition style.hpp:115
Definition actions.hpp:25
ImageAlignment
Alignment of the image inside the view for FIT and CROP scaling types.
Definition image.hpp:53
ImageInterpolation
This dictates what interpolation to use when down / up scaling the image.
Definition image.hpp:46
ImageScalingType
Definition image.hpp:33
@ FIT
The image is scaled to fit the view boundaries, aspect ratio is conserved.
@ FILL
The image is scaled to fill the view boundaries, aspect ratio is conserved.
@ BOTTOM
decor.bottom: along its bottom edge
@ TOP
decor.top: a strip along the top edge of the screen