| 1 | // Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB). |
|---|---|
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
| 3 | |
| 4 | #ifndef QT3DRENDER_QTEXTUREIMAGE_P_H |
| 5 | #define QT3DRENDER_QTEXTUREIMAGE_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 for the convenience |
| 12 | // of other Qt classes. 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 <QtCore/QDateTime> |
| 19 | |
| 20 | #include <Qt3DRender/private/qabstracttextureimage_p.h> |
| 21 | #include <Qt3DRender/qtextureimage.h> |
| 22 | #include <Qt3DRender/qtextureimagedatagenerator.h> |
| 23 | #include <Qt3DRender/private/qt3drender_global_p.h> |
| 24 | |
| 25 | QT_BEGIN_NAMESPACE |
| 26 | |
| 27 | namespace Qt3DRender { |
| 28 | |
| 29 | class Q_3DRENDERSHARED_PRIVATE_EXPORT QTextureImagePrivate : public QAbstractTextureImagePrivate |
| 30 | { |
| 31 | public: |
| 32 | QTextureImagePrivate() |
| 33 | : QAbstractTextureImagePrivate() |
| 34 | , m_status(QTextureImage::None) |
| 35 | , m_mirrored(true) |
| 36 | { |
| 37 | } |
| 38 | |
| 39 | Q_DECLARE_PUBLIC(QTextureImage) |
| 40 | |
| 41 | QUrl m_source; |
| 42 | QTextureImage::Status m_status; |
| 43 | bool m_mirrored; |
| 44 | }; |
| 45 | |
| 46 | class Q_AUTOTEST_EXPORT QImageTextureDataFunctor : public QTextureImageDataGenerator |
| 47 | { |
| 48 | public: |
| 49 | explicit QImageTextureDataFunctor(const QUrl &url, bool mirrored); |
| 50 | // Will be executed from within a QAspectJob |
| 51 | QTextureImageDataPtr operator ()() final; |
| 52 | bool operator ==(const QTextureImageDataGenerator &other) const final; |
| 53 | inline QTextureImage::Status status() const { return m_status; } |
| 54 | QT3D_FUNCTOR(QImageTextureDataFunctor) |
| 55 | |
| 56 | QUrl url() const; |
| 57 | bool isMirrored() const; |
| 58 | |
| 59 | private: |
| 60 | QUrl m_url; |
| 61 | QDateTime m_lastModified; |
| 62 | QTextureImage::Status m_status; |
| 63 | bool m_mirrored; |
| 64 | }; |
| 65 | |
| 66 | typedef QSharedPointer<QImageTextureDataFunctor> QImageTextureDataFunctorPtr; |
| 67 | |
| 68 | } // namespace Qt3DRender |
| 69 | |
| 70 | QT_END_NAMESPACE |
| 71 | |
| 72 | #endif // QT3DRENDER_QTEXTUREIMAGE_P_H |
| 73 |
