KHTML
SVGFEMorphology.cpp
Go to the documentation of this file.
00001 /* 00002 Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org> 00003 2004, 2005 Rob Buis <buis@kde.org> 00004 2005 Eric Seidel <eric@webkit.org> 00005 00006 This library is free software; you can redistribute it and/or 00007 modify it under the terms of the GNU Library General Public 00008 License as published by the Free Software Foundation; either 00009 version 2 of the License, or (at your option) any later version. 00010 00011 This library is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 Library General Public License for more details. 00015 00016 You should have received a copy of the GNU Library General Public License 00017 aint with this library; see the file COPYING.LIB. If not, write to 00018 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00019 Boston, MA 02110-1301, USA. 00020 */ 00021 00022 #include "config.h" 00023 00024 #if ENABLE(SVG) && ENABLE(SVG_FILTERS) 00025 #include "SVGFEMorphology.h" 00026 #include "TextStream.h" 00027 00028 namespace WebCore { 00029 00030 SVGFEMorphology::SVGFEMorphology(SVGResourceFilter* filter) 00031 : SVGFilterEffect(filter) 00032 , m_operator(SVG_MORPHOLOGY_OPERATOR_UNKNOWN) 00033 , m_radiusX(0.0f) 00034 , m_radiusY(0.0f) 00035 { 00036 } 00037 00038 SVGMorphologyOperatorType SVGFEMorphology::morphologyOperator() const 00039 { 00040 return m_operator; 00041 } 00042 00043 void SVGFEMorphology::setMorphologyOperator(SVGMorphologyOperatorType _operator) 00044 { 00045 m_operator = _operator; 00046 } 00047 00048 float SVGFEMorphology::radiusX() const 00049 { 00050 return m_radiusX; 00051 } 00052 00053 void SVGFEMorphology::setRadiusX(float radiusX) 00054 { 00055 m_radiusX = radiusX; 00056 } 00057 00058 float SVGFEMorphology::radiusY() const 00059 { 00060 return m_radiusY; 00061 } 00062 00063 void SVGFEMorphology::setRadiusY(float radiusY) 00064 { 00065 m_radiusY = radiusY; 00066 } 00067 00068 static TextStream& operator<<(TextStream& ts, SVGMorphologyOperatorType t) 00069 { 00070 switch (t) 00071 { 00072 case SVG_MORPHOLOGY_OPERATOR_UNKNOWN: 00073 ts << "UNKNOWN"; break; 00074 case SVG_MORPHOLOGY_OPERATOR_ERODE: 00075 ts << "ERODE"; break; 00076 case SVG_MORPHOLOGY_OPERATOR_DIALATE: 00077 ts << "DIALATE"; break; 00078 } 00079 return ts; 00080 } 00081 00082 TextStream& SVGFEMorphology::externalRepresentation(TextStream& ts) const 00083 { 00084 ts << "[type=MORPHOLOGY-OPERATOR] "; 00085 SVGFilterEffect::externalRepresentation(ts); 00086 ts << " [operator type=" << morphologyOperator() << "]" 00087 << " [radius x=" << radiusX() << " y=" << radiusY() << "]"; 00088 return ts; 00089 } 00090 00091 } // namespace WebCore 00092 00093 #endif // ENABLE(SVG) && ENABLE(SVG_FILTERS)
KDE 4.6 API Reference