Flutter Engine
The Flutter Engine
Classes | Public Types | Static Public Member Functions | Protected Member Functions | List of all members
SkSVGFeMorphology Class Reference

#include <SkSVGFeMorphology.h>

Inheritance diagram for SkSVGFeMorphology:
SkSVGFe SkSVGHiddenContainer SkSVGContainer SkSVGTransformableNode SkSVGNode SkRefCnt SkRefCntBase

Classes

struct  Radius
 

Public Types

enum class  Operator { kErode , kDilate }
 

Static Public Member Functions

static sk_sp< SkSVGFeMorphologyMake ()
 
- Static Public Member Functions inherited from SkSVGFe
static bool IsFilterEffect (const sk_sp< SkSVGNode > &node)
 

Protected Member Functions

sk_sp< SkImageFilteronMakeImageFilter (const SkSVGRenderContext &, const SkSVGFilterContext &) const override
 
std::vector< SkSVGFeInputTypegetInputs () const override
 
bool parseAndSetAttribute (const char *, const char *) override
 
- Protected Member Functions inherited from SkSVGFe
 SkSVGFe (SkSVGTag t)
 
virtual sk_sp< SkImageFilteronMakeImageFilter (const SkSVGRenderContext &, const SkSVGFilterContext &) const =0
 
virtual std::vector< SkSVGFeInputTypegetInputs () const =0
 
bool parseAndSetAttribute (const char *, const char *) override
 
- Protected Member Functions inherited from SkSVGHiddenContainer
 SkSVGHiddenContainer (SkSVGTag t)
 
void onRender (const SkSVGRenderContext &) const final
 
- Protected Member Functions inherited from SkSVGContainer
 SkSVGContainer (SkSVGTag)
 
void onRender (const SkSVGRenderContext &) const override
 
SkPath onAsPath (const SkSVGRenderContext &) const override
 
SkRect onObjectBoundingBox (const SkSVGRenderContext &) const override
 
bool hasChildren () const final
 
template<typename NodeType , typename Func >
void forEachChild (Func func) const
 
- Protected Member Functions inherited from SkSVGTransformableNode
 SkSVGTransformableNode (SkSVGTag)
 
bool onPrepareToRender (SkSVGRenderContext *) const override
 
void onSetAttribute (SkSVGAttribute, const SkSVGValue &) override
 
void mapToParent (SkPath *) const
 
void mapToParent (SkRect *) const
 
- Protected Member Functions inherited from SkSVGNode
 SkSVGNode (SkSVGTag)
 
virtual bool onPrepareToRender (SkSVGRenderContext *) const
 
virtual void onRender (const SkSVGRenderContext &) const =0
 
virtual bool onAsPaint (const SkSVGRenderContext &, SkPaint *) const
 
virtual SkPath onAsPath (const SkSVGRenderContext &) const =0
 
virtual void onSetAttribute (SkSVGAttribute, const SkSVGValue &)
 
virtual bool hasChildren () const
 
virtual SkRect onObjectBoundingBox (const SkSVGRenderContext &) const
 

Additional Inherited Members

- Public Member Functions inherited from SkSVGFe
sk_sp< SkImageFiltermakeImageFilter (const SkSVGRenderContext &ctx, const SkSVGFilterContext &fctx) const
 
SkRect resolveFilterSubregion (const SkSVGRenderContext &, const SkSVGFilterContext &) const
 
virtual SkSVGColorspace resolveColorspace (const SkSVGRenderContext &, const SkSVGFilterContext &) const
 
void applyProperties (SkSVGRenderContext *) const
 
- Public Member Functions inherited from SkSVGContainer
void appendChild (sk_sp< SkSVGNode >) override
 
- Public Member Functions inherited from SkSVGTransformableNode
void setTransform (const SkSVGTransformType &t)
 
- Public Member Functions inherited from SkSVGNode
 ~SkSVGNode () override
 
SkSVGTag tag () const
 
virtual void appendChild (sk_sp< SkSVGNode >)=0
 
void render (const SkSVGRenderContext &) const
 
bool asPaint (const SkSVGRenderContext &, SkPaint *) const
 
SkPath asPath (const SkSVGRenderContext &) const
 
SkRect objectBoundingBox (const SkSVGRenderContext &) const
 
void setAttribute (SkSVGAttribute, const SkSVGValue &)
 
