QColormap 类

QColormap 类将设备无关 QColor 映射到设备从属像素值。 更多...

头: #include <QColormap>
CMake: find_package(Qt6 COMPONENTS Widgets REQUIRED)
target_link_libraries(mytarget PRIVATE Qt6::Widgets)
qmake: QT += widgets

公共类型

enum Mode { Direct, Indexed, Gray }

公共函数

  QColormap (const QColormap & colormap )
QColormap & operator= (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 instance (int screen = -1)

详细描述

成员类型文档编制

enum QColormap:: Mode

此枚举描述如何 QColormap maps device independent RGB values to device dependent pixel values.

常量 描述
QColormap::Direct 0 Pixel values are derived directly from the RGB values, also known as "True Color."
QColormap::Indexed 1 Pixel values represent indexes into a list of available colors, i.e. QColormap uses the index of the color that most closely matches an RGB value.
QColormap::Gray 2 类似于 Indexed , pixel values represent a list of available gray tones. QColormap uses the index of the gray tone that most closely matches the computed gray tone of an RGB value.

成员函数文档编制

QColormap:: QColormap (const QColormap & colormap )

构造副本为另一 colormap .

QColormap &QColormap:: operator= (const QColormap & colormap )

赋值给定 colormap to this color map and returns a reference to this color map.

QColormap:: ~QColormap ()

销毁颜色映射。

const QColor QColormap:: colorAt ( uint pixel ) const

返回 QColor pixel .

另请参阅 pixel ().

const QList < QColor > QColormap:: colormap () const

Returns a list of colors which represents the devices colormap for Indexed and Gray modes. This function returns an empty list for Direct 模式。

另请参阅 size ().

int QColormap:: depth () const

返回设备的深度。

另请参阅 size ().

[static] QColormap QColormap:: instance ( int screen = -1)

返回颜色映射为指定 screen 。若 screen is -1, this function returns the colormap for the default screen.

QColormap::Mode QColormap:: mode () const

返回此颜色映射的模式。

另请参阅 QColormap::Mode .

uint QColormap:: pixel (const QColor & color ) const

返回设备从属像素值为 color .

另请参阅 colorAt ().

int QColormap:: size () const

返回颜色映射大小对于 Indexed and Gray 模式;返回 -1 对于 Direct 模式。

另请参阅 colormap ().