KHTML
SVGFEMorphology.cpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
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 }
00092
00093 #endif // ENABLE(SVG) && ENABLE(SVG_FILTERS)