24 #if ENABLE(SVG) && ENABLE(SVG_FILTERS)
25 #include "SVGRenderTreeAsText.h"
30 SVGFEConvolveMatrix::SVGFEConvolveMatrix(SVGResourceFilter* filter)
31 : SVGFilterEffect(filter)
36 , m_edgeMode(SVG_EDGEMODE_UNKNOWN)
37 , m_kernelUnitLength()
38 , m_preserveAlpha(false)
42 FloatSize SVGFEConvolveMatrix::kernelSize()
const
47 void SVGFEConvolveMatrix::setKernelSize(FloatSize kernelSize)
49 m_kernelSize = kernelSize;
52 const Vector<float>& SVGFEConvolveMatrix::kernel()
const
54 return m_kernelMatrix;
57 void SVGFEConvolveMatrix::setKernel(
const Vector<float>& kernel)
59 m_kernelMatrix = kernel;
62 float SVGFEConvolveMatrix::divisor()
const
67 void SVGFEConvolveMatrix::setDivisor(
float divisor)
72 float SVGFEConvolveMatrix::bias()
const
77 void SVGFEConvolveMatrix::setBias(
float bias)
82 FloatSize SVGFEConvolveMatrix::targetOffset()
const
84 return m_targetOffset;
87 void SVGFEConvolveMatrix::setTargetOffset(FloatSize targetOffset)
89 m_targetOffset = targetOffset;
92 SVGEdgeModeType SVGFEConvolveMatrix::edgeMode()
const
97 void SVGFEConvolveMatrix::setEdgeMode(SVGEdgeModeType edgeMode)
99 m_edgeMode = edgeMode;
102 FloatPoint SVGFEConvolveMatrix::kernelUnitLength()
const
104 return m_kernelUnitLength;
107 void SVGFEConvolveMatrix::setKernelUnitLength(FloatPoint kernelUnitLength)
109 m_kernelUnitLength = kernelUnitLength;
112 bool SVGFEConvolveMatrix::preserveAlpha()
const
114 return m_preserveAlpha;
117 void SVGFEConvolveMatrix::setPreserveAlpha(
bool preserveAlpha)
119 m_preserveAlpha = preserveAlpha;
122 static TextStream&
operator<<(TextStream& ts, SVGEdgeModeType t)
126 case SVG_EDGEMODE_UNKNOWN:
127 ts <<
"UNKNOWN";
break;
128 case SVG_EDGEMODE_DUPLICATE:
129 ts <<
"DUPLICATE";
break;
130 case SVG_EDGEMODE_WRAP:
132 case SVG_EDGEMODE_NONE:
138 TextStream& SVGFEConvolveMatrix::externalRepresentation(TextStream& ts)
const
140 ts <<
"[type=CONVOLVE-MATRIX] ";
141 SVGFilterEffect::externalRepresentation(ts);
142 ts <<
" [order " << m_kernelSize <<
"]"
143 <<
" [kernel matrix=" << m_kernelMatrix <<
"]"
144 <<
" [divisor=" << m_divisor <<
"]"
145 <<
" [bias=" << m_bias <<
"]"
146 <<
" [target " << m_targetOffset <<
"]"
147 <<
" [edge mode=" << m_edgeMode <<
"]"
148 <<
" [kernel unit length " << m_kernelUnitLength <<
"]"
149 <<
" [preserve alpha=" << m_preserveAlpha <<
"]";
155 #endif // ENABLE(SVG) && ENABLE(SVG_FILTERS)
QDebug operator<<(QDebug s, KDebugStreamFunction f)