OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> |
3 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org> |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 { | 43 { |
44 DEFINE_STATIC_LOCAL(SVGEnumerationStringEntries, entries, ()); | 44 DEFINE_STATIC_LOCAL(SVGEnumerationStringEntries, entries, ()); |
45 if (entries.isEmpty()) { | 45 if (entries.isEmpty()) { |
46 entries.append(std::make_pair(FETURBULENCE_TYPE_UNKNOWN, emptyString()))
; | 46 entries.append(std::make_pair(FETURBULENCE_TYPE_UNKNOWN, emptyString()))
; |
47 entries.append(std::make_pair(FETURBULENCE_TYPE_FRACTALNOISE, "fractalNo
ise")); | 47 entries.append(std::make_pair(FETURBULENCE_TYPE_FRACTALNOISE, "fractalNo
ise")); |
48 entries.append(std::make_pair(FETURBULENCE_TYPE_TURBULENCE, "turbulence"
)); | 48 entries.append(std::make_pair(FETURBULENCE_TYPE_TURBULENCE, "turbulence"
)); |
49 } | 49 } |
50 return entries; | 50 return entries; |
51 } | 51 } |
52 | 52 |
53 // Animated property definitions | |
54 | |
55 BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGFETurbulenceElement) | |
56 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGFilterPrimitiveStandardAttributes) | |
57 END_REGISTER_ANIMATED_PROPERTIES | |
58 | |
59 inline SVGFETurbulenceElement::SVGFETurbulenceElement(Document& document) | 53 inline SVGFETurbulenceElement::SVGFETurbulenceElement(Document& document) |
60 : SVGFilterPrimitiveStandardAttributes(SVGNames::feTurbulenceTag, document) | 54 : SVGFilterPrimitiveStandardAttributes(SVGNames::feTurbulenceTag, document) |
61 , m_baseFrequency(SVGAnimatedNumberOptionalNumber::create(this, SVGNames::ba
seFrequencyAttr)) | 55 , m_baseFrequency(SVGAnimatedNumberOptionalNumber::create(this, SVGNames::ba
seFrequencyAttr)) |
62 , m_seed(SVGAnimatedNumber::create(this, SVGNames::seedAttr, SVGNumber::crea
te(0))) | 56 , m_seed(SVGAnimatedNumber::create(this, SVGNames::seedAttr, SVGNumber::crea
te(0))) |
63 , m_stitchTiles(SVGAnimatedEnumeration<SVGStitchOptions>::create(this, SVGNa
mes::stitchTilesAttr, SVG_STITCHTYPE_NOSTITCH)) | 57 , m_stitchTiles(SVGAnimatedEnumeration<SVGStitchOptions>::create(this, SVGNa
mes::stitchTilesAttr, SVG_STITCHTYPE_NOSTITCH)) |
64 , m_type(SVGAnimatedEnumeration<TurbulenceType>::create(this, SVGNames::type
Attr, FETURBULENCE_TYPE_TURBULENCE)) | 58 , m_type(SVGAnimatedEnumeration<TurbulenceType>::create(this, SVGNames::type
Attr, FETURBULENCE_TYPE_TURBULENCE)) |
65 , m_numOctaves(SVGAnimatedInteger::create(this, SVGNames::numOctavesAttr, SV
GInteger::create(1))) | 59 , m_numOctaves(SVGAnimatedInteger::create(this, SVGNames::numOctavesAttr, SV
GInteger::create(1))) |
66 { | 60 { |
67 ScriptWrappable::init(this); | 61 ScriptWrappable::init(this); |
68 | 62 |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 } | 153 } |
160 | 154 |
161 PassRefPtr<FilterEffect> SVGFETurbulenceElement::build(SVGFilterBuilder*, Filter
* filter) | 155 PassRefPtr<FilterEffect> SVGFETurbulenceElement::build(SVGFilterBuilder*, Filter
* filter) |
162 { | 156 { |
163 if (baseFrequencyX()->currentValue()->value() < 0 || baseFrequencyY()->curre
ntValue()->value() < 0) | 157 if (baseFrequencyX()->currentValue()->value() < 0 || baseFrequencyY()->curre
ntValue()->value() < 0) |
164 return nullptr; | 158 return nullptr; |
165 return FETurbulence::create(filter, m_type->currentValue()->enumValue(), bas
eFrequencyX()->currentValue()->value(), baseFrequencyY()->currentValue()->value(
), m_numOctaves->currentValue()->value(), m_seed->currentValue()->value(), m_sti
tchTiles->currentValue()->enumValue() == SVG_STITCHTYPE_STITCH); | 159 return FETurbulence::create(filter, m_type->currentValue()->enumValue(), bas
eFrequencyX()->currentValue()->value(), baseFrequencyY()->currentValue()->value(
), m_numOctaves->currentValue()->value(), m_seed->currentValue()->value(), m_sti
tchTiles->currentValue()->enumValue() == SVG_STITCHTYPE_STITCH); |
166 } | 160 } |
167 | 161 |
168 } | 162 } |
OLD | NEW |