7#include "constpropagatinguniquepointer.h"
8#include "genericcolor.h"
11#include <qcontainerfwd.h>
18#include <qsharedpointer.h>
20#include <qversionnumber.h>
23#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
24#include <qtmetamacros.h>
26#include <qobjectdefs.h>
29Q_DECLARE_METATYPE(cmsColorSpaceSignature)
30Q_DECLARE_METATYPE(cmsProfileClassSignature)
34class RgbColorSpacePrivate;
117class RgbColorSpace :
public QObject
139 enum class ProfileRole {
148 Q_DECLARE_FLAGS(ProfileRoles, ProfileRole)
158 using RenderingIntentDirections = QMap<cmsUInt32Number, RgbColorSpace::ProfileRoles>;
166 Q_PROPERTY(QString profileAbsoluteFilePath READ profileAbsoluteFilePath CONSTANT)
177 Q_PROPERTY(cmsProfileClassSignature profileClass READ profileClass CONSTANT)
189 Q_PROPERTY(cmsColorSpaceSignature profileColorModel READ profileColorModel CONSTANT)
199 Q_PROPERTY(QString profileCopyright READ profileCopyright CONSTANT)
206 Q_PROPERTY(QDateTime profileCreationDateTime READ profileCreationDateTime CONSTANT)
213 Q_PROPERTY(qint64 profileFileSize READ profileFileSize CONSTANT)
218 Q_PROPERTY(
bool profileHasClut READ profileHasClut CONSTANT)
223 Q_PROPERTY(
bool profileHasMatrixShaper READ profileHasMatrixShaper CONSTANT)
236 Q_PROPERTY(RenderingIntentDirections profileRenderingIntentDirections READ profileRenderingIntentDirections CONSTANT)
241 Q_PROPERTY(QVersionNumber profileIccVersion READ profileIccVersion CONSTANT)
251 Q_PROPERTY(QString profileManufacturer READ profileManufacturer CONSTANT)
262 Q_PROPERTY(
double profileMaximumCielchD50Chroma READ profileMaximumCielchD50Chroma CONSTANT)
273 Q_PROPERTY(
double profileMaximumOklchChroma READ profileMaximumOklchChroma CONSTANT)
283 Q_PROPERTY(QString profileModel READ profileModel CONSTANT)
297 Q_PROPERTY(QString profileName READ profileName CONSTANT)
311 Q_PROPERTY(cmsColorSpaceSignature profilePcsColorModel READ profilePcsColorModel CONSTANT)
318 Q_PROPERTY(std::optional<cmsCIEXYZ> profileTagBlackpoint READ profileTagBlackpoint CONSTANT)
325 Q_PROPERTY(std::optional<cmsCIEXYZ> profileTagBluePrimary READ profileTagBluePrimary CONSTANT)
332 Q_PROPERTY(std::optional<cmsCIEXYZ> profileTagGreenPrimary READ profileTagGreenPrimary CONSTANT)
339 Q_PROPERTY(std::optional<cmsCIEXYZ> profileTagRedPrimary READ profileTagRedPrimary CONSTANT)
350 Q_PROPERTY(QStringList profileTagSignatures READ profileTagSignatures CONSTANT)
357 Q_PROPERTY(std::optional<cmsCIEXYZ> profileTagWhitepoint READ profileTagWhitepoint CONSTANT)
360 [[nodiscard]]
Q_INVOKABLE static QSharedPointer<PerceptualColor::RgbColorSpace> tryCreateFromFile(
const QString &fileName);
361 [[nodiscard]]
Q_INVOKABLE static QSharedPointer<PerceptualColor::RgbColorSpace> createSrgb();
364 virtual ~RgbColorSpace() noexcept override;
365 [[nodiscard]]
Q_INVOKABLE virtual
bool isCielabD50InGamut(const cmsCIELab &lab) const;
366 [[nodiscard]]
Q_INVOKABLE virtual
bool isCielchD50InGamut(const PerceptualColor::GenericColor &lch) const;
367 [[nodiscard]]
Q_INVOKABLE virtual
bool isOklchInGamut(const PerceptualColor::GenericColor &lch) const;
368 [[nodiscard]]
Q_INVOKABLE QColor maxChromaColorByCielchD50Hue360(
double oklabHue360) const;
369 [[nodiscard]]
Q_INVOKABLE QColor maxChromaColorByOklabHue360(
double oklabHue360) const;
372 [[nodiscard]] QString profileAbsoluteFilePath() const;
375 [[nodiscard]] cmsProfileClassSignature profileClass() const;
378 [[nodiscard]] cmsColorSpaceSignature profileColorModel() const;
381 [[nodiscard]] QString profileCopyright() const;
384 [[nodiscard]] QDateTime profileCreationDateTime() const;
387 [[nodiscard]] qint64 profileFileSize() const;
390 [[nodiscard]]
bool profileHasClut() const;
393 [[nodiscard]]
bool profileHasMatrixShaper() const;
396 [[nodiscard]] QVersionNumber profileIccVersion() const;
399 [[nodiscard]] RenderingIntentDirections profileRenderingIntentDirections() const;
402 [[nodiscard]] QString profileManufacturer() const;
405 [[nodiscard]]
double profileMaximumCielchD50Chroma() const;
408 [[nodiscard]]
double profileMaximumOklchChroma() const;
411 [[nodiscard]] QString profileModel() const;
414 [[nodiscard]] QString profileName() const;
417 [[nodiscard]] cmsColorSpaceSignature profilePcsColorModel() const;
420 [[nodiscard]] std::optional<cmsCIEXYZ> profileTagBlackpoint() const;
423 [[nodiscard]] std::optional<cmsCIEXYZ> profileTagBluePrimary() const;
426 [[nodiscard]] std::optional<cmsCIEXYZ> profileTagGreenPrimary() const;
429 [[nodiscard]] std::optional<cmsCIEXYZ> profileTagRedPrimary() const;
432 [[nodiscard]] QStringList profileTagSignatures() const;
435 [[nodiscard]] std::optional<cmsCIEXYZ> profileTagWhitepoint() const;
440 [[nodiscard]]
Q_INVOKABLE virtual PerceptualColor::GenericColor reduceCielchD50ChromaToFitIntoGamut(const PerceptualColor::GenericColor &cielchD50color) const;
442 [[nodiscard]]
Q_INVOKABLE virtual PerceptualColor::GenericColor reduceOklchChromaToFitIntoGamut(const PerceptualColor::GenericColor &oklchColor) const;
443 [[nodiscard]]
Q_INVOKABLE virtual cmsCIELab toCielabD50(const QRgba64 rgbColor) const;
444 [[nodiscard]]
Q_INVOKABLE virtual PerceptualColor::GenericColor toCielchD50(const QRgba64 rgbColor) const;
445 [[nodiscard]]
Q_INVOKABLE static cmsCIELab fromLchToCmsCIELab(const PerceptualColor::GenericColor &lch);
446 [[nodiscard]]
Q_INVOKABLE virtual QRgb fromCielchD50ToQRgbBound(const PerceptualColor::GenericColor &cielchD50) const;
447 [[nodiscard]]
Q_INVOKABLE virtual QRgb fromCielabD50ToQRgbOrTransparent(const cmsCIELab &lab) const;
448 [[nodiscard]]
Q_INVOKABLE virtual PerceptualColor::GenericColor fromCielchD50ToRgb1(const PerceptualColor::GenericColor &lch) const;
451 Q_DISABLE_COPY(RgbColorSpace)
467 friend class RgbColorSpacePrivate;
469 ConstPropagatingUniquePointer<RgbColorSpacePrivate> d_pointer;
472 friend class TestRgbColorSpace;
477Q_DECLARE_METATYPE(PerceptualColor::RgbColorSpace::ProfileRole)
478Q_DECLARE_METATYPE(PerceptualColor::RgbColorSpace::RenderingIntentDirections)
The namespace of this library.
QObject * parent() const const