digiKam
Loading...
Searching...
No Matches
cietonguewidget.h
Go to the documentation of this file.
1/* ============================================================
2 *
3 * This file is a part of digiKam project
4 * https://www.digikam.org
5 *
6 * Date : 2006-01-10
7 * Description : a widget to display CIE tongue from an ICC profile.
8 *
9 * SPDX-FileCopyrightText: 2006-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
10 *
11 * SPDX-License-Identifier: GPL-2.0-or-later
12 *
13 * ============================================================ */
14
15#pragma once
16
17// Qt includes
18
19#include <QWidget>
20#include <QColor>
21#include <QPaintEvent>
22#include <QUrl>
23
24// Local includes
25
26#include "digikam-lcms.h"
27#include "digikam_export.h"
28
29namespace Digikam
30{
31
32class DIGIKAM_EXPORT CIETongueWidget : public QWidget
33{
34 Q_OBJECT
35
36public:
37
38 explicit CIETongueWidget(int w, int h,
39 QWidget* const parent = nullptr,
40 cmsHPROFILE hMonitor = nullptr);
41 ~CIETongueWidget() override;
42
43 bool setProfileData(const QByteArray& profileData = QByteArray());
44 bool setProfileFromFile(const QUrl& file = QUrl());
45
46 void loadingStarted();
47 void loadingFailed();
48 void uncalibratedColor();
49
50protected:
51
52 int grids(double val) const;
53
54 void outlineTongue();
55 void fillTongue();
56 void drawTongueAxis();
57 void drawTongueGrid();
58 void drawLabels();
59
60 QRgb colorByCoord(double x, double y);
61 void drawSmallElipse(LPcmsCIExyY xyY, BYTE r, BYTE g, BYTE b, int sz);
62
63 void resizeEvent(QResizeEvent* event) override;
64 void paintEvent(QPaintEvent*) override;
65
66private:
67
68 void drawColorantTriangle();
69 void drawWhitePoint();
70 void drawPatches();
71 void updatePixmap();
72
73 void mapPoint(int& icx, int& icy, LPcmsCIExyY xyY);
74 void biasedLine(int x1, int y1, int x2, int y2);
75 void biasedText(int x, int y, const QString& txt);
76
77 void setProfile(cmsHPROFILE hProfile);
78
79private Q_SLOTS:
80
81 void slotProgressTimerDone();
82
83private:
84
85 class Private;
86 Private* const d = nullptr;
87};
88
89} // namespace Digikam
Definition cietonguewidget.h:33
unsigned char BYTE
Definition digikam-lcms.h:59
void * cmsHPROFILE
Opaque typedefs to hide internals.
Definition digikam-lcms.h:69
cmsCIExyY FAR * LPcmsCIExyY
Definition digikam-lcms.h:66
Definition datefolderview.cpp:34