Added a member to swizzle the R and B
authorMatthew Leibowitz <mattleibow@live.com>
Thu, 2 Nov 2017 22:04:04 +0000 (00:04 +0200)
committerMatthew Leibowitz <mattleibow@live.com>
Thu, 2 Nov 2017 22:04:04 +0000 (00:04 +0200)
include/c/sk_pixmap.h
src/c/sk_pixmap.cpp

index 53603cb..f775ac4 100644 (file)
@@ -37,6 +37,8 @@ SK_C_API bool sk_pixmap_encode_image(sk_wstream_t* dst, const sk_pixmap_t* src,
 
 SK_C_API bool sk_pixmap_read_pixels(const sk_pixmap_t* cpixmap, const sk_imageinfo_t* dstInfo, void* dstPixels, size_t dstRowBytes, int srcX, int srcY);
 
+SK_C_API void sk_swizzle_swap_rb(uint32_t* dest, const uint32_t* src, int count);
+
 SK_C_PLUS_PLUS_END_GUARD
 
 #endif
index edd64d8..db0d02f 100644 (file)
@@ -8,6 +8,7 @@
 #include "SkPixmap.h"
 #include "SkBitmapScaler.h"
 #include "SkImageEncoder.h"
+#include "SkSwizzle.h"
 
 #include "sk_pixmap.h"
 
@@ -116,3 +117,8 @@ bool sk_pixmap_read_pixels(const sk_pixmap_t* cpixmap, const sk_imageinfo_t* dst
 
     return AsPixmap(cpixmap)->readPixels(info, dstPixels, dstRowBytes, srcX, srcY);
 }
+
+void sk_swizzle_swap_rb(uint32_t* dest, const uint32_t* src, int count)
+{
+    SkSwapRB(dest, src, count);
+}