KHTML
SVGFEColorMatrix.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 "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 } // namespace WebCore 00083 00084 #endif // ENABLE(SVG) && ENABLE(SVG_FILTERS)
KDE 4.6 API Reference