![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
#include "qcolor.h"#include "qcolor_p.h"#include "qdrawhelper_p.h"#include "qfloat16.h"#include "qnamespace.h"#include "qdatastream.h"#include "qvariant.h"#include "qdebug.h"#include "private/qtools_p.h"#include <algorithm>#include <QtCore/q26numeric.h>#include <optional>#include <QtCore/q20utility.h>#include <stdio.h>#include <limits.h>Go to the source code of this file.
Classes | |
| struct | RGBData |
Namespaces | |
| namespace | QColorConstants |
| \inmodule QtGui | |
Macros | |
| #define | rgb(r, g, b) |
| #define | QRGB(r, g, b) |
| #define | QRGBA(r, g, b, a) |
Enumerations | |
| enum class | QColorRgbFValidity : quint8 { Rgb , ExtendedRgb , Invalid , Rgb , ExtendedRgb , Invalid } |
| enum class | QColorHueLimit : bool { None , Degrees , None , Degrees } |
| enum class | QColorRgbFValidity : quint8 { Rgb , ExtendedRgb , Invalid , Rgb , ExtendedRgb , Invalid } |
| enum class | QColorHueLimit : bool { None , Degrees , None , Degrees } |
Functions | |
| static int | hex2int (const char *s, int n) |
| static std::optional< QRgba64 > | get_hex_rgb (const char *name, size_t len) |
| std::optional< QRgb > | qt_get_hex_rgb (const char *name) |
| static std::optional< QRgba64 > | get_hex_rgb (const QChar *str, size_t len) |
| static std::optional< QRgba64 > | get_hex_rgb (QAnyStringView name) |
| bool | operator< (const char *name, const RGBData &data) |
| bool | operator< (const RGBData &data, const char *name) |
| static std::optional< QRgb > | get_named_rgb_no_space (const char *name_no_space) |
| static std::optional< QRgb > | get_named_rgb (QAnyStringView name) |
| static QStringList | get_colornames () |
| static constexpr bool | qColorComponentIsInIntRange (int value) noexcept |
| static constexpr bool | qColorHueIsInIntRange (int hue, QColorHueLimit upperLimit) noexcept |
| static constexpr bool | qColorComponentIsInFloatRange (float value) noexcept |
| static constexpr bool | qColorHueIsInFloatRange (float hue) noexcept |
| static constexpr bool | qColorIsFloatNaN (float value) noexcept |
| Q_DECL_COLD_FUNCTION void | qColorWarnInvalidInt (int value, const char *fn) |
| Q_DECL_COLD_FUNCTION void | qColorWarnInvalidFloat (float value, const char *fn) |
| Q_DECL_COLD_FUNCTION void | qColorWarnParametersOutOfRange (const char *name, const char *fn) |
| static auto | qColorClampToIntRange (int value, const char *fn) |
| static auto | qColorClampToFloatRange (float value, const char *fn) |
| static auto | qColorClampNaNToNull (float value, const char *fn) |
| static bool | qColorCheckRgbValidity (int r, int g, int b, int a, const char *fn) |
| static bool | qColorCheckHsxValidity (int h, int s, int x, int a, const char *fn, const char *name, QColorHueLimit hLimit) |
| static bool | qColorCheckHslValidity (int h, int s, int l, int a, const char *fn, QColorHueLimit hLimit) |
| static bool | qColorCheckHsvValidity (int h, int s, int v, int a, const char *fn, QColorHueLimit hLimit) |
| static bool | qColorCheckCmykValidity (int c, int m, int y, int k, int a, const char *fn) |
| static QColorRgbFValidity | qColorCheckRgbFValidity (float r, float g, float b, float a, QColor::Spec cspec, const char *fn) |
| static bool | qColorCheckHsxFValidity (float h, float s, float x, float a, const char *fn, const char *name) |
| static bool | qColorCheckHslFValidity (float h, float s, float l, float a, const char *fn) |
| static bool | qColorCheckHsvFValidity (float h, float s, float v, float a, const char *fn) |
| static bool | qColorCheckCmykFValidity (float c, float m, float y, float k, float a, const char *fn) |
| static qfloat16 & | castF16 (quint16 &v) |
| static const qfloat16 & | castF16 (const quint16 &v) |
| QDebug | operator<< (QDebug dbg, const QColor &c) |
| QDataStream & | operator<< (QDataStream &stream, const QColor &color) |
| QDataStream & | operator>> (QDataStream &stream, QColor &color) |
Variables | |
| QT_BEGIN_NAMESPACE | |
| static constexpr struct RGBData | rgbTbl [] |
| static const int | rgbTblSize = sizeof(rgbTbl) / sizeof(RGBData) |
| const uint | qt_inv_premul_factor [256] |
Definition at line 127 of file qcolor.cpp.
|
strong |
| Enumerator | |
|---|---|
| None | |
| Degrees | |
| None | |
| Degrees | |
Definition at line 356 of file qcolor.cpp.
|
strong |
| Enumerator | |
|---|---|
| None | |
| Degrees | |
| None | |
| Degrees | |
Definition at line 356 of file qcolor.cpp.
|
strong |
| Enumerator | |
|---|---|
| Rgb | |
| ExtendedRgb | |
| Invalid | |
| Rgb | |
| ExtendedRgb | |
| Invalid | |
Definition at line 347 of file qcolor.cpp.
|
strong |
| Enumerator | |
|---|---|
| Rgb | |
| ExtendedRgb | |
| Invalid | |
| Rgb | |
| ExtendedRgb | |
| Invalid | |
Definition at line 347 of file qcolor.cpp.
Definition at line 1407 of file qcolor.cpp.
Definition at line 1401 of file qcolor.cpp.
|
static |
Definition at line 336 of file qcolor.cpp.
References RGBData::name, and rgbTblSize.
|
static |
Definition at line 51 of file qcolor.cpp.
Definition at line 100 of file qcolor.cpp.
|
static |
Definition at line 111 of file qcolor.cpp.
|
static |
Definition at line 317 of file qcolor.cpp.
|
static |
Definition at line 303 of file qcolor.cpp.
References operator<(), rgbTblSize, and RGBData::value.
|
inlinestatic |
If s[0..n] is a valid hex number, returns its integer value, otherwise returns -1.
Definition at line 36 of file qcolor.cpp.
|
inline |
Definition at line 298 of file qcolor.cpp.
References RGBData::name.
Referenced by get_named_rgb_no_space().
|
inline |
Definition at line 300 of file qcolor.cpp.
References RGBData::name.
| QDataStream & operator<< | ( | QDataStream & | stream, |
| const QColor & | color ) |
Definition at line 3114 of file qcolor.cpp.
Definition at line 3084 of file qcolor.cpp.
| QDataStream & operator>> | ( | QDataStream & | stream, |
| QColor & | color ) |
Definition at line 3150 of file qcolor.cpp.
|
static |
Definition at line 528 of file qcolor.cpp.
References qColorComponentIsInFloatRange(), and qColorWarnParametersOutOfRange().
|
static |
Definition at line 467 of file qcolor.cpp.
References qColorComponentIsInIntRange(), and qColorWarnParametersOutOfRange().
|
static |
Definition at line 518 of file qcolor.cpp.
References qColorCheckHsxFValidity().
|
static |
Definition at line 455 of file qcolor.cpp.
References qColorCheckHsxValidity().
|
static |
Definition at line 523 of file qcolor.cpp.
References qColorCheckHsxFValidity().
|
static |
Definition at line 461 of file qcolor.cpp.
References qColorCheckHsxValidity().
|
static |
Definition at line 504 of file qcolor.cpp.
References qColorComponentIsInFloatRange(), qColorHueIsInFloatRange(), and qColorWarnParametersOutOfRange().
Referenced by qColorCheckHslFValidity(), and qColorCheckHsvFValidity().
|
static |
Definition at line 441 of file qcolor.cpp.
References qColorComponentIsInIntRange(), qColorHueIsInIntRange(), and qColorWarnParametersOutOfRange().
Referenced by qColorCheckHslValidity(), and qColorCheckHsvValidity().
|
static |
Definition at line 481 of file qcolor.cpp.
References ExtendedRgb, Invalid, qColorComponentIsInFloatRange(), qColorIsFloatNaN(), qColorWarnInvalidFloat(), qColorWarnParametersOutOfRange(), and Rgb.
|
static |
Definition at line 428 of file qcolor.cpp.
References qColorComponentIsInIntRange(), and qColorWarnParametersOutOfRange().
|
static |
Definition at line 420 of file qcolor.cpp.
References qColorIsFloatNaN(), and qColorWarnInvalidFloat().
|
static |
Definition at line 412 of file qcolor.cpp.
References qColorComponentIsInFloatRange(), qColorIsFloatNaN(), and qColorWarnInvalidFloat().
|
static |
Definition at line 404 of file qcolor.cpp.
References qColorWarnInvalidInt().
|
staticconstexprnoexcept |
Definition at line 372 of file qcolor.cpp.
Referenced by qColorCheckCmykFValidity(), qColorCheckHsxFValidity(), qColorCheckRgbFValidity(), qColorClampToFloatRange(), and qColorHueIsInFloatRange().
|
staticconstexprnoexcept |
Definition at line 362 of file qcolor.cpp.
Referenced by qColorCheckCmykValidity(), qColorCheckHsxValidity(), and qColorCheckRgbValidity().
|
staticconstexprnoexcept |
Definition at line 378 of file qcolor.cpp.
References qColorComponentIsInFloatRange().
Referenced by qColorCheckHsxFValidity().
|
staticconstexprnoexcept |
Definition at line 367 of file qcolor.cpp.
References Degrees.
Referenced by qColorCheckHsxValidity().
|
staticconstexprnoexcept |
Definition at line 384 of file qcolor.cpp.
Referenced by qColorCheckRgbFValidity(), qColorClampNaNToNull(), and qColorClampToFloatRange().
| Q_DECL_COLD_FUNCTION void qColorWarnInvalidFloat | ( | float | value, |
| const char * | fn ) |
Definition at line 394 of file qcolor.cpp.
Referenced by qColorCheckRgbFValidity(), qColorClampNaNToNull(), and qColorClampToFloatRange().
| Q_DECL_COLD_FUNCTION void qColorWarnInvalidInt | ( | int | value, |
| const char * | fn ) |
Definition at line 389 of file qcolor.cpp.
Referenced by qColorClampToIntRange().
| Q_DECL_COLD_FUNCTION void qColorWarnParametersOutOfRange | ( | const char * | name, |
| const char * | fn ) |
Definition at line 399 of file qcolor.cpp.
Referenced by qColorCheckCmykFValidity(), qColorCheckCmykValidity(), qColorCheckHsxFValidity(), qColorCheckHsxValidity(), qColorCheckRgbFValidity(), and qColorCheckRgbValidity().
| std::optional< QRgb > qt_get_hex_rgb | ( | const char * | name | ) |
Definition at line 93 of file qcolor.cpp.
|
Definition at line 28 of file qcolor.cpp.
| const uint qt_inv_premul_factor |
Definition at line 3186 of file qcolor.cpp.
|
static |
Definition at line 284 of file qcolor.cpp.
Referenced by get_colornames(), and get_named_rgb_no_space().