KHTML
SVGFEColorMatrix.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 "SVGFEColorMatrix.h"
00026
00027 namespace WebCore {
00028
00029 SVGFEColorMatrix::SVGFEColorMatrix(SVGResourceFilter* filter)
00030 : SVGFilterEffect(filter)
00031 , m_type(SVG_FECOLORMATRIX_TYPE_UNKNOWN)
00032 {
00033 }
00034
00035 SVGColorMatrixType SVGFEColorMatrix::type() const
00036 {
00037 return m_type;
00038 }
00039
00040 void SVGFEColorMatrix::setType(SVGColorMatrixType type)
00041 {
00042 m_type = type;
00043 }
00044
00045 const Vector<float>& SVGFEColorMatrix::values() const
00046 {
00047 return m_values;
00048 }
00049
00050 void SVGFEColorMatrix::setValues(const Vector<float> &values)
00051 {
00052 m_values = values;
00053 }
00054
00055 static TextStream& operator<<(TextStream& ts, SVGColorMatrixType t)
00056 {
00057 switch (t)
00058 {
00059 case SVG_FECOLORMATRIX_TYPE_UNKNOWN:
00060 ts << "UNKNOWN"; break;
00061 case SVG_FECOLORMATRIX_TYPE_MATRIX:
00062 ts << "CMT_MATRIX"; break;
00063 case SVG_FECOLORMATRIX_TYPE_SATURATE:
00064 ts << "CMT_SATURATE"; break;
00065 case SVG_FECOLORMATRIX_TYPE_HUEROTATE:
00066 ts << "HUE-ROTATE"; break;
00067 case SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA:
00068 ts << "LUMINANCE-TO-ALPHA"; break;
00069 }
00070 return ts;
00071 }
00072
00073 TextStream& SVGFEColorMatrix::externalRepresentation(TextStream& ts) const
00074 {
00075 ts << "[type=COLOR-MATRIX] ";
00076 SVGFilterEffect::externalRepresentation(ts);
00077 ts << " [color matrix type=" << type() << "]"
00078 << " [values=" << values() << "]";
00079 return ts;
00080 }
00081
00082 }
00083
00084 #endif // ENABLE(SVG) && ENABLE(SVG_FILTERS)