1 | // Copyright (C) 2018 The Qt Company Ltd. |
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
3 | |
4 | // |
5 | // W A R N I N G |
6 | // ------------- |
7 | // |
8 | // This file is not part of the Qt API. It exists purely as an |
9 | // implementation detail. This header file may change from version to |
10 | // version without notice, or even be removed. |
11 | // |
12 | // We mean it. |
13 | // |
14 | |
15 | #ifndef QOPENGLTEXTUREUPLOADER_P_H |
16 | #define QOPENGLTEXTUREUPLOADER_P_H |
17 | |
18 | #include <QtCore/qsize.h> |
19 | #include <QtOpenGL/qtopenglglobal.h> |
20 | #include <QtGui/private/qopenglcontext_p.h> |
21 | |
22 | QT_BEGIN_NAMESPACE |
23 | |
24 | class QImage; |
25 | |
26 | class Q_OPENGL_EXPORT QOpenGLTextureUploader |
27 | { |
28 | public: |
29 | enum BindOption { |
30 | NoBindOption = 0x0000, |
31 | PremultipliedAlphaBindOption = 0x0001, |
32 | UseRedForAlphaAndLuminanceBindOption = 0x0002, |
33 | SRgbBindOption = 0x0004, |
34 | PowerOfTwoBindOption = 0x0008 |
35 | }; |
36 | Q_DECLARE_FLAGS(BindOptions, BindOption) |
37 | Q_FLAGS(BindOptions) |
38 | |
39 | static qsizetype textureImage(GLenum target, const QImage &image, BindOptions options, QSize maxSize = QSize()); |
40 | |
41 | }; |
42 | |
43 | Q_DECLARE_OPERATORS_FOR_FLAGS(QOpenGLTextureUploader::BindOptions) |
44 | |
45 | QT_END_NAMESPACE |
46 | |
47 | #endif |
48 | |
49 | |