このページでは

QColormap Class

QColormap クラスは、デバイス非依存の QColor をデバイス依存のピクセル値に変換します。詳細...

ヘッダー: #include <QColormap>
CMake: find_package(Qt6 REQUIRED COMPONENTS Widgets)
target_link_libraries(mytarget PRIVATE Qt6::Widgets)
qmake: QT += widgets
ステータス: 6.11以降、非推奨

このクラスは 6.11 以降、非推奨となっています。新しいコードでの使用は強く推奨しません。

パブリック型

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)

詳細な説明

メンバ型のドキュメント

enum QColormap::Mode

この列挙型は、QColormap がデバイス非依存のRGB値をデバイス依存のピクセル値にどのようにマッピングするかを記述しています。

定数値説明
QColormap::Direct0ピクセル値は、RGB 値から直接導出されます。これは「トゥルーカラー」とも呼ばれます。
QColormap::Indexed1ピクセル値は、利用可能な色のリスト内のインデックスを表します。つまり、QColormap は、RGB 値に最も近い色のインデックスを使用します。
QColormap::Gray2Indexed と同様に、ピクセル値は利用可能なグレースケールのリストを表します。QColormap は、RGB 値から計算されたグレースケールに最も近いグレースケールのインデックスを使用します。

メンバ関数のドキュメント

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 をこのカラーマップに割り当て、このカラーマップへの参照を返します。

© 2026 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.