24#if ENABLE(SVG) && ENABLE(SVG_FILTERS)
25#include "SVGRenderTreeAsText.h"
30SVGFEConvolveMatrix::SVGFEConvolveMatrix(SVGResourceFilter* filter)
31 : SVGFilterEffect(filter)
36 , m_edgeMode(SVG_EDGEMODE_UNKNOWN)
37 , m_kernelUnitLength()
38 , m_preserveAlpha(false)
42FloatSize SVGFEConvolveMatrix::kernelSize()
const
47void SVGFEConvolveMatrix::setKernelSize(FloatSize kernelSize)
49 m_kernelSize = kernelSize;
52const Vector<float>& SVGFEConvolveMatrix::kernel()
const
54 return m_kernelMatrix;
57void SVGFEConvolveMatrix::setKernel(
const Vector<float>& kernel)
59 m_kernelMatrix = kernel;
62float SVGFEConvolveMatrix::divisor()
const
67void SVGFEConvolveMatrix::setDivisor(
float divisor)
72float SVGFEConvolveMatrix::bias()
const
77void SVGFEConvolveMatrix::setBias(
float bias)
82FloatSize SVGFEConvolveMatrix::targetOffset()
const
84 return m_targetOffset;
87void SVGFEConvolveMatrix::setTargetOffset(FloatSize targetOffset)
89 m_targetOffset = targetOffset;
92SVGEdgeModeType SVGFEConvolveMatrix::edgeMode()
const
97void SVGFEConvolveMatrix::setEdgeMode(SVGEdgeModeType edgeMode)
99 m_edgeMode = edgeMode;
102FloatPoint SVGFEConvolveMatrix::kernelUnitLength()
const
104 return m_kernelUnitLength;
107void SVGFEConvolveMatrix::setKernelUnitLength(FloatPoint kernelUnitLength)
109 m_kernelUnitLength = kernelUnitLength;
112bool SVGFEConvolveMatrix::preserveAlpha()
const
114 return m_preserveAlpha;
117void SVGFEConvolveMatrix::setPreserveAlpha(
bool preserveAlpha)
119 m_preserveAlpha = preserveAlpha;
122static 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:
138TextStream& 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 <<
"]";
QDataStream & operator<<(QDataStream &d, const ActionReply &reply)