bool setAttribute (const char *attributeName, const char *attributeValue)
 
virtual bool parseAndSetAttribute (const char *name, const char *value)
 
- Public Member Functions inherited from SkRefCntBase
 SkRefCntBase ()
 
virtual ~SkRefCntBase ()
 
bool unique () const
 
void ref () const
 
void unref () const
 
- Static Protected Member Functions inherited from SkSVGNode
static SkMatrix ComputeViewboxMatrix (const SkRect &, const SkRect &, SkSVGPreserveAspectRatio)
 
- Protected Attributes inherited from SkSVGContainer
skia_private::STArray< 1, sk_sp< SkSVGNode >, truefChildren
 

Detailed Description

Definition at line 14 of file SkSVGFeMorphology.h.

Member Enumeration Documentation

◆ Operator

enum class SkSVGFeMorphology::Operator
strong
Enumerator
kErode 
kDilate 

Definition at line 21 of file SkSVGFeMorphology.h.

Member Function Documentation

◆ getInputs()

std::vector< SkSVGFeInputType > SkSVGFeMorphology::getInputs ( ) const
inlineoverrideprotectedvirtual

Implements SkSVGFe.

Definition at line 37 of file SkSVGFeMorphology.h.

37{ return {this->getIn()}; }

◆ Make()

static sk_sp< SkSVGFeMorphology > SkSVGFeMorphology::Make ( )
inlinestatic

Definition at line 26 of file SkSVGFeMorphology.h.

◆ onMakeImageFilter()

sk_sp< SkImageFilter > SkSVGFeMorphology::onMakeImageFilter ( const SkSVGRenderContext ctx,
const SkSVGFilterContext fctx 
) const
overrideprotectedvirtual

Implements SkSVGFe.

Definition at line 23 of file SkSVGFeMorphology.cpp.

24 {
25 const SkRect cropRect = this->resolveFilterSubregion(ctx, fctx);
26 const SkSVGColorspace colorspace = this->resolveColorspace(ctx, fctx);
27 sk_sp<SkImageFilter> input = fctx.resolveInput(ctx, this->getIn(), colorspace);
28
29 const auto r = SkV2{fRadius.fX, fRadius.fY}
31 switch (fOperator) {
33 return SkImageFilters::Erode(r.x, r.y, input, cropRect);
35 return SkImageFilters::Dilate(r.x, r.y, input, cropRect);
36 }
37
39}
#define SkUNREACHABLE
Definition: SkAssert.h:135
SkSVGColorspace
Definition: SkSVGTypes.h:719
static sk_sp< SkImageFilter > Erode(SkScalar radiusX, SkScalar radiusY, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
static sk_sp< SkImageFilter > Dilate(SkScalar radiusX, SkScalar radiusY, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
SkRect resolveFilterSubregion(const SkSVGRenderContext &, const SkSVGFilterContext &) const
Definition: SkSVGFe.cpp:54
virtual SkSVGColorspace resolveColorspace(const SkSVGRenderContext &, const SkSVGFilterContext &) const
Definition: SkSVGFe.cpp:84
sk_sp< SkImageFilter > resolveInput(const SkSVGRenderContext &, const SkSVGFeInputType &) const
const SkSVGObjectBoundingBoxUnits & primitiveUnits() const
OBBTransform transformForCurrentOBB(SkSVGObjectBoundingBoxUnits) const
float fX
x-axis value
Definition: SkPoint_impl.h:164
float fY
y-axis value
Definition: SkPoint_impl.h:165
Definition: SkM44.h:19

◆ parseAndSetAttribute()

bool SkSVGFeMorphology::parseAndSetAttribute ( const char *  name,
const char *  value 
)
overrideprotectedvirtual

Reimplemented from SkSVGFe.

Definition at line 15 of file SkSVGFeMorphology.cpp.

15 {
17 this->setOperator(SkSVGAttributeParser::parse<SkSVGFeMorphology::Operator>(
18 "operator", name, value)) ||
19 this->setRadius(SkSVGAttributeParser::parse<SkSVGFeMorphology::Radius>(
20 "radius", name, value));
21}
bool parseAndSetAttribute(const char *, const char *) override
Definition: SkSVGFe.cpp:93
uint8_t value
DEF_SWITCHES_START aot vmservice shared library name
Definition: switches.h:32

The documentation for this class was generated from the following files: