Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:07:58

0001 // Copyright (C) 2018 The Qt Company Ltd.
0002 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
0003 
0004 #ifndef QCOLORTRANSFORM_H
0005 #define QCOLORTRANSFORM_H
0006 
0007 #include <QtGui/qtguiglobal.h>
0008 #include <QtGui/qrgb.h>
0009 #include <QtCore/qshareddata.h>
0010 
0011 QT_BEGIN_NAMESPACE
0012 
0013 class QColor;
0014 class QRgba64;
0015 class QColorSpacePrivate;
0016 class QColorTransformPrivate;
0017 class qfloat16;
0018 template<typename T>
0019 class QRgbaFloat;
0020 typedef QRgbaFloat<qfloat16> QRgbaFloat16;
0021 typedef QRgbaFloat<float> QRgbaFloat32;
0022 
0023 QT_DECLARE_QESDP_SPECIALIZATION_DTOR_WITH_EXPORT(QColorTransformPrivate, Q_GUI_EXPORT)
0024 
0025 class QColorTransform
0026 {
0027 public:
0028     QColorTransform() noexcept = default;
0029     Q_GUI_EXPORT ~QColorTransform();
0030     Q_GUI_EXPORT QColorTransform(const QColorTransform &colorTransform) noexcept;
0031     QColorTransform(QColorTransform &&colorTransform) = default;
0032     QColorTransform &operator=(const QColorTransform &other) noexcept
0033     {
0034         QColorTransform{other}.swap(*this);
0035         return *this;
0036     }
0037     QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_MOVE_AND_SWAP(QColorTransform)
0038 
0039     void swap(QColorTransform &other) noexcept { d.swap(other.d); }
0040     Q_GUI_EXPORT bool isIdentity() const noexcept;
0041 
0042     Q_GUI_EXPORT QRgb map(QRgb argb) const;
0043     Q_GUI_EXPORT QRgba64 map(QRgba64 rgba64) const;
0044     Q_GUI_EXPORT QRgbaFloat16 map(QRgbaFloat16 rgbafp16) const;
0045     Q_GUI_EXPORT QRgbaFloat32 map(QRgbaFloat32 rgbafp32) const;
0046     Q_GUI_EXPORT QColor map(const QColor &color) const;
0047 
0048     friend bool operator==(const QColorTransform &ct1, const QColorTransform &ct2)
0049     { return ct1.compare(ct2); }
0050     friend bool operator!=(const QColorTransform &ct1, const QColorTransform &ct2)
0051     { return !ct1.compare(ct2); }
0052 
0053 private:
0054     friend class QColorSpacePrivate;
0055     friend class QColorTransformPrivate;
0056     Q_GUI_EXPORT bool compare(const QColorTransform &other) const;
0057 
0058     QExplicitlySharedDataPointer<QColorTransformPrivate> d;
0059 };
0060 
0061 Q_DECLARE_SHARED(QColorTransform)
0062 
0063 QT_END_NAMESPACE
0064 
0065 #endif // QCOLORTRANSFORM_H