1// Copyright (C) 2024 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef QLOTTIEPOLYSTAR_P_H
5#define QLOTTIEPOLYSTAR_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 <QRect>
19#include <QPointF>
20#include <QBrush>
21#include <QPen>
22#include <QPainterPath>
23
24#include <QtLottie/private/qlottieshape_p.h>
25#include <QtLottie/private/qlottieproperty_p.h>
26#include <QtLottie/private/qlottiespatialproperty_p.h>
27#include <QtLottie/private/qlottiefill_p.h>
28#include <QtLottie/private/qlottiestroke_p.h>
29
30QT_BEGIN_NAMESPACE
31
32class QJsonObject;
33
34class Q_LOTTIE_EXPORT QLottiePolyStar : public QLottieShape
35{
36public:
37 QLottiePolyStar() = default;
38 explicit QLottiePolyStar(const QLottiePolyStar &other);
39 QLottiePolyStar(const QJsonObject &definition, QLottieBase *parent = nullptr);
40
41 QLottieBase *clone() const override;
42
43 void construct(const QJsonObject &definition);
44
45 void updateProperties(int frame) override;
46 void render(QLottieRenderer &renderer) const override;
47
48 bool acceptsTrim() const override;
49
50 QPointF position() const;
51 qreal outerRadius() const;
52 qreal innerRadius() const;
53 qreal startAngle() const;
54 int pointCount() const;
55 bool isPolygonModeEnabled() const;
56
57protected:
58 QLottieSpatialProperty m_position;
59 QLottieProperty<int> m_pointCount;
60 QLottieProperty<qreal> m_outerRadius;
61 QLottieProperty<qreal> m_innerRadius;
62 QLottieProperty<qreal> m_startAngle;
63 bool m_polygonMode = false;
64};
65
66QT_END_NAMESPACE
67
68#endif // QLOTTIEPOLYSTAR_P_H
69

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