~ubuntu-branches/ubuntu/maverick/scribus-ng/maverick-backports

« back to all changes in this revision

Viewing changes to scribus/cmsettings.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Oleksandr Moskalenko
  • Date: 2007-08-11 17:41:51 UTC
  • mfrom: (0.1.1 upstream) (4.1.2 feisty)
  • Revision ID: james.westby@ubuntu.com-20070811174151-tmkgjvjuc0mtk8ul
Tags: 1.3.4.dfsg+svn20071115-1
* Upstream svn update (Closes: #447480, #448949).
* debian/NEWS: Added a note for users wanting stable Scribus to switch to
  the "scribus" package (Closes: #427638).
* debian/watch: Updated the watch regex to properly track sourceforge
  releases for this branch (Closes: #449700).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
 
30
CMSettings::CMSettings(ScribusDoc* doc, const QString& profileName, int intent) :
 
31
m_Doc(doc),
 
32
m_ProfileName(profileName), 
 
33
m_Intent(intent)
 
34
{
 
35
}
 
36
 
 
37
CMSettings::~CMSettings()
 
38
{
 
39
}
 
40
 
 
41
bool CMSettings::useColorManagement() const
 
42
{
 
43
        if (m_Doc)
 
44
                return m_Doc->HasCMS;
 
45
        return false;
 
46
}
 
47
 
 
48
QString CMSettings::defaultMonitorProfile() const
 
49
{
 
50
        if (m_Doc)
 
51
                return m_Doc->CMSSettings.DefaultMonitorProfile;
 
52
        return QString();
 
53
}
 
54
 
 
55
QString CMSettings::defaultPrinterProfile() const
 
56
{
 
57
        if (m_Doc)
 
58
                return m_Doc->CMSSettings.DefaultPrinterProfile;
 
59
        return QString();
 
60
}
 
61
 
 
62
QString CMSettings::defaultImageRGBProfile() const
 
63
{
 
64
        if (m_Doc)
 
65
                return m_Doc->CMSSettings.DefaultImageRGBProfile;
 
66
        return QString();
 
67
}
 
68
 
 
69
QString CMSettings::defaultImageCMYKProfile() const
 
70
{
 
71
        if (m_Doc)
 
72
                return m_Doc->CMSSettings.DefaultImageCMYKProfile;
 
73
        return QString();
 
74
}
 
75
 
 
76
QString CMSettings::defaultSolidColorRGBProfile() const
 
77
{
 
78
        if (m_Doc)
 
79
                return m_Doc->CMSSettings.DefaultSolidColorRGBProfile;
 
80
        return QString();
 
81
}
 
82
 
 
83
QString CMSettings::defaultSolidColorCMYKProfile() const
 
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;
 
94
        return 1; // Use relative colorimetric by default
 
95
}
 
96
 
 
97
int CMSettings::imageRenderingIntent() const
 
98
{
 
99
        if (m_Doc)
 
100
                return m_Doc->IntentImages;
 
101
        return 0; // Use perceptual by default
 
102
}
 
103
 
 
104
bool CMSettings::useBlackPoint() const
 
105
{
 
106
        if (m_Doc)
 
107
                return m_Doc->CMSSettings.BlackPoint;
 
108
        return false;
 
109
}
 
110
 
 
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
 
 
125
cmsHPROFILE CMSettings::monitorProfile() const
 
126
{
 
127
        if (m_Doc->HasCMS)
 
128
                return m_Doc->DocOutputProf;
 
129
        return NULL;
 
130
}
 
131
 
 
132
cmsHPROFILE CMSettings::printerProfile() const
 
133
{
 
134
        if (m_Doc->HasCMS)
 
135
                return m_Doc->DocPrinterProf;
 
136
        return NULL;
 
137
}
 
138
 
 
139
cmsHTRANSFORM CMSettings::rgbColorDisplayTransform() const  // stdTransRGBMonG
 
140
{
 
141
        if (m_Doc->HasCMS)
 
142
                return m_Doc->stdTransRGBMon;
 
143
        return NULL;
 
144
}
 
145
 
 
146
cmsHTRANSFORM CMSettings::rgbColorProofingTransform() const  // stdProofG
 
147
{
 
148
        if (m_Doc->HasCMS)
 
149
                return m_Doc->stdProof;
 
150
        return NULL;
 
151
}
 
152
 
 
153
cmsHTRANSFORM CMSettings::rgbImageDisplayTransform() const   // stdTransImgG
 
154
{
 
155
        if (m_Doc->HasCMS)
 
156
                return m_Doc->stdTransImg;
 
157
        return NULL;
 
158
}
 
159
 
 
160
cmsHTRANSFORM CMSettings::rgbImageProofingTransform() const  // stdProofImgG
 
161
{
 
162
        if (m_Doc->HasCMS)
 
163
                return m_Doc->stdProofImg;
 
164
        return NULL;
 
165
}
 
166
 
 
167
cmsHTRANSFORM CMSettings::rgbToCymkColorTransform() const // stdTransCMYKG
 
168
{
 
169
        if (m_Doc->HasCMS)
 
170
                return m_Doc->stdTransCMYK;
 
171
        return NULL;
 
172
}
 
173
 
 
174
cmsHTRANSFORM CMSettings::rgbGamutCheckTransform() const // stdProofGCG
 
175
{
 
176
        if (m_Doc->HasCMS)
 
177
                return m_Doc->stdProofGC;
 
178
        return NULL;
 
179
}
 
180
 
 
181
cmsHTRANSFORM CMSettings::cmykColorDisplayTransform() const // stdTransCMYKMonG
 
182
{
 
183
        if (m_Doc->HasCMS)
 
184
                return m_Doc->stdTransCMYKMon;
 
185
        return NULL;
 
186
}
 
187
 
 
188
cmsHTRANSFORM CMSettings::cmykColorProofingTransform() const // stdProofCMYKG
 
189
{
 
190
        if (m_Doc->HasCMS)
 
191
                return m_Doc->stdProofCMYK;
 
192
        return NULL;
 
193
}
 
194
 
 
195
cmsHTRANSFORM CMSettings::cmykToRgbColorTransform() const  // stdTransRGBG
 
196
{
 
197
        if (m_Doc->HasCMS)
 
198
                return m_Doc->stdTransRGB;
 
199
        return NULL;
 
200
}
 
201
 
 
202
cmsHTRANSFORM CMSettings::cmykGamutCheckTransform() const //stdProofCMYKGCG
 
203
{
 
204
        if (m_Doc->HasCMS)
 
205
                return m_Doc->stdProofCMYKGC;
 
206
        return NULL;
 
207
}