"$_include/c/sk_patheffect.h",
"$_include/c/sk_picture.h",
"$_include/c/sk_pixmap.h",
+ "$_include/c/sk_pixelserializer.h",
"$_include/c/sk_region.h",
"$_include/c/sk_shader.h",
"$_include/c/sk_stream.h",
"$_src/c/sk_patheffect.cpp",
"$_src/c/sk_picture.cpp",
"$_src/c/sk_pixmap.cpp",
+ "$_src/c/sk_pixelserializer.cpp",
"$_src/c/sk_region.cpp",
"$_src/c/sk_shader.cpp",
"$_src/c/sk_stream.cpp",
SK_C_API bool sk_image_read_pixels_into_pixmap(const sk_image_t* image, const sk_pixmap_t* dst, int srcX, int srcY, sk_image_caching_hint_t cachingHint);
SK_C_API bool sk_image_scale_pixels(const sk_image_t* image, const sk_pixmap_t* dst, sk_filter_quality_t quality, sk_image_caching_hint_t cachingHint);
SK_C_API sk_data_t* sk_image_encode(const sk_image_t*);
+SK_C_API sk_data_t* sk_image_encode_with_serializer(const sk_image_t*, sk_pixelserializer_t* serializer);
SK_C_API sk_data_t* sk_image_encode_specific(const sk_image_t* cimage, sk_encoded_image_format_t encoder, int quality);
SK_C_API sk_image_t* sk_image_make_subset(const sk_image_t* cimage, const sk_irect_t* subset);
SK_C_API sk_image_t* sk_image_make_non_texture_image(const sk_image_t* cimage);
--- /dev/null
+/*
+ * Copyright 2017 Xamarin Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef sk_pixelserializer_DEFINED
+#define sk_pixelserializer_DEFINED
+
+#include "sk_types.h"
+
+SK_C_PLUS_PLUS_BEGIN_GUARD
+
+SK_C_API void sk_pixelserializer_unref(sk_pixelserializer_t* cserializer);
+SK_C_API bool sk_pixelserializer_use_encoded_data(sk_pixelserializer_t* cserializer, const void* data, size_t len);
+SK_C_API sk_data_t* sk_pixelserializer_encode(sk_pixelserializer_t* cserializer, const sk_pixmap_t* cpixmap);
+
+SK_C_PLUS_PLUS_END_GUARD
+
+#endif
*/
typedef struct sk_bitmap_t sk_bitmap_t;
typedef struct sk_pixmap_t sk_pixmap_t;
+typedef struct sk_pixelserializer_t sk_pixelserializer_t;
typedef struct sk_colorfilter_t sk_colorfilter_t;
typedef struct sk_imagefilter_t sk_imagefilter_t;
typedef struct sk_imagefilter_croprect_t sk_imagefilter_croprect_t;
return ToData(AsImage(cimage)->encode());
}
+sk_data_t* sk_image_encode_with_serializer(const sk_image_t* cimage, sk_pixelserializer_t* serializer) {
+ return ToData(AsImage(cimage)->encode(AsPixelSerializer(serializer)));
+}
+
sk_data_t* sk_image_encode_specific(const sk_image_t* cimage, sk_encoded_image_format_t encoder, int quality) {
return ToData(AsImage(cimage)->encode((SkEncodedImageFormat)encoder, quality));
}
--- /dev/null
+/*
+ * Copyright 2017 Xamarin Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include "SkPixelSerializer.h"
+
+#include "sk_pixelserializer.h"
+
+#include "sk_types_priv.h"
+
+void sk_pixelserializer_unref(sk_pixelserializer_t* cserializer)
+{
+ SkSafeUnref(AsPixelSerializer(cserializer));
+}
+
+bool sk_pixelserializer_use_encoded_data(sk_pixelserializer_t* cserializer, const void* data, size_t len)
+{
+ return AsPixelSerializer(cserializer)->useEncodedData(data, len);
+}
+
+sk_data_t* sk_pixelserializer_encode(sk_pixelserializer_t* cserializer, const sk_pixmap_t* cpixmap)
+{
+ return ToData(AsPixelSerializer(cserializer)->encode(AsPixmap(*cpixmap)));
+}
return reinterpret_cast<SkPixmap&>(cpixmap);
}
+static inline const sk_pixmap_t& ToPixmap(const SkPixmap& pixmap) {
+ return reinterpret_cast<const sk_pixmap_t&>(pixmap);
+}
+
static inline sk_pixmap_t* ToPixmap(SkPixmap* pixmap) {
return reinterpret_cast<sk_pixmap_t*>(pixmap);
}
+static inline const SkPixelSerializer* AsPixelSerializer(const sk_pixelserializer_t* cpixelserializer) {
+ return reinterpret_cast<const SkPixelSerializer*>(cpixelserializer);
+}
+
+static inline const SkPixelSerializer& AsPixelSerializer(const sk_pixelserializer_t& cpixelserializer) {
+ return reinterpret_cast<const SkPixelSerializer&>(cpixelserializer);
+}
+
+static inline SkPixelSerializer* AsPixelSerializer(sk_pixelserializer_t* cpixelserializer) {
+ return reinterpret_cast<SkPixelSerializer*>(cpixelserializer);
+}
+
+static inline SkPixelSerializer& AsPixelSerializer(sk_pixelserializer_t& cpixelserializer) {
+ return reinterpret_cast<SkPixelSerializer&>(cpixelserializer);
+}
+
+static inline sk_pixelserializer_t* ToPixelSerializer(SkPixelSerializer* pixelserializer) {
+ return reinterpret_cast<sk_pixelserializer_t*>(pixelserializer);
+}
+
static inline SkMask* AsMask(sk_mask_t* cmask) {
return reinterpret_cast<SkMask*>(cmask);
}