33class SharpenAdapter final :
public DiscardableAdapterBase<SharpenAdapter,
34 sksg::ExternalImageFilter> {
37 const AnimationBuilder& abuilder)
41 kSharpenAmount_Index = 0,
44 EffectBinder(jprops, abuilder,
this).bind(kSharpenAmount_Index, fAmount);
47 void onSync()
override {
48 SkScalar intensity = 1 + (fAmount * 0.01);
49 SkScalar discount = (1 - intensity) / 8.0;
51 discount, discount, discount,
52 discount, intensity, discount,
53 discount, discount, discount,
58 this->node()->setImageFilter(std::move(filter));
63 using INHERITED = DiscardableAdapterBase<SharpenAdapter, sksg::ExternalImageFilter>;
#define INHERITED(method,...)
static sk_sp< SkImageFilter > MatrixConvolution(const SkISize &kernelSize, const SkScalar kernel[], SkScalar gain, SkScalar bias, const SkIPoint &kernelOffset, SkTileMode tileMode, bool convolveAlpha, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
void attachDiscardableAdapter(sk_sp< T > adapter) const
static sk_sp< RenderNode > Make(sk_sp< RenderNode > child, sk_sp< ImageFilter > filter)
SK_API sk_sp< SkDocument > Make(SkWStream *dst, const SkSerialProcs *=nullptr, std::function< void(const SkPicture *)> onEndPage=nullptr)
static constexpr SkIPoint Make(int32_t x, int32_t y)
static constexpr SkISize Make(int32_t w, int32_t h)