• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
3  * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
4  * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
5  * Copyright (C) 2010 Dirk Schulze <krit@webkit.org>
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Library General Public
9  * License as published by the Free Software Foundation; either
10  * version 2 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Library General Public License for more details.
16  *
17  * You should have received a copy of the GNU Library General Public License
18  * along with this library; see the file COPYING.LIB.  If not, write to
19  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20  * Boston, MA 02110-1301, USA.
21  */
22 
23 #ifndef SVGFEImage_h
24 #define SVGFEImage_h
25 
26 #if ENABLE(SVG) && ENABLE(FILTERS)
27 #include "FilterEffect.h"
28 #include "SVGPreserveAspectRatio.h"
29 
30 namespace WebCore {
31 
32 class Image;
33 
34 class FEImage : public FilterEffect {
35 public:
36     static PassRefPtr<FEImage> create(Filter*, RefPtr<Image>, const SVGPreserveAspectRatio&);
37 
setAbsoluteSubregion(const FloatRect & absoluteSubregion)38     void setAbsoluteSubregion(const FloatRect& absoluteSubregion) { m_absoluteSubregion = absoluteSubregion; }
39 
40     virtual void apply();
41     virtual void dump();
42 
43     virtual void determineAbsolutePaintRect();
44 
filterEffectType()45     virtual FilterEffectType filterEffectType() const { return FilterEffectTypeImage; }
46 
47     virtual TextStream& externalRepresentation(TextStream&, int indention) const;
48 
49 private:
50     FEImage(Filter*, RefPtr<Image>, const SVGPreserveAspectRatio&);
51 
52     RefPtr<Image> m_image;
53     SVGPreserveAspectRatio m_preserveAspectRatio;
54     FloatRect m_absoluteSubregion;
55 };
56 
57 } // namespace WebCore
58 
59 #endif // ENABLE(SVG) && ENABLE(FILTERS)
60 
61 #endif // SVGFEImage_h
62