skia2/modules/svg/include/SkSVGFeGaussianBlur.h
Tyler Denniston 187d8117cb [svg] Implement feGaussianBlur
This filter implementation should be complete, but note we are still
not quite passing the W3C filters-gauss-* tests because our filters
currently operate in sRGB and not linear RGB (which is quite noticable
in some of the blur tests).

Bug: skia:10841
Change-Id: I706cde879ef6eb47ce586279999536cf67237f13
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/352506
Commit-Queue: Tyler Denniston <tdenniston@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2021-01-12 16:26:16 +00:00

42 lines
1.1 KiB
C++

/*
* Copyright 2020 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkSVGFeGaussianBlur_DEFINED
#define SkSVGFeGaussianBlur_DEFINED
#include "modules/svg/include/SkSVGFe.h"
#include "modules/svg/include/SkSVGTypes.h"
class SkSVGFeGaussianBlur : public SkSVGFe {
public:
struct StdDeviation {
SkSVGNumberType fX;
SkSVGNumberType fY;
};
static sk_sp<SkSVGFeGaussianBlur> Make() {
return sk_sp<SkSVGFeGaussianBlur>(new SkSVGFeGaussianBlur());
}
SVG_ATTR(StdDeviation, StdDeviation, StdDeviation({0, 0}))
protected:
sk_sp<SkImageFilter> onMakeImageFilter(const SkSVGRenderContext&,
const SkSVGFilterContext&) const override;
std::vector<SkSVGFeInputType> getInputs() const override { return {this->getIn()}; }
bool parseAndSetAttribute(const char*, const char*) override;
private:
SkSVGFeGaussianBlur() : INHERITED(SkSVGTag::kFeGaussianBlur) {}
using INHERITED = SkSVGFe;
};
#endif // SkSVGFeGaussianBlur_DEFINED