Flutter Engine
The Flutter Engine
Static Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
SkSVGFeComponentTransfer Class Referencefinal

#include <SkSVGFeComponentTransfer.h>

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

Static Public Member Functions

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

Static Public Attributes

static constexpr SkSVGTag tag = SkSVGTag::kFeComponentTransfer
 

Protected Member Functions

sk_sp< SkImageFilteronMakeImageFilter (const SkSVGRenderContext &, const SkSVGFilterContext &) const override
 
std::vector< SkSVGFeInputTypegetInputs () const 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 55 of file SkSVGFeComponentTransfer.h.

Member Function Documentation

◆ getInputs()

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

Implements SkSVGFe.

Definition at line 67 of file SkSVGFeComponentTransfer.h.

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

◆ Make()

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

◆ onMakeImageFilter()

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

Implements SkSVGFe.

Definition at line 24 of file SkSVGFeComponentTransfer.cpp.

26 {
27 std::vector<uint8_t> a_tbl, b_tbl, g_tbl, r_tbl;
28
29 for (const auto& child : fChildren) {
30 switch (child->tag()) {
32 a_tbl = static_cast<const SkSVGFeFunc*>(child.get())->getTable();
33 break;
35 b_tbl = static_cast<const SkSVGFeFunc*>(child.get())->getTable();
36 break;
38 g_tbl = static_cast<const SkSVGFeFunc*>(child.get())->getTable();
39 break;
41 r_tbl = static_cast<const SkSVGFeFunc*>(child.get())->getTable();
42 break;
43 default:
44 break;
45 }
46 }
47 SkASSERT(a_tbl.empty() || a_tbl.size() == 256);
48 SkASSERT(b_tbl.empty() || b_tbl.size() == 256);
49 SkASSERT(g_tbl.empty() || g_tbl.size() == 256);
50 SkASSERT(r_tbl.empty() || r_tbl.size() == 256);
51
52 const SkRect cropRect = this->resolveFilterSubregion(ctx, fctx);
53 const sk_sp<SkImageFilter> input = fctx.resolveInput(ctx,
54 this->getIn(),
55 this->resolveColorspace(ctx, fctx));
56
57 const auto cf = SkColorFilters::TableARGB(a_tbl.empty() ? nullptr : a_tbl.data(),
58 r_tbl.empty() ? nullptr : r_tbl.data(),
59 g_tbl.empty() ? nullptr : g_tbl.data(),
60 b_tbl.empty() ? nullptr : b_tbl.data());
61
62 return SkImageFilters::ColorFilter(std::move(cf), std::move(input), cropRect);
63}
#define SkASSERT(cond)
Definition: SkAssert.h:116
static sk_sp< SkColorFilter > TableARGB(const uint8_t tableA[256], const uint8_t tableR[256], const uint8_t tableG[256], const uint8_t tableB[256])
static sk_sp< SkImageFilter > ColorFilter(sk_sp< SkColorFilter > cf, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
skia_private::STArray< 1, sk_sp< SkSVGNode >, true > fChildren
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

Member Data Documentation

◆ tag

constexpr SkSVGTag SkSVGFeComponentTransfer::tag = SkSVGTag::kFeComponentTransfer
staticconstexpr

Definition at line 57 of file SkSVGFeComponentTransfer.h.


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