Subversion Repositories Scribus

Rev

Rev 6196 | 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
{
92
        if (m_Doc)
93
                return m_Doc->IntentColors;
6196 jghali 94
        return 1; // Use relative colorimetric by default
5813 jghali 95
}
96
 
97
int CMSettings::imageRenderingIntent() const
98
{
99
        if (m_Doc)
100
                return m_Doc->IntentImages;
6196 jghali 101
        return 0; // Use perceptual by default
5813 jghali 102
}
103
 
104
bool CMSettings::useBlackPoint() const
105
{
106
        if (m_Doc)
107
                return m_Doc->CMSSettings.BlackPoint;
5788 jghali 108
        return false;
109
}
110
 
5813 jghali 111
bool CMSettings::doSoftProofing() const
112
{
113
        if (m_Doc)
114
                return m_Doc->CMSSettings.SoftProofOn;
115
        return false;
116
}
117
 
118
bool CMSettings::doGamutCheck() const
119
{
120
        if (m_Doc)
121
                return m_Doc->CMSSettings.GamutCheck;
122
        return false;
123
}
124
 
5788 jghali 125
cmsHPROFILE CMSettings::monitorProfile() const
126
{
5940 jghali 127
        if (m_Doc->HasCMS)
5788 jghali 128
                return m_Doc->DocOutputProf;
129
        return NULL;
130
}
131
 
132
cmsHPROFILE CMSettings::printerProfile() const
133
{
5940 jghali 134
        if (m_Doc->HasCMS)
5788 jghali 135
                return m_Doc->DocPrinterProf;
136
        return NULL;
137
}
138
 
139
cmsHTRANSFORM CMSettings::rgbColorDisplayTransform() const  // stdTransRGBMonG
140
{
5940 jghali 141
        if (m_Doc->HasCMS)
5788 jghali 142
                return m_Doc->stdTransRGBMon;
143
        return NULL;
144
}
145
 
146
cmsHTRANSFORM CMSettings::rgbColorProofingTransform() const  // stdProofG
147
{
5940 jghali 148
        if (m_Doc->HasCMS)
5788 jghali 149
                return m_Doc->stdProof;
150
        return NULL;
151
}
152
 
153
cmsHTRANSFORM CMSettings::rgbImageDisplayTransform() const   // stdTransImgG
154
{
5940 jghali 155
        if (m_Doc->HasCMS)
5788 jghali 156
                return m_Doc->stdTransImg;
157
        return NULL;
158
}
159
 
160
cmsHTRANSFORM CMSettings::rgbImageProofingTransform() const  // stdProofImgG
161
{
5940 jghali 162
        if (m_Doc->HasCMS)
5788 jghali 163
                return m_Doc->stdProofImg;
164
        return NULL;
165
}
166
 
167
cmsHTRANSFORM CMSettings::rgbToCymkColorTransform() const // stdTransCMYKG
168
{
5940 jghali 169
        if (m_Doc->HasCMS)
5788 jghali 170
                return m_Doc->stdTransCMYK;
171
        return NULL;
172
}
173
 
174
cmsHTRANSFORM CMSettings::rgbGamutCheckTransform() const // stdProofGCG
175
{
5940 jghali 176
        if (m_Doc->HasCMS)
5788 jghali 177
                return m_Doc->stdProofGC;
178
        return NULL;
179
}
180
 
181
cmsHTRANSFORM CMSettings::cmykColorDisplayTransform() const // stdTransCMYKMonG
182
{
5940 jghali 183
        if (m_Doc->HasCMS)
5788 jghali 184
                return m_Doc->stdTransCMYKMon;
185
        return NULL;
186
}
187
 
188
cmsHTRANSFORM CMSettings::cmykColorProofingTransform() const // stdProofCMYKG
189
{
5940 jghali 190
        if (m_Doc->HasCMS)
5788 jghali 191
                return m_Doc->stdProofCMYK;
192
        return NULL;
193
}
194
 
195
cmsHTRANSFORM CMSettings::cmykToRgbColorTransform() const  // stdTransRGBG
196
{
5940 jghali 197
        if (m_Doc->HasCMS)
5788 jghali 198
                return m_Doc->stdTransRGB;
199
        return NULL;
200
}
201
 
202
cmsHTRANSFORM CMSettings::cmykGamutCheckTransform() const //stdProofCMYKGCG
203
{
5940 jghali 204
        if (m_Doc->HasCMS)
5788 jghali 205
                return m_Doc->stdProofCMYKGC;
206
        return NULL;
207
}