From 9542bdd0ed2d581cdb4bd950ac3cd7e3bf899478 Mon Sep 17 00:00:00 2001 From: Ebrahim Byagowi Date: Mon, 29 Apr 2019 14:52:28 -0700 Subject: [PATCH] Add color channels getters ABI (#1513) So can be used with language wrappers --- src/hb-common.cc | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ src/hb-common.h | 40 +++++++++++----------------------------- 2 files changed, 64 insertions(+), 29 deletions(-) diff --git a/src/hb-common.cc b/src/hb-common.cc index 60d16c8..c453443 100644 --- a/src/hb-common.cc +++ b/src/hb-common.cc @@ -1160,6 +1160,59 @@ hb_variation_to_string (hb_variation_t *variation, buf[len] = '\0'; } +/** + * hb_color_get_alpha: + * + * + * + * Since: REPLACEME + */ +uint8_t +(hb_color_get_alpha) (hb_color_t color) +{ + return hb_color_get_alpha (color); +} + +/** + * hb_color_get_red: + * + * + * + * Since: REPLACEME + */ +uint8_t +(hb_color_get_red) (hb_color_t color) +{ + return hb_color_get_red (color); +} + +/** + * hb_color_get_green: + * + * + * + * Since: REPLACEME + */ +uint8_t +(hb_color_get_green) (hb_color_t color) +{ + return hb_color_get_green (color); +} + +/** + * hb_color_get_blue: + * + * + * + * Since: REPLACEME + */ +uint8_t +(hb_color_get_blue) (hb_color_t color) +{ + return hb_color_get_blue (color); +} + + /* If there is no visibility control, then hb-static.cc will NOT * define anything. Instead, we get it to define one set in here * only, so only libharfbuzz.so defines them, not other libs. */ diff --git a/src/hb-common.h b/src/hb-common.h index 371b2bf..edd9ffb 100644 --- a/src/hb-common.h +++ b/src/hb-common.h @@ -467,39 +467,21 @@ typedef uint32_t hb_color_t; #define HB_COLOR(b,g,r,a) ((hb_color_t) HB_TAG ((b),(g),(r),(a))) -/** - * hb_color_get_alpha: - * - * - * - * Since: 2.1.0 - */ +HB_EXTERN uint8_t +hb_color_get_alpha (hb_color_t color); #define hb_color_get_alpha(color) ((color) & 0xFF) -/** - * hb_color_get_red: - * - * - * - * Since: 2.1.0 - */ + +HB_EXTERN uint8_t +hb_color_get_red (hb_color_t color); #define hb_color_get_red(color) (((color) >> 8) & 0xFF) -/** - * hb_color_get_green: - * - * - * - * Since: 2.1.0 - */ + +HB_EXTERN uint8_t +hb_color_get_green (hb_color_t color); #define hb_color_get_green(color) (((color) >> 16) & 0xFF) -/** - * hb_color_get_blue: - * - * - * - * Since: 2.1.0 - */ -#define hb_color_get_blue(color) (((color) >> 24) & 0xFF) +HB_EXTERN uint8_t +hb_color_get_blue (hb_color_t color); +#define hb_color_get_blue(color) (((color) >> 24) & 0xFF) HB_END_DECLS -- 2.7.4