Subversion Repositories Scribus

Rev

Rev 6070 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
5783 cbradney 1
/*
2
For general Scribus (>=1.3.2) copyright and licensing information please refer
3
to the COPYING file provided with the program. Following this notice may exist
4
a copyright and/or license notice that predates the release of Scribus 1.3.2
5
for which a new license (GPL+exception) is in place.
6
*/
7
/***************************************************************************
8
 *   Copyright (C) 2006 by Craig Bradney                                   *
9
 *   mrb@scribus.info                                                      *
10
 *                                                                         *
11
 *   This program is free software; you can redistribute it and/or modify  *
12
 *   it under the terms of the GNU General Public License as published by  *
13
 *   the Free Software Foundation; either version 2 of the License, or     *
14
 *   (at your option) any later version.                                   *
15
 *                                                                         *
16
 *   This program is distributed in the hope that it will be useful,       *
17
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
18
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
19
 *   GNU General Public License for more details.                          *
20
 *                                                                         *
21
 *   You should have received a copy of the GNU General Public License     *
22
 *   along with this program; if not, write to the                         *
23
 *   Free Software Foundation, Inc.,                                       *
24
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
25
 ***************************************************************************/
26
 
27
#include "cmsettings.h"
28
#include "scribusdoc.h"
29
 
5959 jghali 30
CMSettings::CMSettings(ScribusDoc* doc, const QString& profileName, int intent) :
5783 cbradney 31
m_Doc(doc),
5959 jghali 32
m_ProfileName(profileName),
33
m_Intent(intent)
5783 cbradney 34
{
35
}
36
 
37
CMSettings::~CMSettings()
38
{
39
}
5788 jghali 40
 
41
bool CMSettings::useColorManagement() const
42
{
5813 jghali 43
        if (m_Doc)
5940 jghali 44
                return m_Doc->HasCMS;
5792 jghali 45
        return false;
5813 jghali 46
}
47
 
6070 jghali 48
QString CMSettings::defaultMonitorProfile() const
5813 jghali 49
{
50
        if (m_Doc)
51
                return m_Doc->CMSSettings.DefaultMonitorProfile;
52
        return QString();
53
}
54
 
6070 jghali 55
QString CMSettings::defaultPrinterProfile() const
5813 jghali 56
{
57
        if (m_Doc)
58
                return m_Doc->CMSSettings.DefaultPrinterProfile;
59
        return QString();
60
}
61
 
6070 jghali 62
QString CMSettings::defaultImageRGBProfile() const
5813 jghali 63
{
64
        if (m_Doc)
65
                return m_Doc->CMSSettings.DefaultImageRGBProfile;
66
        return QString();
67
}
68
 
6070 jghali 69
QString CMSettings::defaultImageCMYKProfile() const
5813 jghali 70
{
71
        if (m_Doc)
72
                return m_Doc->CMSSettings.DefaultImageCMYKProfile;
73
        return QString();
74
}
75
 
6070 jghali 76
QString CMSettings::defaultSolidColorRGBProfile() const
5813 jghali 77
{
78
        if (m_Doc)
79
                return m_Doc->CMSSettings.DefaultSolidColorRGBProfile;
80
        return QString();
81
}
82
 
6070 jghali 83
QString CMSettings::defaultSolidColorCMYKProfile() const
5813 jghali 84
{
85
        if (m_Doc)
86
                return m_Doc->CMSSettings.DefaultSolidColorCMYKProfile;
87
        return QString();
88
}
89
 
90
int CMSettings::colorRenderingIntent() const
91
{
6196 jghali 92
#ifdef HAVE_CMS
5813 jghali 93
        if (m_Doc)
94
                return m_Doc->IntentColors;
6196 jghali 95
#endif
96
        return 1; // Use relative colorimetric by default
5813 jghali 97
}
98
 
99
int CMSettings::imageRenderingIntent() const
100
{
6196 jghali 101
#ifdef HAVE_CMS
5813 jghali 102
        if (m_Doc)
103
                return m_Doc->IntentImages;
6196 jghali 104
#endif
105
        return 0; // Use perceptual by default
5813 jghali 106
}
107
 
