Subversion Repositories Scribus

Rev

Rev 15001 | Rev 23163 | 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.,                                       *
18122 mrdocs 24
 *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.             *
5783 cbradney 25
 ***************************************************************************/
26
 
27
#include "cmsettings.h"
28
#include "scribusdoc.h"
29
 
14170 jghali 30
CMSettings::CMSettings(ScribusDoc* doc, const QString& profileName, eRenderIntent intent) :
5783 cbradney 31
m_Doc(doc),
14467 jghali 32
m_colorManagementAllowed(true),
33
m_softProofingAllowed(false),
34
m_useEmbeddedProfile(false),
5959 jghali 35
m_ProfileName(profileName),
36
m_Intent(intent)
5783 cbradney 37
{
38
}
39
 
40
CMSettings::~CMSettings()
41
{
42
}
5788 jghali 43
 
44
bool CMSettings::useColorManagement() const
45
{
5813 jghali 46
        if (m_Doc)
14467 jghali 47
                return (m_Doc->HasCMS && m_colorManagementAllowed);
5792 jghali 48
        return false;
5813 jghali 49
}
50
 
6070 jghali 51
QString CMSettings::defaultMonitorProfile() const
5813 jghali 52
{
53
        if (m_Doc)
15001 cbradney 54
                return m_Doc->cmsSettings().DefaultMonitorProfile;
5813 jghali 55
        return QString();
56
}
57
 
6070 jghali 58
QString CMSettings::defaultPrinterProfile() const
5813 jghali 59
{
60
        if (m_Doc)
15001 cbradney 61
                return m_Doc->cmsSettings().DefaultPrinterProfile;
5813 jghali 62
        return QString();
63
}
64
 
6070 jghali 65
QString CMSettings::defaultImageRGBProfile() const
5813 jghali 66
{
67
        if (m_Doc)
15001 cbradney 68
                return m_Doc->cmsSettings().DefaultImageRGBProfile;
5813 jghali 69
        return QString();
70
}
71
 
6070 jghali 72
QString CMSettings::defaultImageCMYKProfile() const
5813 jghali 73
{
74
        if (m_Doc)
15001 cbradney 75
                return m_Doc->cmsSettings().DefaultImageCMYKProfile;
5813 jghali 76
        return QString();
77
}
78
 
6070 jghali 79
QString CMSettings::defaultSolidColorRGBProfile() const
5813 jghali 80
{
81
        if (m_Doc)
15001 cbradney 82
                return m_Doc->cmsSettings().DefaultSolidColorRGBProfile;
5813 jghali 83
        return QString();
84
}
85
 
6070 jghali 86
QString CMSettings::defaultSolidColorCMYKProfile() const
5813 jghali 87
{
88
        if (m_Doc)
15001 cbradney 89
                return m_Doc->cmsSettings().DefaultSolidColorCMYKProfile;
5813 jghali 90
        return QString();
91
}
92
 
14170 jghali 93
eRenderIntent CMSettings::colorRenderingIntent() const
5813 jghali 94
{
95
        if (m_Doc)
96
                return m_Doc->IntentColors;
14170 jghali 97
        return Intent_Relative_Colorimetric; // Use relative colorimetric by default
5813 jghali 98
}
99
 
14170 jghali 100
eRenderIntent CMSettings::imageRenderingIntent() const
5813 jghali 101
{
102
        if (m_Doc)
103
                return m_Doc->IntentImages;
14170 jghali 104
        return Intent_Perceptual; // Use perceptual by default
5813 jghali 105
}
106
 
107
bool CMSettings::useBlackPoint() const
108
{
109
        if (m_Doc)
15001 cbradney 110
                return m_Doc->cmsSettings().BlackPoint;
5788 jghali 111
        return false;
112
}
113
 
5813 jghali 114
bool CMSettings::doSoftProofing() const
115
{
116
        if (m_Doc)
15001 cbradney 117
                return (m_Doc->cmsSettings().SoftProofOn && m_softProofingAllowed);
5813 jghali 118
        return false;
119
}
120
 
121
bool CMSettings::doGamutCheck() const
122
{
123
        if (m_Doc)
15001 cbradney 124
                return (m_Doc->cmsSettings().GamutCheck && m_softProofingAllowed);
5813 jghali 125
        return false;
126
}
127
 
