SK_C_API sk_colorfilter_t* sk_colorfilter_new_compose(sk_colorfilter_t* outer, sk_colorfilter_t* inner);
SK_C_API sk_colorfilter_t* sk_colorfilter_new_color_matrix(const float array[20]);
SK_C_API sk_colorfilter_t* sk_colorfilter_new_luma_color(void);
+SK_C_API sk_colorfilter_t* sk_colorfilter_new_high_contrast(const sk_highcontrastconfig_t* config);
SK_C_API sk_colorfilter_t* sk_colorfilter_new_table(const uint8_t table[256]);
SK_C_API sk_colorfilter_t* sk_colorfilter_new_table_argb(const uint8_t tableA[256], const uint8_t tableR[256], const uint8_t tableG[256], const uint8_t tableB[256]);
SK_C_API sk_imagefilter_t* sk_imagefilter_new_magnifier(
const sk_rect_t* src,
float inset,
- sk_imagefilter_t* input /*NULL*/);
+ sk_imagefilter_t* input, /*NULL*/
+ const sk_imagefilter_croprect_t* cropRect /*NULL*/);
SK_C_API sk_imagefilter_t* sk_imagefilter_new_matrix_convolution(
const sk_isize_t* kernelSize,
const float kernel[],
sk_imagefilter_t* background,
sk_imagefilter_t* foreground /*NULL*/,
const sk_imagefilter_croprect_t* cropRect /*NULL*/);
+SK_C_API sk_imagefilter_t* sk_imagefilter_new_image_source(
+ sk_image_t* image,
+ const sk_rect_t* srcRect,
+ const sk_rect_t* dstRect,
+ sk_filter_quality_t filterQuality);
+SK_C_API sk_imagefilter_t* sk_imagefilter_new_image_source_default(
+ sk_image_t* image);
+SK_C_API sk_imagefilter_t* sk_imagefilter_new_paint(
+ const sk_paint_t* paint,
+ const sk_imagefilter_croprect_t* cropRect /*NULL*/);
SK_C_PLUS_PLUS_END_GUARD
SK_C_API sk_path_effect_t* sk_path_effect_create_sum(sk_path_effect_t* first, sk_path_effect_t* second);
SK_C_API sk_path_effect_t* sk_path_effect_create_discrete(float segLength, float deviation, uint32_t seedAssist /*0*/);
SK_C_API sk_path_effect_t* sk_path_effect_create_corner(float radius);
+SK_C_API sk_path_effect_t* sk_path_effect_create_arc_to(float radius);
SK_C_API sk_path_effect_t* sk_path_effect_create_1d_path(const sk_path_t* path, float advance, float phase, sk_path_effect_1d_style_t style);
SK_C_API sk_path_effect_t* sk_path_effect_create_2d_line(float width, const sk_matrix_t* matrix);
SK_C_API sk_path_effect_t* sk_path_effect_create_2d_path(const sk_matrix_t* matrix, const sk_path_t* path);
float fWX, fWY;
} sk_colorspaceprimaries_t;
+typedef enum {
+ NO_INVERT_SK_HIGH_CONTRAST_CONFIG_INVERT_STYLE,
+ INVERT_BRIGHTNESS_SK_HIGH_CONTRAST_CONFIG_INVERT_STYLE,
+ INVERT_LIGHTNESS_SK_HIGH_CONTRAST_CONFIG_INVERT_STYLE,
+} sk_highcontrastconfig_invertstyle_t;
+
+typedef struct {
+ bool fGrayscale;
+ sk_highcontrastconfig_invertstyle_t fInvertStyle;
+ float fContrast;
+} sk_highcontrastconfig_t;
+
SK_C_PLUS_PLUS_END_GUARD
#endif
return ToColorFilter(filter.release());
}
+sk_colorfilter_t* sk_colorfilter_new_high_contrast(const sk_highcontrastconfig_t* config) {
+
+ sk_sp<SkColorFilter> filter = SkHighContrastFilter::Make(AsHighContrastConfig(*config));
+ return ToColorFilter(filter.release());
+}
+
sk_colorfilter_t* sk_colorfilter_new_table(const uint8_t table[256]) {
sk_sp<SkColorFilter> filter = SkTableColorFilter::Make(table);
static_assert ((int)SkColorSpace::RenderTargetGamma::kLinear_RenderTargetGamma == (int)LINEAR_SK_COLORSPACE_RENDER_TARGET_GAMMA, ASSERT_MSG(SkColorSpace::RenderTargetGamma, sk_colorspace_render_target_gamma_t));
static_assert ((int)SkColorSpace::RenderTargetGamma::kSRGB_RenderTargetGamma == (int)SRGB_SK_COLORSPACE_RENDER_TARGET_GAMMA, ASSERT_MSG(SkColorSpace::RenderTargetGamma, sk_colorspace_render_target_gamma_t));
+// sk_highcontrastconfig_invertstyle_t
+static_assert ((int)SkHighContrastConfig::InvertStyle::kNoInvert == (int)NO_INVERT_SK_HIGH_CONTRAST_CONFIG_INVERT_STYLE, ASSERT_MSG(SkHighContrastConfig::InvertStyle, sk_highcontrastconfig_invertstyle_t));
+static_assert ((int)SkHighContrastConfig::InvertStyle::kInvertBrightness == (int)INVERT_BRIGHTNESS_SK_HIGH_CONTRAST_CONFIG_INVERT_STYLE, ASSERT_MSG(SkHighContrastConfig::InvertStyle, sk_highcontrastconfig_invertstyle_t));
+static_assert ((int)SkHighContrastConfig::InvertStyle::kInvertLightness == (int)INVERT_LIGHTNESS_SK_HIGH_CONTRAST_CONFIG_INVERT_STYLE, ASSERT_MSG(SkHighContrastConfig::InvertStyle, sk_highcontrastconfig_invertstyle_t));
+
#if SK_SUPPORT_GPU
// gr_surfaceorigin_t
#include "SkTileImageFilter.h"
#include "SkXfermodeImageFilter.h"
#include "SkArithmeticImageFilter.h"
+#include "SkImageSource.h"
+#include "SkPaintImageFilter.h"
#include "sk_imagefilter.h"
sk_imagefilter_t* sk_imagefilter_new_magnifier(
const sk_rect_t* src,
float inset,
- sk_imagefilter_t* input /*NULL*/) {
+ sk_imagefilter_t* input, /*NULL*/
+ const sk_imagefilter_croprect_t* cropRect) {
sk_sp<SkImageFilter> filter = SkMagnifierImageFilter::Make(
*AsRect(src),
inset,
- sk_ref_sp(AsImageFilter(input)));
+ sk_ref_sp(AsImageFilter(input)),
+ AsImageFilterCropRect(cropRect));
return ToImageFilter(filter.release());
}
AsImageFilterCropRect(cropRect));
return ToImageFilter(filter.release());
}
+
+sk_imagefilter_t* sk_imagefilter_new_image_source(
+ sk_image_t* image,
+ const sk_rect_t* srcRect,
+ const sk_rect_t* dstRect,
+ sk_filter_quality_t filterQuality) {
+
+ sk_sp<SkImageFilter> filter = SkImageSource::Make(
+ sk_ref_sp(AsImage(image)),
+ *AsRect(srcRect),
+ *AsRect(dstRect),
+ (SkFilterQuality)filterQuality);
+ return ToImageFilter(filter.release());
+}
+
+sk_imagefilter_t* sk_imagefilter_new_image_source_default(
+ sk_image_t* image) {
+
+ sk_sp<SkImageFilter> filter = SkImageSource::Make(
+ sk_ref_sp(AsImage(image)));
+ return ToImageFilter(filter.release());
+}
+
+sk_imagefilter_t* sk_imagefilter_new_paint(
+ const sk_paint_t* paint,
+ const sk_imagefilter_croprect_t* cropRect /*NULL*/) {
+
+ sk_sp<SkImageFilter> filter = SkPaintImageFilter::Make(
+ AsPaint(*paint),
+ AsImageFilterCropRect(cropRect));
+ return ToImageFilter(filter.release());
+}
#include "Sk1DPathEffect.h"
#include "Sk2DPathEffect.h"
#include "SkDashPathEffect.h"
+#include "SkArcToPathEffect.h"
#include "SkPath.h"
#include "sk_patheffect.h"
return ToPathEffect(SkCornerPathEffect::Make(radius).release());
}
+sk_path_effect_t* sk_path_effect_create_arc_to(float radius)
+{
+ return ToPathEffect(SkArcToPathEffect::Make(radius).release());
+}
+
sk_path_effect_t* sk_path_effect_create_1d_path(const sk_path_t* path, float advance, float phase, sk_path_effect_1d_style_t style)
{
return ToPathEffect(SkPath1DPathEffect::Make(AsPath(*path), advance, phase, (SkPath1DPathEffect::Style)style).release());
static_assert (sizeof (sk_codec_frameinfo_t) == sizeof (SkCodec::FrameInfo), ASSERT_MSG(SkCodec::FrameInfo, sk_codec_frameinfo_t));
static_assert (sizeof (sk_colorspace_transfer_fn_t) == sizeof (SkColorSpaceTransferFn), ASSERT_MSG(SkColorSpaceTransferFn, sk_colorspace_transfer_fn_t));
static_assert (sizeof (sk_colorspaceprimaries_t) == sizeof (SkColorSpacePrimaries), ASSERT_MSG(SkColorSpacePrimaries, sk_colorspaceprimaries_t));
+static_assert (sizeof (sk_highcontrastconfig_t) == sizeof (SkHighContrastConfig), ASSERT_MSG(SkHighContrastConfig, sk_highcontrastconfig_t));
#if SK_SUPPORT_GPU
static_assert (sizeof (gr_backend_rendertarget_desc_t) == sizeof (GrBackendRenderTargetDesc), ASSERT_MSG(GrBackendRenderTargetDesc, gr_backend_rendertarget_desc_t));
#include "SkEncodedInfo.h"
#include "SkTime.h"
#include "SkCamera.h"
+#include "SkHighContrastFilter.h"
#include "sk_path.h"
#include "sk_paint.h"
return reinterpret_cast<const SkImage*>(cimage);
}
+static inline SkImage* AsImage(sk_image_t* cimage) {
+ return reinterpret_cast<SkImage*>(cimage);
+}
+
static inline sk_image_t* ToImage(SkImage* cimage) {
return reinterpret_cast<sk_image_t*>(cimage);
}
return reinterpret_cast<const sk_matrix44_t*>(p);
}
+static inline const SkHighContrastConfig* AsHighContrastConfig(const sk_highcontrastconfig_t* p) {
+ return reinterpret_cast<const SkHighContrastConfig*>(p);
+}
+
+static inline const SkHighContrastConfig& AsHighContrastConfig(const sk_highcontrastconfig_t& p) {
+ return reinterpret_cast<const SkHighContrastConfig&>(p);
+}
+
+static inline SkHighContrastConfig* AsHighContrastConfig(sk_highcontrastconfig_t* p) {
+ return reinterpret_cast<SkHighContrastConfig*>(p);
+}
+
+static inline SkHighContrastConfig& AsHighContrastConfig(sk_highcontrastconfig_t& p) {
+ return reinterpret_cast<SkHighContrastConfig&>(p);
+}
+
+static inline sk_highcontrastconfig_t* ToHighContrastConfig(SkHighContrastConfig *p) {
+ return reinterpret_cast<sk_highcontrastconfig_t*>(p);
+}
+
+static inline sk_highcontrastconfig_t& ToHighContrastConfig(SkHighContrastConfig &p) {
+ return reinterpret_cast<sk_highcontrastconfig_t&>(p);
+}
+
+static inline const sk_highcontrastconfig_t* ToHighContrastConfig(const SkHighContrastConfig *p) {
+ return reinterpret_cast<const sk_highcontrastconfig_t*>(p);
+}
+
+static inline const sk_highcontrastconfig_t& ToHighContrastConfig(const SkHighContrastConfig &p) {
+ return reinterpret_cast<const sk_highcontrastconfig_t&>(p);
+}
+
static inline void from_c(const sk_matrix_t* cmatrix, SkMatrix* matrix) {
matrix->setAll(
cmatrix->mat[0], cmatrix->mat[1], cmatrix->mat[2],