| 1 | // Copyright (C) 2018 The Qt Company Ltd. |
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only |
| 3 | |
| 4 | #ifndef BMBASICTRANSFORM_P_H |
| 5 | #define BMBASICTRANSFORM_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 <QPointF> |
| 19 | |
| 20 | #include <QtBodymovin/private/bmshape_p.h> |
| 21 | #include <QtBodymovin/private/bmproperty_p.h> |
| 22 | #include <QtBodymovin/private/bmspatialproperty_p.h> |
| 23 | |
| 24 | QT_BEGIN_NAMESPACE |
| 25 | |
| 26 | class QJsonObject; |
| 27 | |
| 28 | class BODYMOVIN_EXPORT BMBasicTransform : public BMShape |
| 29 | { |
| 30 | public: |
| 31 | BMBasicTransform() = default; |
| 32 | explicit BMBasicTransform(const BMBasicTransform &other); |
| 33 | BMBasicTransform(const QJsonObject &definition, const QVersionNumber &version, |
| 34 | BMBase *parent = nullptr); |
| 35 | |
| 36 | BMBase *clone() const override; |
| 37 | |
| 38 | void construct(const QJsonObject &definition, const QVersionNumber &version); |
| 39 | |
| 40 | void updateProperties(int frame) override; |
| 41 | void render(LottieRenderer &renderer) const override; |
| 42 | |
| 43 | QPointF anchorPoint() const; |
| 44 | virtual QPointF position() const; |
| 45 | QPointF scale() const; |
| 46 | qreal rotation() const; |
| 47 | qreal opacity() const; |
| 48 | |
| 49 | protected: |
| 50 | BMSpatialProperty m_anchorPoint; |
| 51 | bool m_splitPosition = false; |
| 52 | BMSpatialProperty m_position; |
| 53 | BMProperty<qreal> m_xPos; |
| 54 | BMProperty<qreal> m_yPos; |
| 55 | BMProperty2D<QPointF> m_scale; |
| 56 | BMProperty<qreal> m_rotation; |
| 57 | BMProperty<qreal> m_opacity; |
| 58 | }; |
| 59 | |
| 60 | QT_END_NAMESPACE |
| 61 | |
| 62 | #endif // BMBASICTRANSFORM_P_H |
| 63 | |