14170 jghali 128
ScColorProfile CMSettings::monitorProfile() const
5788 jghali 129
{
10338 jghali 130
        if (m_Doc)
14281 jghali 131
                return m_Doc->DocDisplayProf;
14170 jghali 132
        return ScColorProfile();
5788 jghali 133
}
134
 
14170 jghali 135
ScColorProfile CMSettings::printerProfile() const
5788 jghali 136
{
10338 jghali 137
        if (m_Doc)
5788 jghali 138
                return m_Doc->DocPrinterProf;
14170 jghali 139
        return ScColorProfile();
5788 jghali 140
}
141
 
14467 jghali 142
ScColorProfile CMSettings::outputProfile() const
143
{
144
        return m_outputProfile;
145
}
146
 
14170 jghali 147
ScColorTransform CMSettings::rgbColorDisplayTransform() const  // stdTransRGBMonG
5788 jghali 148
{
10338 jghali 149
        if (m_Doc)
5788 jghali 150
                return m_Doc->stdTransRGBMon;
14170 jghali 151
        return ScColorTransform();
5788 jghali 152
}
153
 
14170 jghali 154
ScColorTransform CMSettings::rgbColorProofingTransform() const  // stdProofG
5788 jghali 155
{
10338 jghali 156
        if (m_Doc)
5788 jghali 157
                return m_Doc->stdProof;
14170 jghali 158
        return ScColorTransform();
5788 jghali 159
}
160
 
14170 jghali 161
ScColorTransform CMSettings::rgbImageDisplayTransform() const   // stdTransImgG
5788 jghali 162
{
10338 jghali 163
        if (m_Doc)
5788 jghali 164
                return m_Doc->stdTransImg;
14170 jghali 165
        return ScColorTransform();
5788 jghali 166
}
167
 
14170 jghali 168
ScColorTransform CMSettings::rgbImageProofingTransform() const  // stdProofImgG
5788 jghali 169
{
10338 jghali 170
        if (m_Doc)
5788 jghali 171
                return m_Doc->stdProofImg;
14170 jghali 172
        return ScColorTransform();
5788 jghali 173
}
174
 
14170 jghali 175
ScColorTransform CMSettings::rgbToCymkColorTransform() const // stdTransCMYKG
5788 jghali 176
{
10338 jghali 177
        if (m_Doc)
5788 jghali 178
                return m_Doc->stdTransCMYK;
14170 jghali 179
        return ScColorTransform();
5788 jghali 180
}
181
 
14170 jghali 182
ScColorTransform CMSettings::rgbGamutCheckTransform() const // stdProofGCG
5788 jghali 183
{
10338 jghali 184
        if (m_Doc)
5788 jghali 185
                return m_Doc->stdProofGC;
14170 jghali 186
        return ScColorTransform();
5788 jghali 187
}
188
 
14170 jghali 189
ScColorTransform CMSettings::cmykColorDisplayTransform() const // stdTransCMYKMonG
5788 jghali 190
{
10338 jghali 191
        if (m_Doc)
5788 jghali 192
                return m_Doc->stdTransCMYKMon;
14170 jghali 193
        return ScColorTransform();
5788 jghali 194
}
195
 
14170 jghali 196
ScColorTransform CMSettings::cmykColorProofingTransform() const // stdProofCMYKG
5788 jghali 197
{
10338 jghali 198
        if (m_Doc)
5788 jghali 199
                return m_Doc->stdProofCMYK;
14170 jghali 200
        return ScColorTransform();
5788 jghali 201
}
202
 
14170 jghali 203
ScColorTransform CMSettings::cmykImageProofingTransform() const // stdProofImgCMYK
10338 jghali 204
{
205
        if (m_Doc)
206
                return m_Doc->stdProofImgCMYK;
14170 jghali 207
        return ScColorTransform();
10338 jghali 208
}
209
 
14170 jghali 210
ScColorTransform CMSettings::cmykToRgbColorTransform() const  // stdTransRGBG
5788 jghali 211
{
10338 jghali 212
        if (m_Doc)
5788 jghali 213
                return m_Doc->stdTransRGB;
14170 jghali 214
        return ScColorTransform();
5788 jghali 215
}
216
 
14170 jghali 217
ScColorTransform CMSettings::cmykGamutCheckTransform() const //stdProofCMYKGCG
5788 jghali 218
{
10338 jghali 219
        if (m_Doc)
5788 jghali 220
                return m_Doc->stdProofCMYKGC;
14170 jghali 221
        return ScColorTransform();
5788 jghali 222
}