KHTML
SVGFEBlend.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 "SVGFEBlend.h"
00026 #include "TextStream.h"
00027
00028 namespace WebCore {
00029
00030 SVGFEBlend::SVGFEBlend(SVGResourceFilter* filter)
00031 : SVGFilterEffect(filter)
00032 , m_mode(SVG_FEBLEND_MODE_UNKNOWN)
00033 {
00034 }
00035
00036 String SVGFEBlend::in2() const
00037 {
00038 return m_in2;
00039 }
00040
00041 void SVGFEBlend::setIn2(const String& in2)
00042 {
00043 m_in2 = in2;
00044 }
00045
00046 SVGBlendModeType SVGFEBlend::blendMode() const
00047 {
00048 return m_mode;
00049 }
00050
00051 void SVGFEBlend::setBlendMode(SVGBlendModeType mode)
00052 {
00053 m_mode = mode;
00054 }
00055
00056 static TextStream& operator<<(TextStream& ts, SVGBlendModeType t)
00057 {
00058 switch (t)
00059 {
00060 case SVG_FEBLEND_MODE_UNKNOWN:
00061 ts << "UNKNOWN"; break;
00062 case SVG_FEBLEND_MODE_NORMAL:
00063 ts << "NORMAL"; break;
00064 case SVG_FEBLEND_MODE_MULTIPLY:
00065 ts << "MULTIPLY"; break;
00066 case SVG_FEBLEND_MODE_SCREEN:
00067 ts << "SCREEN"; break;
00068 case SVG_FEBLEND_MODE_DARKEN:
00069 ts << "DARKEN"; break;
00070 case SVG_FEBLEND_MODE_LIGHTEN:
00071 ts << "LIGHTEN"; break;
00072 }
00073 return ts;
00074 }
00075
00076 TextStream& SVGFEBlend::externalRepresentation(TextStream& ts) const
00077 {
00078 ts << "[type=BLEND] ";
00079 SVGFilterEffect::externalRepresentation(ts);
00080 if (!m_in2.isEmpty())
00081 ts << " [in2=\"" << m_in2 << "\"]";
00082 ts << " [blend mode=" << m_mode << "]";
00083 return ts;
00084 }
00085
00086 }
00087
00088 #endif // ENABLE(SVG) && ENABLE(SVG_FILTERS)