SK_API const void* sk_pixmap_get_pixels(sk_pixmap_t* cpixmap);
SK_API sk_colortable_t* sk_pixmap_get_colortable(sk_pixmap_t* cpixmap);
+SK_API bool sk_bitmapscaler_resize(const sk_pixmap_t* dst, const sk_pixmap_t* src, sk_bitmapscaler_resizemethod_t method);
+
SK_C_PLUS_PLUS_END_GUARD
#endif
typedef struct sk_pixelref_factory_t sk_pixelref_factory_t;
typedef enum {
+ BOX_SK_BITMAP_SCALER_RESIZE_METHOD,
+ TRIANGLE_SK_BITMAP_SCALER_RESIZE_METHOD,
+ LANCZOS3_SK_BITMAP_SCALER_RESIZE_METHOD,
+ HAMMING_SK_BITMAP_SCALER_RESIZE_METHOD,
+ MITCHELL_SK_BITMAP_SCALER_RESIZE_METHOD,
+} sk_bitmapscaler_resizemethod_t;
+
+typedef enum {
TOP_LEFT_GR_SURFACE_ORIGIN = 1,
BOTTOM_LEFT_GR_SURFACE_ORIGIN,
} gr_surfaceorigin_t;
#include "sk_types_priv.h"
#include "SkShadowMaskFilter.h"
+#include "SkBitmapScaler.h"
#if __cplusplus >= 199711L
static_assert ((int)GrBackend::kOpenGL_GrBackend == (int)OPENGL_GR_BACKEND, ASSERT_MSG(GrBackend, gr_backend_t));
static_assert ((int)GrBackend::kVulkan_GrBackend == (int)VULKAN_GR_BACKEND, ASSERT_MSG(GrBackend, gr_backend_t));
+// sk_bitmapscaler_resizemethod_t
+static_assert ((int)SkBitmapScaler::ResizeMethod::RESIZE_BOX == (int)BOX_SK_BITMAP_SCALER_RESIZE_METHOD, ASSERT_MSG(SkBitmapScaler::ResizeMethod, sk_bitmapscaler_resizemethod_t));
+static_assert ((int)SkBitmapScaler::ResizeMethod::RESIZE_TRIANGLE == (int)TRIANGLE_SK_BITMAP_SCALER_RESIZE_METHOD, ASSERT_MSG(SkBitmapScaler::ResizeMethod, sk_bitmapscaler_resizemethod_t));
+static_assert ((int)SkBitmapScaler::ResizeMethod::RESIZE_LANCZOS3 == (int)LANCZOS3_SK_BITMAP_SCALER_RESIZE_METHOD, ASSERT_MSG(SkBitmapScaler::ResizeMethod, sk_bitmapscaler_resizemethod_t));
+static_assert ((int)SkBitmapScaler::ResizeMethod::RESIZE_HAMMING == (int)HAMMING_SK_BITMAP_SCALER_RESIZE_METHOD, ASSERT_MSG(SkBitmapScaler::ResizeMethod, sk_bitmapscaler_resizemethod_t));
+static_assert ((int)SkBitmapScaler::ResizeMethod::RESIZE_MITCHELL == (int)MITCHELL_SK_BITMAP_SCALER_RESIZE_METHOD, ASSERT_MSG(SkBitmapScaler::ResizeMethod, sk_bitmapscaler_resizemethod_t));
+
// SkBudgeted
static_assert ((bool)SkBudgeted::kNo == (bool)false, ASSERT_MSG(SkBudgeted, bool));
static_assert ((bool)SkBudgeted::kYes == (bool)true, ASSERT_MSG(SkBudgeted, bool));
*/
#include "SkPixmap.h"
+#include "SkBitmapScaler.h"
#include "sk_pixmap.h"
{
return ToColorTable(AsPixmap(cpixmap)->ctable());
}
+
+bool sk_bitmapscaler_resize(const sk_pixmap_t* cdst, const sk_pixmap_t* csrc, sk_bitmapscaler_resizemethod_t method)
+{
+ const SkPixmap& dst = AsPixmap(*cdst);
+ const SkPixmap& src = AsPixmap(*csrc);
+ return SkBitmapScaler::Resize(dst, src, (SkBitmapScaler::ResizeMethod)method);
+}