From fcfa9b998918103156389094801b84646065f01f Mon Sep 17 00:00:00 2001 From: Matthew Leibowitz Date: Tue, 7 Mar 2017 07:33:18 -0300 Subject: [PATCH] Added binding for bit shifts --- include/c/sk_pixmap.h | 1 + src/c/sk_pixmap.cpp | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/include/c/sk_pixmap.h b/include/c/sk_pixmap.h index 4cf7216..5cfab3a 100644 --- a/include/c/sk_pixmap.h +++ b/include/c/sk_pixmap.h @@ -31,6 +31,7 @@ SK_C_API sk_color_t sk_color_unpremultiply(const sk_pmcolor_t pmcolor); SK_C_API sk_pmcolor_t sk_color_premultiply(const sk_color_t color); SK_C_API void sk_color_unpremultiply_array(const sk_pmcolor_t* pmcolors, int size, sk_color_t* colors); SK_C_API void sk_color_premultiply_array(const sk_color_t* colors, int size, sk_pmcolor_t* pmcolors); +SK_C_API void sk_color_get_bit_shift(int* a, int* r, int* g, int* b); SK_C_PLUS_PLUS_END_GUARD diff --git a/src/c/sk_pixmap.cpp b/src/c/sk_pixmap.cpp index fbe1ce0..743a320 100644 --- a/src/c/sk_pixmap.cpp +++ b/src/c/sk_pixmap.cpp @@ -94,3 +94,10 @@ void sk_color_premultiply_array(const sk_color_t* colors, int size, sk_pmcolor_t pmcolors[i] = SkPreMultiplyColor(colors[i]); } } + +void sk_color_get_bit_shift(int* a, int* r, int* g, int* b) { + *a = (int)SK_A32_SHIFT; + *r = (int)SK_R32_SHIFT; + *g = (int)SK_G32_SHIFT; + *b = (int)SK_B32_SHIFT; +} -- 2.7.4