| 1 | // Copyright (C) 2018 The Qt Company Ltd. |
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only |
| 3 | |
| 4 | #ifndef BMREPEATERTRANSFORM_P_H |
| 5 | #define BMREPEATERTRANSFORM_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 <QtBodymovin/private/bmbasictransform_p.h> |
| 19 | |
| 20 | QT_BEGIN_NAMESPACE |
| 21 | |
| 22 | class QJsonObject; |
| 23 | |
| 24 | class BODYMOVIN_EXPORT BMRepeaterTransform : public BMBasicTransform |
| 25 | { |
| 26 | public: |
| 27 | BMRepeaterTransform() = default; |
| 28 | explicit BMRepeaterTransform(const BMRepeaterTransform &other); |
| 29 | BMRepeaterTransform(const QJsonObject &definition, const QVersionNumber &version, |
| 30 | BMBase *parent); |
| 31 | |
| 32 | BMBase *clone() const override; |
| 33 | |
| 34 | void construct(const QJsonObject &definition, const QVersionNumber &version); |
| 35 | |
| 36 | void updateProperties(int frame) override; |
| 37 | void render(LottieRenderer &renderer) const override; |
| 38 | |
| 39 | qreal startOpacity() const; |
| 40 | qreal endOpacity() const; |
| 41 | |
| 42 | void setInstanceCount(int copies); |
| 43 | qreal opacityAtInstance(int instance) const; |
| 44 | |
| 45 | protected: |
| 46 | int m_copies = 0; |
| 47 | BMProperty<qreal> m_startOpacity; |
| 48 | BMProperty<qreal> m_endOpacity; |
| 49 | QList<qreal> m_opacities; |
| 50 | }; |
| 51 | |
| 52 | QT_END_NAMESPACE |
| 53 | |
| 54 | #endif // BMREPEATERTRANSFORM_P_H |
| 55 | |