diff options
author | Mattias Andrée <maandree@kth.se> | 2020-04-28 18:47:10 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2020-04-28 18:47:10 +0200 |
commit | 9761455b328c86d8caedbf2f8ebd1bec8936e749 (patch) | |
tree | 81dd4f0982ae15a4dfe9f15ff5ce9342756f5a81 /libskrift.h | |
parent | Add code (untested) for applying glyphs to an image (diff) | |
download | libskrift-9761455b328c86d8caedbf2f8ebd1bec8936e749.tar.gz libskrift-9761455b328c86d8caedbf2f8ebd1bec8936e749.tar.bz2 libskrift-9761455b328c86d8caedbf2f8ebd1bec8936e749.tar.xz |
Fix drawing issues (there is still some left)
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r-- | libskrift.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libskrift.h b/libskrift.h index 93adb79..aeeaad2 100644 --- a/libskrift.h +++ b/libskrift.h @@ -184,6 +184,13 @@ struct libskrift_colour { #define LIBSKRIFT_NO_SAVED_GRAPHEME {0, 0} +#define LIBSKRIFT_PREMULTIPLY(OPACITY, ALPHA, RED, GREEN, BLUE)\ + {(OPACITY),\ + (ALPHA) * (OPACITY),\ + (RED) * (ALPHA) * (OPACITY),\ + (GREEN) * (ALPHA) * (OPACITY),\ + (BLUE) * (ALPHA) * (OPACITY)} + _LIBSKRIFT_GCC_ONLY(__attribute__((__const__, __warn_unused_result__))) inline double @@ -253,6 +260,10 @@ _LIBSKRIFT_GCC_ONLY(__attribute__((__nonnull__(1, 2, 6)))) int libskrift_apply_glyph(LIBSKRIFT_CONTEXT *, const struct libskrift_glyph *, const struct libskrift_colour *, int16_t, int16_t, struct libskrift_image *); +_LIBSKRIFT_GCC_ONLY(__attribute__((__nonnull__(1, 2, 6)))) +int libskrift_draw_text(LIBSKRIFT_CONTEXT *, const char *, const struct libskrift_colour *, + int16_t, int16_t, struct libskrift_image *); + _LIBSKRIFT_GCC_ONLY(__attribute__((__nonnull__))) void libskrift_srgb_preprocess(struct libskrift_image *, size_t, size_t, size_t, size_t); |