Added binding for bit shifts
authorMatthew Leibowitz <mattleibow@live.com>
Tue, 7 Mar 2017 10:33:18 +0000 (07:33 -0300)
committerMatthew Leibowitz <mattleibow@live.com>
Tue, 7 Mar 2017 10:33:18 +0000 (07:33 -0300)
include/c/sk_pixmap.h
src/c/sk_pixmap.cpp

index 4cf7216..5cfab3a 100644 (file)
@@ -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
 
index fbe1ce0..743a320 100644 (file)
@@ -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;
+}