QColormap Class
QColormap 类可将独立于设备的 QColors 映射到与设备相关的像素值。更多
Header: | #include <QColormap> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS Widgets) target_link_libraries(mytarget PRIVATE Qt6::Widgets) |
qmake: | QT += widgets |
- 所有成员(包括继承成员)的列表
- QColormap 属于绘画类。
公共类型
enum | Mode { Direct, Indexed, Gray } |
公共函数
QColormap(const QColormap &colormap) | |
~QColormap() | |
const QColor | colorAt(uint pixel) const |
const QList<QColor> | colormap() const |
int | depth() const |
QColormap::Mode | mode() const |
uint | pixel(const QColor &color) const |
int | size() const |
QColormap & | operator=(const QColormap &colormap) |
静态公共成员
QColormap | instance(int screen = -1) |
成员函数文档
QColormap::QColormap(const QColormap &colormap)
构建另一个colormap 的副本。
[noexcept]
QColormap::~QColormap()
破坏色谱图。
const QColor QColormap::colorAt(uint pixel) const
返回pixel 的QColor 。
另请参阅 pixel() 。
const QList<QColor> QColormap::colormap() const
返回代表Indexed
和Gray
模式下设备颜色映射的颜色列表。对于Direct
模式,该函数将返回空列表。
另请参见 size()。
int QColormap::depth() const
返回设备的深度。
另请参见 size()。
[static]
QColormap QColormap::instance(int screen = -1)
返回指定screen 的颜色映射表。如果screen 为-1,该函数将返回默认屏幕的颜色映射表。
QColormap::Mode QColormap::mode() const
返回此颜色映射的模式。
另请参见 QColormap::Mode 。
uint QColormap::pixel(const QColor &color) const
返回color 的设备相关像素值。
另请参见 colorAt()。
int QColormap::size() const
在Indexed
和Gray
模式下,返回颜色映射表的大小;在Direct
模式下,返回-1。
另请参见 colormap().
QColormap &QColormap::operator=(const QColormap &colormap)
将给定的colormap 分配给此颜色贴图,并返回此颜色贴图的引用。
© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.