Skia
2D Graphics Library
SkSVGFeColorMatrix.h
Go to the documentation of this file.
1 /*
2  * Copyright 2020 Google Inc.
3  *
4  * Use of this source code is governed by a BSD-style license that can be
5  * found in the LICENSE file.
6  */
7 
8 #ifndef SkSVGFeColorMatrix_DEFINED
9 #define SkSVGFeColorMatrix_DEFINED
10 
14 
15 class SK_API SkSVGFeColorMatrix final : public SkSVGFe {
16 public:
19  }
20 
23 
24 protected:
25  sk_sp<SkImageFilter> onMakeImageFilter(const SkSVGRenderContext&,
26  const SkSVGFilterContext&) const override;
27 
28  std::vector<SkSVGFeInputType> getInputs() const override { return {this->getIn()}; }
29 
30  bool parseAndSetAttribute(const char*, const char*) override;
31 
32 private:
34 
35  SkColorMatrix makeMatrixForType() const;
36 
37  static SkColorMatrix MakeSaturate(SkSVGNumberType s);
38 
39  static SkColorMatrix MakeHueRotate(SkSVGNumberType degrees);
40 
41  static SkColorMatrix MakeLuminanceToAlpha();
42 
43  using INHERITED = SkSVGFe;
44 };
45 
46 #endif // SkSVGFeColorMatrix_DEFINED
SkSVGTag
Definition: SkSVGNode.h:23
@ kFeColorMatrix
#define SVG_ATTR(attr_name, attr_type, attr_default)
Definition: SkSVGNode.h:203
std::vector< SkSVGNumberType > SkSVGFeColorMatrixValues
Definition: SkSVGTypes.h:677
SkScalar SkSVGNumberType
Definition: SkSVGTypes.h:27
SkSVGFeColorMatrixType
Definition: SkSVGTypes.h:670
Definition: SkColorMatrix.h:18
Base class for image filters.
Definition: SkImageFilter.h:35
Definition: SkSVGFeColorMatrix.h:15
bool parseAndSetAttribute(const char *, const char *) override
static sk_sp< SkSVGFeColorMatrix > Make()
Definition: SkSVGFeColorMatrix.h:17
Definition: SkSVGTypes.h:635
Definition: SkSVGFe.h:18
SkSVGFe(SkSVGTag t)
Definition: SkSVGFe.h:65
Definition: SkSVGFilterContext.h:21
Definition: SkSVGRenderContext.h:61
Definition: SkSVGTransformableNode.h:14
Shared pointer class to wrap classes that support a ref()/unref() interface.
Definition: SkRefCnt.h:220