AeonGUI
A portable video game graphic user interface library.
Loading...
Searching...
No Matches
SVGAnimateElement.hpp
1/*
2Copyright (C) 2026 Rodrigo Jose Hernandez Cordoba
3
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15*/
16#ifndef AEONGUI_SVGANIMATEELEMENT_H
17#define AEONGUI_SVGANIMATEELEMENT_H
18
19#include "SVGAnimationElement.hpp"
20#include "aeongui/Color.hpp"
21#include <vector>
22
23namespace AeonGUI
24{
25 namespace DOM
26 {
34 {
35 public:
41 SVGAnimateElement ( const DOMString& aTagName, AttributeMap&& aAttributes, Node* aParent );
47 void ApplyToCanvas ( Canvas& aCanvas ) const override;
51 bool IsGeometryAnimation() const;
55 bool IsPathAnimation() const;
59 double GetInterpolatedValue() const;
60 private:
61 Color InterpolateColor ( double aProgress ) const;
62 double InterpolateNumber ( double aProgress ) const;
63 void ApplyGeometryToCanvas ( Canvas& aCanvas ) const;
64 bool mIsColorAnimation{false};
65 bool mIsGeometryAnimation{false};
66 bool mIsPathAnimation{false};
67 double mOriginalValue{0.0};
68 double mAnchorX{0.0};
69 double mAnchorY{0.0};
70 std::vector<Color> mColorValues;
71 std::vector<double> mNumericValues;
72 };
73 }
74}
75#endif
Abstract 2D rendering surface.
Definition Canvas.hpp:40
Base class for all nodes in the DOM tree.
Definition Node.hpp:42
bool IsPathAnimation() const
Check if this animation rebuilds the parent path.
Definition SVGAnimateElement.cpp:155
void ApplyToCanvas(Canvas &aCanvas) const override
Apply the animation effect to the canvas.
Definition SVGAnimateElement.cpp:201
SVGAnimateElement(const DOMString &aTagName, AttributeMap &&aAttributes, Node *aParent)
Construct an SVGAnimateElement.
Definition SVGAnimateElement.cpp:27
bool IsGeometryAnimation() const
Check if this animation targets a geometry attribute.
Definition SVGAnimateElement.cpp:150
~SVGAnimateElement() override
Destructor.
double GetInterpolatedValue() const
Get the current interpolated numeric value.
Definition SVGAnimateElement.cpp:160
SVGAnimationElement(const DOMString &aTagName, AttributeMap &&aAttributes, Node *aParent)
Construct an SVGAnimationElement.
Definition SVGAnimationElement.cpp:26
Pixel Color Union. The Color union allows access to each unsigned 8 bit RGBA color component individu...
Definition Color.hpp:185