1// Copyright (C) 2018 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef QLOTTIEGFILL_P_H
5#define QLOTTIEGFILL_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QVector4D>
19#include <QGradient>
20
21#include <QtLottie/private/qlottiegroup_p.h>
22#include <QtLottie/private/qlottieproperty_p.h>
23#include <QtLottie/private/qlottieproperty_p.h>
24#include <QtLottie/private/qlottiespatialproperty_p.h>
25
26QT_BEGIN_NAMESPACE
27
28class Q_LOTTIE_EXPORT QLottieGFill : public QLottieShape
29{
30public:
31 QLottieGFill() = default;
32 explicit QLottieGFill(const QLottieGFill &other);
33 QLottieGFill(const QJsonObject &definition, QLottieBase *parent = nullptr);
34 ~QLottieGFill() override;
35
36 QLottieBase *clone() const override;
37
38 void updateProperties(int frame) override;
39 void render(QLottieRenderer &renderer) const override;
40
41 QGradient *value() const;
42 QGradient::Type gradientType() const;
43 QPointF startPoint() const;
44 QPointF endPoint() const;
45 qreal highlightLength() const;
46 qreal highlightAngle() const;
47 qreal opacity() const;
48
49private:
50 void setGradient();
51
52protected:
53 QLottieProperty<qreal> m_opacity;
54 QLottieSpatialProperty m_startPoint;
55 QLottieSpatialProperty m_endPoint;
56 QLottieProperty<qreal> m_highlightLength;
57 QLottieProperty<qreal> m_highlightAngle;
58 QHash<int, QLottieProperty4D<QVector4D>> m_colors;
59 QGradient *m_gradient = nullptr;
60};
61
62QT_END_NAMESPACE
63
64#endif // QLOTTIEGFILL_P_H
65

source code of qtlottie/src/lottie/qlottiegfill_p.h