Loading...
Searching...
No Matches
icon_cache.h
Go to the documentation of this file.
1
10#pragma once
11#include <pebble.h>
12
17
20#ifndef ICON_AUTOTRIM
21#define ICON_AUTOTRIM 1
22#endif
23
26#ifndef ICON_TRIM_LOG
27#define ICON_TRIM_LOG 0
28#endif
29
33typedef struct
34{
35 int8_t n;
36 int8_t e;
37 int8_t s;
38 int8_t w;
40
52GBitmap *icon_get(uint32_t res);
53
60GSize icon_size(uint32_t res);
61
70IconMargins icon_margins(uint32_t res);
71
80IconMargins icon_margins_of(GBitmap *bmp);
81
90void icon_tint(GBitmap *bmp, GColor color);
91
102void icon_align_trim(GAlign align, IconMargins margins, int *trim_dx, int *trim_dy);
103
107void icons_cleanup(void);
108
IconMargins icon_margins(uint32_t res)
The measured transparent margins of a cached icon. Loads and measures it the first time,...
Definition icon_cache.c:254
void icons_cleanup(void)
Frees every icon picture in the cache.
Definition icon_cache.c:283
GBitmap * icon_get(uint32_t res)
Hands back an icon picture from the cache, loading it the first time it is asked for.
Definition icon_cache.c:248
GSize icon_size(uint32_t res)
The size of an icon in pixels. Gives back GSize(0,0) if it could not load.
Definition icon_cache.c:260
void icon_align_trim(GAlign align, IconMargins m, int *trim_dx, int *trim_dy)
The extra offset that pins the opaque box rather than the full bitmap at a given anchor....
Definition icon_cache.c:266
IconMargins icon_margins_of(GBitmap *bmp)
Measures the transparent margins of any bitmap, for icons that live outside the shared cache such as ...
Definition icon_cache.c:141
void icon_tint(GBitmap *bmp, GColor color)
Paints an icon a different colour. It only works on icons saved as little colour-table pictures....
Definition icon_cache.c:59
The transparent border around an icon's opaque art, in pixels per side.
Definition icon_cache.h:34
int8_t e
Transparent margin on the east (right) side, in pixels.
Definition icon_cache.h:36
int8_t n
Transparent margin on the north (top) side, in pixels.
Definition icon_cache.h:35
int8_t w
Transparent margin on the west (left) side, in pixels.
Definition icon_cache.h:38
int8_t s
Transparent margin on the south (bottom) side, in pixels.
Definition icon_cache.h:37