1// Copyright (C) 2018 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef BMIMAGE_P_H
5#define BMIMAGE_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 <QImage>
19#include <QPointF>
20
21#include <QtBodymovin/private/bmproperty_p.h>
22#include <QtBodymovin/private/bmspatialproperty_p.h>
23
24QT_BEGIN_NAMESPACE
25
26class QJsonObject;
27
28class BODYMOVIN_EXPORT BMImage : public BMBase
29{
30public:
31 BMImage() = default;
32 explicit BMImage(const BMImage &other);
33 BMImage(const QJsonObject &definition, const QVersionNumber &version, BMBase *parent = nullptr);
34
35 BMBase *clone() const override;
36
37 void construct(const QJsonObject &definition, const QVersionNumber &version);
38
39 void updateProperties(int frame) override;
40 void render(LottieRenderer &renderer) const override;
41
42 QPointF position() const;
43 qreal radius() const;
44
45 QPointF getCenter() const { return m_center; }
46 QImage getImage() const { return m_image; }
47
48protected:
49 BMSpatialProperty m_position;
50 BMProperty<qreal> m_radius;
51
52 QImage m_image;
53 QPointF m_center;
54};
55
56QT_END_NAMESPACE
57
58#endif // BMIMAGE_P_H
59

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