~ubuntu-branches/ubuntu/intrepid/digikam/intrepid

« back to all changes in this revision

Viewing changes to digikam/libs/widgets/iccprofiles/cietonguewidget.h

  • Committer: Bazaar Package Importer
  • Author(s): Mark Purcell
  • Date: 2008-07-17 20:25:39 UTC
  • mfrom: (1.3.2 upstream) (37 hardy)
  • mto: This revision was merged to the branch mainline in revision 39.
  • Revision ID: james.westby@ubuntu.com-20080717202539-1bw3w3nrsso7yj4z
* New upstream release
  - digiKam 0.9.4 Release Plan (KDE3) ~ 13 July 08 (Closes: #490144)
* DEB_CONFIGURE_EXTRA_FLAGS := --without-included-sqlite3
* Debhelper compatibility level V7
* Install pixmaps in debian/*.install
* Add debian/digikam.lintian-overrides

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* ============================================================
 
2
 *
 
3
 * This file is a part of digiKam project
 
4
 * http://www.digikam.org
 
5
 *
 
6
 * Date        : 2006-01-10
 
7
 * Description : a widget to display CIE tongue from
 
8
 * an ICC profile.
 
9
 * 
 
10
 * Copyright (C) 2006-2008 by Gilles Caulier <caulier dot gilles at gmail dot com>
 
11
 *
 
12
 * Any source code are inspired from lprof project and
 
13
 * Copyright (C) 1998-2001 Marti Maria
 
14
 *
 
15
 * This program is free software; you can redistribute it
 
16
 * and/or modify it under the terms of the GNU General
 
17
 * Public License as published by the Free Software Foundation;
 
18
 * either version 2, or (at your option)
 
19
 * any later version.
 
20
 * 
 
21
 * This program is distributed in the hope that it will be useful,
 
22
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
23
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
24
 * GNU General Public License for more details.
 
25
 * 
 
26
 * ============================================================ */
 
27
 
 
28
#ifndef CIETONGUEWIDGET_H
 
29
#define CIETONGUEWIDGET_H
 
30
 
 
31
#include <config.h>
 
32
 
 
33
// Qt includes.
 
34
 
 
35
#include <qwidget.h>
 
36
#include <qcolor.h>
 
37
 
 
38
// KDE includes.
 
39
 
 
40
#include <kurl.h>
 
41
 
 
42
// lcms includes
 
43
 
 
44
#include LCMS_HEADER
 
45
#if LCMS_VERSION < 114
 
46
#define cmsTakeCopyright(profile) "Unknown"
 
47
#endif // LCMS_VERSION < 114
 
48
 
 
49
// Local includes
 
50
 
 
51
#include "digikam_export.h"
 
52
 
 
53
namespace Digikam
 
54
{
 
55
 
 
56
class CIETongueWidgetPriv;
 
57
 
 
58
class DIGIKAM_EXPORT CIETongueWidget : public QWidget
 
59
{
 
60
Q_OBJECT
 
61
 
 
62
public:
 
63
 
 
64
    CIETongueWidget(int w, int h, QWidget *parent=0, cmsHPROFILE hMonitor=0);
 
65
    ~CIETongueWidget();
 
66
 
 
67
    bool setProfileData(const QByteArray& profileData=QByteArray());
 
68
    bool setProfileFromFile(const KURL& file=KURL());
 
69
    
 
70
    void loadingStarted();
 
71
    void loadingFailed();
 
72
 
 
73
protected:
 
74
 
 
75
    int  grids(double val) const;
 
76
 
 
77
    void outlineTongue();
 
78
    void fillTongue();
 
79
    void drawTongueAxis();
 
80
    void drawTongueGrid();
 
81
    void drawLabels();
 
82
 
 
83
    QRgb colorByCoord(double x, double y);  
 
84
    void drawSmallElipse(LPcmsCIExyY xyY, BYTE r, BYTE g, BYTE b, int sz);
 
85
 
 
86
    void paintEvent( QPaintEvent * );
 
87
 
 
88
private:
 
89
 
 
90
    void drawColorantTriangle();
 
91
    void drawWhitePoint();
 
92
    void drawPatches();
 
93
    
 
94
    void mapPoint(int& icx, int& icy, LPcmsCIExyY xyY);
 
95
    void biasedLine(int x1, int y1, int x2, int y2);
 
96
    void biasedText(int x, int y, QString Txt);
 
97
 
 
98
    void sweep_sRGB();
 
99
 
 
100
    void setProfile(cmsHPROFILE hProfile);
 
101
 
 
102
private slots:
 
103
 
 
104
    void slotBlinkTimerDone();
 
105
 
 
106
private :
 
107
 
 
108
    CIETongueWidgetPriv* d;
 
109
 
 
110
};
 
111
 
 
112
}  // namespace Digikam
 
113
 
 
114
#endif /* CIETONGUEWIDGET_H */