summaryrefslogtreecommitdiffstats
path: root/src/imageplugins/coreplugin/iccprooftool.h
blob: 86d93ea9a4053c47120f8dcc205f4c1bf45e81db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
/* ============================================================
 *
 * This file is a part of digiKam project
 * http://www.digikam.org
 *
 * Date        : 2005-12-21
 * Description : digiKam image editor tool to correct picture
 *               colors using an ICC color profile
 *
 * Copyright (C) 2005-2006 by F.J. Cruz <[email protected]>
 * Copyright (C) 2006-2008 by Gilles Caulier <caulier dot gilles at gmail dot com>
 *
 * This program is free software; you can redistribute it
 * and/or modify it under the terms of the GNU General
 * Public License as published by the Free Software Foundation;
 * either version 2, or (at your option)
 * any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * ============================================================ */

#ifndef ICCPROOFTOOL_H
#define ICCPROOFTOOL_H

// Digikam includes.

#include "editortool.h"

class TQCheckBox;
class TQComboBox;
class TQVButtonGroup;
class TQButtonGroup;
class TQHButtonGroup;
class TQRadioButton;
class TQPushButton;
class TQToolBox;

class KURLRequester;

namespace KDcrawIface
{
class RIntNumInput;
class RComboBox;
}

namespace Digikam
{
class ICCTransform;
class ImageWidget;
class HistogramWidget;
class ColorGradientWidget;
class DColor;
class ICCPreviewWidget;
class CurvesWidget;
}

namespace DigikamImagesPluginCore
{

class ICCProofTool : public Digikam::EditorTool
{
    TQ_OBJECT
  

public:

    ICCProofTool(TQObject* parent);
    ~ICCProofTool();

protected:

    void finalRendering();

private:

    void readSettings();
    void writeSettings();

    void getICCInfo(const TQString&);
    void getICCInfo(const TQByteArray&);

    bool useBPC();
    bool doProof();
    bool checkGamut();
    bool embedProfile();

    bool useEmbeddedProfile();
    bool useBuiltinProfile();
    bool useDefaultInProfile();
    bool useSelectedInProfile();

    bool useDefaultSpaceProfile();
    bool useSelectedSpaceProfile();

    bool useDefaultProofProfile();
    bool useSelectedProofProfile();

private slots:

    void slotSaveAsSettings();
    void slotLoadSettings();
    void slotEffect();
    void slotResetSettings();
    void slotChannelChanged(int);
    void slotScaleChanged(int);
    void slotSpotColorChanged(const Digikam::DColor &);
    void slotColorSelectedFromTarget(const Digikam::DColor &);
    void slotToggledWidgets(bool);
    void slotInICCInfo();
    void slotProofICCInfo();
    void slotSpaceICCInfo();
    void slotCMDisabledWarning();
    void processLCMSURL(const TQString&);

private:

    enum HistogramScale
    {
        Linear = 0,
        Logarithmic
    };

    enum ColorChannel
    {
        LuminosityChannel = 0,
        RedChannel,
        GreenChannel,
        BlueChannel
    };

    enum ICCSettingsTab
    {
        GENERALPAGE=0,
        INPUTPAGE,
        WORKSPACEPAGE,
        PROOFINGPAGE,
        LIGHTNESSPAGE
    };

    bool                            m_cmEnabled;
    bool                            m_hasICC;

    uchar                          *m_destinationPreviewData;

    TQComboBox                      *m_channelCB;

    TQCheckBox                      *m_doSoftProofBox;
    TQCheckBox                      *m_checkGamutBox;
    TQCheckBox                      *m_embeddProfileBox;
    TQCheckBox                      *m_BPCBox;

    TQRadioButton                   *m_useEmbeddedProfile;
    TQRadioButton                   *m_useInDefaultProfile;
    TQRadioButton                   *m_useInSelectedProfile;
    TQRadioButton                   *m_useProofDefaultProfile;
    TQRadioButton                   *m_useProofSelectedProfile;
    TQRadioButton                   *m_useSpaceDefaultProfile;
    TQRadioButton                   *m_useSpaceSelectedProfile;
    TQRadioButton                   *m_useSRGBDefaultProfile;

    TQString                         m_inPath;
    TQString                         m_spacePath;
    TQString                         m_proofPath;

    TQButtonGroup                   *m_optionsBG;
    TQButtonGroup                   *m_inProfileBG;
    TQButtonGroup                   *m_spaceProfileBG;
    TQButtonGroup                   *m_proofProfileBG;

    TQHButtonGroup                  *m_scaleBG;
    TQVButtonGroup                  *m_renderingIntentBG;
    TQVButtonGroup                  *m_profilesBG;

    TQByteArray                      m_embeddedICC;

    TQToolBox                       *m_toolBoxWidgets;

    KURLRequester                  *m_inProfilesPath;
    KURLRequester                  *m_spaceProfilePath;
    KURLRequester                  *m_proofProfilePath;

    KDcrawIface::RIntNumInput      *m_cInput;

    KDcrawIface::RComboBox         *m_renderingIntentsCB;

    Digikam::DImg                  *m_originalImage;

    Digikam::CurvesWidget          *m_curvesWidget;

    Digikam::ImageWidget           *m_previewWidget;

    Digikam::ColorGradientWidget   *m_hGradient;

    Digikam::HistogramWidget       *m_histogramWidget;

    Digikam::ICCPreviewWidget      *m_iccInPreviewWidget;
    Digikam::ICCPreviewWidget      *m_iccSpacePreviewWidget;
    Digikam::ICCPreviewWidget      *m_iccProofPreviewWidget;

    Digikam::EditorToolSettings    *m_gboxSettings;
};

}  // NameSpace DigikamImagesPluginCore

#endif  // ICCPROOFTOOL_H