1// Copyright (C) 2018 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef BMGFILL_P_H
5#define BMGFILL_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 <QtBodymovin/private/bmgroup_p.h>
22#include <QtBodymovin/private/bmproperty_p.h>
23#include <QtBodymovin/private/bmproperty_p.h>
24#include <QtBodymovin/private/bmspatialproperty_p.h>
25
26QT_BEGIN_NAMESPACE
27
28class BODYMOVIN_EXPORT BMGFill : public BMShape
29{
30public:
31 BMGFill() = default;
32 explicit BMGFill(const BMGFill &other);
33 BMGFill(const QJsonObject &definition, const QVersionNumber &version, BMBase *parent = nullptr);
34 ~BMGFill() override;
35
36 BMBase *clone() const override;
37
38 void updateProperties(int frame) override;
39 void render(LottieRenderer &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 BMProperty<qreal> m_opacity;
54 BMSpatialProperty m_startPoint;
55 BMSpatialProperty m_endPoint;
56 BMProperty<qreal> m_highlightLength;
57 BMProperty<qreal> m_highlightAngle;
58 QList<BMProperty4D<QVector4D>> m_colors;
59 QGradient *m_gradient = nullptr;
60
61};
62
63QT_END_NAMESPACE
64
65#endif // BMGFILL_P_H
66

source code of qtlottie/src/bodymovin/bmgfill_p.h