2 Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
3 2004, 2005 Rob Buis <buis@kde.org>
4 2005 Eric Seidel <eric@webkit.org>
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.
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.
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.
24 #if ENABLE(SVG) && ENABLE(SVG_FILTERS)
25 #include "SVGFEBlend.h"
26 #include "TextStream.h"
30 SVGFEBlend::SVGFEBlend(SVGResourceFilter* filter)
31 : SVGFilterEffect(filter)
32 , m_mode(SVG_FEBLEND_MODE_UNKNOWN)
36 PassRefPtr<SVGFEBlend> SVGFEBlend::create(SVGResourceFilter* filter)
38 return adoptRef(new SVGFEBlend(filter));
41 String SVGFEBlend::in2() const
46 void SVGFEBlend::setIn2(const String& in2)
51 SVGBlendModeType SVGFEBlend::blendMode() const
56 void SVGFEBlend::setBlendMode(SVGBlendModeType mode)
61 static TextStream& operator<<(TextStream& ts, SVGBlendModeType t)
65 case SVG_FEBLEND_MODE_UNKNOWN:
66 ts << "UNKNOWN"; break;
67 case SVG_FEBLEND_MODE_NORMAL:
68 ts << "NORMAL"; break;
69 case SVG_FEBLEND_MODE_MULTIPLY:
70 ts << "MULTIPLY"; break;
71 case SVG_FEBLEND_MODE_SCREEN:
72 ts << "SCREEN"; break;
73 case SVG_FEBLEND_MODE_DARKEN:
74 ts << "DARKEN"; break;
75 case SVG_FEBLEND_MODE_LIGHTEN:
76 ts << "LIGHTEN"; break;
81 TextStream& SVGFEBlend::externalRepresentation(TextStream& ts) const
83 ts << "[type=BLEND] ";
84 SVGFilterEffect::externalRepresentation(ts);
86 ts << " [in2=\"" << m_in2 << "\"]";
87 ts << " [blend mode=" << m_mode << "]";
91 } // namespace WebCore
93 #endif // ENABLE(SVG) && ENABLE(SVG_FILTERS)