| 1 | // Copyright (C) 2018 The Qt Company Ltd. |
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only |
| 3 | #ifndef BMPATHTRIMMER_P_H |
| 4 | #define BMPATHTRIMMER_P_H |
| 5 | |
| 6 | // |
| 7 | // W A R N I N G |
| 8 | // ------------- |
| 9 | // |
| 10 | // This file is not part of the Qt API. It exists purely as an |
| 11 | // implementation detail. This header file may change from version to |
| 12 | // version without notice, or even be removed. |
| 13 | // |
| 14 | // We mean it. |
| 15 | // |
| 16 | |
| 17 | #include <QList> |
| 18 | |
| 19 | #include <QtBodymovin/bmglobal.h> |
| 20 | #include <QtCore/private/qglobal_p.h> |
| 21 | |
| 22 | QT_BEGIN_NAMESPACE |
| 23 | |
| 24 | class QJsonObject; |
| 25 | class BMTrimPath; |
| 26 | class LottieRenderer; |
| 27 | class BMBase; |
| 28 | class BMShape; |
| 29 | |
| 30 | class BODYMOVIN_EXPORT BMPathTrimmer |
| 31 | { |
| 32 | public: |
| 33 | BMPathTrimmer(BMBase *root); |
| 34 | |
| 35 | void addTrim(BMTrimPath* trim); |
| 36 | bool inUse() const; |
| 37 | |
| 38 | void applyTrim(BMShape *shape); |
| 39 | |
| 40 | void updateProperties(int frame); |
| 41 | void render(LottieRenderer &renderer) const; |
| 42 | |
| 43 | private: |
| 44 | BMBase *m_root = nullptr; |
| 45 | |
| 46 | QList<BMTrimPath*> m_trimPaths; |
| 47 | BMTrimPath *m_appliedTrim = nullptr; |
| 48 | }; |
| 49 | |
| 50 | QT_END_NAMESPACE |
| 51 | |
| 52 | #endif // BMPATHTRIMMER_P_H |
| 53 | |
| 54 | |