| 1 | // Copyright (C) 2018 The Qt Company Ltd. |
|---|---|
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only |
| 3 | |
| 4 | #ifndef QLOTTIEBASICTRANSFORM_P_H |
| 5 | #define QLOTTIEBASICTRANSFORM_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 <QtLottie/private/qlottieshape_p.h> |
| 21 | #include <QtLottie/private/qlottieproperty_p.h> |
| 22 | #include <QtLottie/private/qlottiespatialproperty_p.h> |
| 23 | |
| 24 | QT_BEGIN_NAMESPACE |
| 25 | |
| 26 | class QJsonObject; |
| 27 | |
| 28 | class Q_LOTTIE_EXPORT QLottieBasicTransform : public QLottieShape |
| 29 | { |
| 30 | public: |
| 31 | QLottieBasicTransform() = default; |
| 32 | explicit QLottieBasicTransform(const QLottieBasicTransform &other); |
| 33 | QLottieBasicTransform(const QJsonObject &definition, QLottieBase *parent = nullptr); |
| 34 | |
| 35 | QLottieBase *clone() const override; |
| 36 | |
| 37 | void construct(const QJsonObject &definition); |
| 38 | |
| 39 | void updateProperties(int frame) override; |
| 40 | void render(QLottieRenderer &renderer) const override; |
| 41 | |
| 42 | QPointF anchorPoint() const; |
| 43 | virtual QPointF position() const; |
| 44 | QPointF scale() const; |
| 45 | qreal rotation() const; |
| 46 | qreal opacity() const; |
| 47 | |
| 48 | bool splitPosition() const { return m_splitPosition; } |
| 49 | QLottieProperty<qreal> xPosProperty() const { return m_xPos; } |
| 50 | QLottieProperty<qreal> yPosProperty() const { return m_yPos; } |
| 51 | QLottieSpatialProperty anchorPointProperty() const { return m_anchorPoint; } |
| 52 | QLottieSpatialProperty positionProperty() const { return m_position; } |
| 53 | QLottieProperty2D<QPointF> scaleProperty() const { return m_scale; } |
| 54 | QLottieProperty<qreal> rotationProperty() const { return m_rotation; } |
| 55 | QLottieProperty<qreal> opacityProperty() const { return m_opacity; } |
| 56 | |
| 57 | protected: |
| 58 | QLottieSpatialProperty m_anchorPoint; |
| 59 | bool m_splitPosition = false; |
| 60 | QLottieSpatialProperty m_position; |
| 61 | QLottieProperty<qreal> m_xPos; |
| 62 | QLottieProperty<qreal> m_yPos; |
| 63 | QLottieProperty2D<QPointF> m_scale; |
| 64 | QLottieProperty<qreal> m_rotation; |
| 65 | QLottieProperty<qreal> m_opacity; |
| 66 | }; |
| 67 | |
| 68 | QT_END_NAMESPACE |
| 69 | |
| 70 | #endif // QLOTTIEBASICTRANSFORM_P_H |
| 71 |
