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) 2009 Dirk Schulze <krit@webkit.org>
6 * Copyright (C) 2010 Renata Hodovan <reni@inf.u-szeged.hu>
7 * Copyright (C) 2013 Google Inc. All rights reserved.
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public
11 * License as published by the Free Software Foundation; either
12 * version 2 of the License, or (at your option) any later version.
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Library General Public License for more details.
19 * You should have received a copy of the GNU Library General Public License
20 * along with this library; see the file COPYING.LIB. If not, write to
21 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22 * Boston, MA 02110-1301, USA.
25 #ifndef FETurbulence_h
26 #define FETurbulence_h
28 #include "platform/graphics/filters/FilterEffect.h"
35 FETURBULENCE_TYPE_UNKNOWN = 0,
36 FETURBULENCE_TYPE_FRACTALNOISE = 1,
37 FETURBULENCE_TYPE_TURBULENCE = 2
40 class PLATFORM_EXPORT FETurbulence : public FilterEffect {
42 static PassRefPtr<FETurbulence> create(Filter*, TurbulenceType, float, float, int, float, bool);
44 TurbulenceType type() const;
45 bool setType(TurbulenceType);
47 float baseFrequencyY() const;
48 bool setBaseFrequencyY(float);
50 float baseFrequencyX() const;
51 bool setBaseFrequencyX(float);
56 int numOctaves() const;
57 bool setNumOctaves(int);
59 bool stitchTiles() const;
60 bool setStitchTiles(bool);
62 static void fillRegionWorker(void*);
64 virtual TextStream& externalRepresentation(TextStream&, int indention) const override;
67 FETurbulence(Filter*, TurbulenceType, float, float, int, float, bool);
69 virtual PassRefPtr<SkImageFilter> createImageFilter(SkiaImageFilterBuilder*) override;
70 SkShader* createShader();
72 TurbulenceType m_type;
73 float m_baseFrequencyX;
74 float m_baseFrequencyY;
82 #endif // FETurbulence_h