Home | History | Annotate | Download | only in svg
      1 /*
      2  * Copyright (C) 2009 Dirk Schulze <krit (at) webkit.org>
      3  *
      4  * This library is free software; you can redistribute it and/or
      5  * modify it under the terms of the GNU Library General Public
      6  * License as published by the Free Software Foundation; either
      7  * version 2 of the License, or (at your option) any later version.
      8  *
      9  * This library is distributed in the hope that it will be useful,
     10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
     11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     12  * Library General Public License for more details.
     13  *
     14  * You should have received a copy of the GNU Library General Public License
     15  * along with this library; see the file COPYING.LIB.  If not, write to
     16  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
     17  * Boston, MA 02110-1301, USA.
     18  */
     19 
     20 #ifndef SVGFEConvolveMatrixElement_h
     21 #define SVGFEConvolveMatrixElement_h
     22 
     23 #if ENABLE(SVG) && ENABLE(FILTERS)
     24 #include "FEConvolveMatrix.h"
     25 #include "SVGAnimatedBoolean.h"
     26 #include "SVGAnimatedEnumeration.h"
     27 #include "SVGAnimatedInteger.h"
     28 #include "SVGAnimatedNumber.h"
     29 #include "SVGAnimatedNumberList.h"
     30 #include "SVGFilterPrimitiveStandardAttributes.h"
     31 
     32 namespace WebCore {
     33 
     34 class SVGFEConvolveMatrixElement : public SVGFilterPrimitiveStandardAttributes {
     35 public:
     36     static PassRefPtr<SVGFEConvolveMatrixElement> create(const QualifiedName&, Document*);
     37 
     38     void setOrder(float orderX, float orderY);
     39     void setKernelUnitLength(float kernelUnitLengthX, float kernelUnitLengthY);
     40 
     41 private:
     42     SVGFEConvolveMatrixElement(const QualifiedName&, Document*);
     43 
     44     virtual void parseMappedAttribute(Attribute*);
     45     virtual bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&);
     46     virtual void svgAttributeChanged(const QualifiedName&);
     47     virtual void fillAttributeToPropertyTypeMap();
     48     virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
     49     virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*, Filter*);
     50 
     51     static const AtomicString& orderXIdentifier();
     52     static const AtomicString& orderYIdentifier();
     53     static const AtomicString& kernelUnitLengthXIdentifier();
     54     static const AtomicString& kernelUnitLengthYIdentifier();
     55 
     56     // Animated property declarations
     57     DECLARE_ANIMATED_STRING(In1, in1)
     58     DECLARE_ANIMATED_INTEGER(OrderX, orderX)
     59     DECLARE_ANIMATED_INTEGER(OrderY, orderY)
     60     DECLARE_ANIMATED_NUMBER_LIST(KernelMatrix, kernelMatrix)
     61     DECLARE_ANIMATED_NUMBER(Divisor, divisor)
     62     DECLARE_ANIMATED_NUMBER(Bias, bias)
     63     DECLARE_ANIMATED_INTEGER(TargetX, targetX)
     64     DECLARE_ANIMATED_INTEGER(TargetY, targetY)
     65     DECLARE_ANIMATED_ENUMERATION(EdgeMode, edgeMode)
     66     DECLARE_ANIMATED_NUMBER(KernelUnitLengthX, kernelUnitLengthX)
     67     DECLARE_ANIMATED_NUMBER(KernelUnitLengthY, kernelUnitLengthY)
     68     DECLARE_ANIMATED_BOOLEAN(PreserveAlpha, preserveAlpha)
     69 };
     70 
     71 } // namespace WebCore
     72 
     73 #endif // ENABLE(SVG)
     74 #endif
     75