108
bool CMSettings::useBlackPoint() const
109
{
110
        if (m_Doc)
111
                return m_Doc->CMSSettings.BlackPoint;
5788 jghali 112
        return false;
113
}
114
 
5813 jghali 115
bool CMSettings::doSoftProofing() const
116
{
117
        if (m_Doc)
118
                return m_Doc->CMSSettings.SoftProofOn;
119
        return false;
120
}
121
 
122
bool CMSettings::doGamutCheck() const
123
{
124
        if (m_Doc)
125
                return m_Doc->CMSSettings.GamutCheck;
126
        return false;
127
}
128
 
5788 jghali 129
#ifdef HAVE_CMS
130
cmsHPROFILE CMSettings::monitorProfile() const
131
{
5940 jghali 132
        if (m_Doc->HasCMS)
5788 jghali 133
                return m_Doc->DocOutputProf;
134
        return NULL;
135
}
136
 
137
cmsHPROFILE CMSettings::printerProfile() const
138
{
5940 jghali 139
        if (m_Doc->HasCMS)
5788 jghali 140
                return m_Doc->DocPrinterProf;
141
        return NULL;
142
}
143
 
144
cmsHTRANSFORM CMSettings::rgbColorDisplayTransform() const  // stdTransRGBMonG
145
{
5940 jghali 146
        if (m_Doc->HasCMS)
5788 jghali 147
                return m_Doc->stdTransRGBMon;
148
        return NULL;
149
}
150
 
151
cmsHTRANSFORM CMSettings::rgbColorProofingTransform() const  // stdProofG
152
{
5940 jghali 153
        if (m_Doc->HasCMS)
5788 jghali 154
                return m_Doc->stdProof;
155
        return NULL;
156
}
157
 
158
cmsHTRANSFORM CMSettings::rgbImageDisplayTransform() const   // stdTransImgG
159
{
5940 jghali 160
        if (m_Doc->HasCMS)
5788 jghali 161
                return m_Doc->stdTransImg;
162
        return NULL;
163
}
164
 
165
cmsHTRANSFORM CMSettings::rgbImageProofingTransform() const  // stdProofImgG
166
{
5940 jghali 167
        if (m_Doc->HasCMS)
5788 jghali 168
                return m_Doc->stdProofImg;
169
        return NULL;
170
}
171
 
172
cmsHTRANSFORM CMSettings::rgbToCymkColorTransform() const // stdTransCMYKG
173
{
5940 jghali 174
        if (m_Doc->HasCMS)
5788 jghali 175
                return m_Doc->stdTransCMYK;
176
        return NULL;
177
}
178
 
179
cmsHTRANSFORM CMSettings::rgbGamutCheckTransform() const // stdProofGCG
180
{
5940 jghali 181
        if (m_Doc->HasCMS)
5788 jghali 182
                return m_Doc->stdProofGC;
183
        return NULL;
184
}
185
 
186
cmsHTRANSFORM CMSettings::cmykColorDisplayTransform() const // stdTransCMYKMonG
187
{
5940 jghali 188
        if (m_Doc->HasCMS)
5788 jghali 189
                return m_Doc->stdTransCMYKMon;
190
        return NULL;
191
}
192
 
193
cmsHTRANSFORM CMSettings::cmykColorProofingTransform() const // stdProofCMYKG
194
{
5940 jghali 195
        if (m_Doc->HasCMS)
5788 jghali 196
                return m_Doc->stdProofCMYK;
197
        return NULL;
198
}
199
 
200
cmsHTRANSFORM CMSettings::cmykToRgbColorTransform() const  // stdTransRGBG
201
{
5940 jghali 202
        if (m_Doc->HasCMS)
5788 jghali 203
                return m_Doc->stdTransRGB;
204
        return NULL;
205
}
206
 
207
cmsHTRANSFORM CMSettings::cmykGamutCheckTransform() const //stdProofCMYKGCG
208
{
5940 jghali 209
        if (m_Doc->HasCMS)
5788 jghali 210
                return m_Doc->stdProofCMYKGC;
211
        return NULL;
212
}
213
 
214
#endif