SK_C_API void sk_bitmap_set_pixels(sk_bitmap_t* cbitmap, void* pixels, sk_colortable_t* ctable);
SK_C_API bool sk_bitmap_peek_pixels(sk_bitmap_t* cbitmap, sk_pixmap_t* cpixmap);
SK_C_API bool sk_bitmap_extract_subset(sk_bitmap_t* cbitmap, sk_bitmap_t* dst, sk_irect_t* subset);
-
+SK_C_API bool sk_bitmap_extract_alpha(sk_bitmap_t* cbitmap, sk_bitmap_t* dst, const sk_paint_t* paint, sk_ipoint_t* offset);
SK_C_PLUS_PLUS_END_GUARD
SkBitmap* bmp = AsBitmap(cbitmap);
SkBitmap* dst = AsBitmap(cdst);
return bmp->extractSubset(dst, AsIRect(*subset));
-}
\ No newline at end of file
+}
+
+bool sk_bitmap_extract_alpha(sk_bitmap_t* cbitmap, sk_bitmap_t* cdst, const sk_paint_t* paint, sk_ipoint_t* offset)
+{
+ SkBitmap* bmp = AsBitmap(cbitmap);
+ SkBitmap* dst = AsBitmap(cdst);
+ return bmp->extractAlpha(dst, AsPaint(paint), AsIPoint(offset));
+}
return reinterpret_cast<const SkIPoint*>(p);
}
+static inline SkIPoint* AsIPoint(sk_ipoint_t* p) {
+ return reinterpret_cast<SkIPoint*>(p);
+}
+
static inline const SkSize& AsSize(const sk_size_t& p) {
return reinterpret_cast<const SkSize&>(p);
}