Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qcolormap.h
Go to the documentation of this file.
1// Copyright (C) 2016 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// Qt-Security score:significant reason:default
4
5#ifndef QCOLORMAP_H
6#define QCOLORMAP_H
7
8#include <QtWidgets/qtwidgetsglobal.h>
9#include <QtGui/qrgb.h>
10#include <QtGui/qwindowdefs.h>
11#include <QtCore/qatomic.h>
12#include <QtCore/qlist.h>
13
14QT_BEGIN_NAMESPACE
15
16class QColor;
17class QColormapPrivate;
18
19#if QT_WARN_DEPRECATED_UP_TO >= QT_VERSION_CHECK(6, 11, 0)
20# if defined(Q_CC_GNU_ONLY) && Q_CC_GNU < 1300
21// GCC 12 and earlier has issues combining __attribute__ and [[]] syntax
22# define QT_DEPRECATED_VERSION_6_11_CUSTOM __attribute__((deprecated))
23# else
24# define QT_DEPRECATED_VERSION_6_11_CUSTOM QT_DEPRECATED
25# endif
26#else
27# define QT_DEPRECATED_VERSION_6_11_CUSTOM
28#endif
29
30#if QT_REMOVAL_QT7_DEPRECATED_SINCE(6, 11)
31class Q_WIDGETS_EXPORT QT_DEPRECATED_VERSION_6_11_CUSTOM QColormap
32{
33public:
34 enum Mode { Direct, Indexed, Gray };
35
36 static void initialize();
37 static void cleanup();
38
39 static QColormap instance(int screen = -1);
40
41 QColormap(const QColormap &colormap);
42 ~QColormap();
43
44 QColormap &operator=(const QColormap &colormap);
45
46 Mode mode() const;
47
48 int depth() const;
49 int size() const;
50
51 uint pixel(const QColor &color) const;
52 const QColor colorAt(uint pixel) const;
53
54 const QList<QColor> colormap() const;
55
56private:
57 QColormap();
58 QColormapPrivate *d;
59};
60#endif // QT_REMOVAL_QT7_DEPRECATED_SINCE(6, 11)
61
62#undef QT_DEPRECATED_VERSION_6_11_CUSTOM
63
64QT_END_NAMESPACE
65
66#endif // QCOLORMAP_H