KHtml

SVGFEColorMatrix.cpp
1 /*
2  Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <[email protected]>
3  2004, 2005 Rob Buis <[email protected]>
4  2005 Eric Seidel <[email protected]>
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Library General Public
8  License as published by the Free Software Foundation; either
9  version 2 of the License, or (at your option) any later version.
10 
11  This library is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  Library General Public License for more details.
15 
16  You should have received a copy of the GNU Library General Public License
17  aint with this library; see the file COPYING.LIB. If not, write to
18  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  Boston, MA 02110-1301, USA.
20 */
21 
22 #if ENABLE(SVG) && ENABLE(SVG_FILTERS)
23 #include "SVGFEColorMatrix.h"
24 
25 namespace WebCore
26 {
27 
28 SVGFEColorMatrix::SVGFEColorMatrix(SVGResourceFilter *filter)
29  : SVGFilterEffect(filter)
30  , m_type(SVG_FECOLORMATRIX_TYPE_UNKNOWN)
31 {
32 }
33 
34 SVGColorMatrixType SVGFEColorMatrix::type() const
35 {
36  return m_type;
37 }
38 
39 void SVGFEColorMatrix::setType(SVGColorMatrixType type)
40 {
41  m_type = type;
42 }
43 
44 const Vector<float> &SVGFEColorMatrix::values() const
45 {
46  return m_values;
47 }
48 
49 void SVGFEColorMatrix::setValues(const Vector<float> &values)
50 {
51  m_values = values;
52 }
53 
54 static TextStream &operator<<(TextStream &ts, SVGColorMatrixType t)
55 {
56  switch (t) {
57  case SVG_FECOLORMATRIX_TYPE_UNKNOWN:
58  ts << "UNKNOWN"; break;
59  case SVG_FECOLORMATRIX_TYPE_MATRIX:
60  ts << "CMT_MATRIX"; break;
61  case SVG_FECOLORMATRIX_TYPE_SATURATE:
62  ts << "CMT_SATURATE"; break;
63  case SVG_FECOLORMATRIX_TYPE_HUEROTATE:
64  ts << "HUE-ROTATE"; break;
65  case SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA:
66  ts << "LUMINANCE-TO-ALPHA"; break;
67  }
68  return ts;
69 }
70 
71 TextStream &SVGFEColorMatrix::externalRepresentation(TextStream &ts) const
72 {
73  ts << "[type=COLOR-MATRIX] ";
74  SVGFilterEffect::externalRepresentation(ts);
75  ts << " [color matrix type=" << type() << "]"
76  << " [values=" << values() << "]";
77  return ts;
78 }
79 
80 } // namespace WebCore
81 
82 #endif // ENABLE(SVG) && ENABLE(SVG_FILTERS)
QVector< V > values(const QMultiHash< K, V > &c)
Type type(const QSqlDatabase &db)
QDataStream & operator<<(QDataStream &out, const KDateTime::Spec &spec)
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Tue Oct 26 2021 22:48:09 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.