From 9761455b328c86d8caedbf2f8ebd1bec8936e749 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Tue, 28 Apr 2020 18:47:10 +0200 Subject: Fix drawing issues (there is still some left) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- libskrift.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'libskrift.h') 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); -- cgit v1.2.3-70-g09d2