Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Miguel Lopez
Krita
Commits
92e75852
Commit
92e75852
authored
Jan 16, 2010
by
Cyrille Berger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use the new function to access colorspace
svn path=/trunk/koffice/; revision=1075517
parent
7ce9a273
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
7 deletions
+7
-7
libs/pigment/KoColor.cpp
libs/pigment/KoColor.cpp
+3
-4
libs/pigment/KoColorConversionSystem.cpp
libs/pigment/KoColorConversionSystem.cpp
+1
-1
libs/pigment/resources/KoStopGradient.cpp
libs/pigment/resources/KoStopGradient.cpp
+3
-2
No files found.
libs/pigment/KoColor.cpp
View file @
92e75852
...
...
@@ -284,14 +284,13 @@ KoColor KoColor::fromXML(const QDomElement& elt, const QString & bitDepthId, con
profileName
=
""
;
}
}
QString
cs
Id
=
KoColorSpaceRegistry
::
instance
()
->
colorSpace
Id
(
modelId
,
bitDepthId
);
if
(
cs
Id
.
isEmpty
()
)
{
const
KoColorSpace
*
cs
=
KoColorSpaceRegistry
::
instance
()
->
colorSpace
(
modelId
,
bitDepthId
,
profileName
);
if
(
cs
==
0
)
{
QList
<
KoID
>
list
=
KoColorSpaceRegistry
::
instance
()
->
colorDepthList
(
modelId
,
KoColorSpaceRegistry
::
AllColorSpaces
);
if
(
!
list
.
empty
())
{
cs
Id
=
KoColorSpaceRegistry
::
instance
()
->
colorSpace
Id
(
modelId
,
list
[
0
].
id
());
cs
=
KoColorSpaceRegistry
::
instance
()
->
colorSpace
(
modelId
,
list
[
0
].
id
()
,
profileName
);
}
}
const
KoColorSpace
*
cs
=
KoColorSpaceRegistry
::
instance
()
->
colorSpace
(
csId
,
profileName
);
if
(
cs
)
{
KoColor
c
(
cs
);
cs
->
colorFromXML
(
c
.
data
(),
elt
);
...
...
libs/pigment/KoColorConversionSystem.cpp
View file @
92e75852
...
...
@@ -178,7 +178,7 @@ void KoColorConversionSystem::insertColorProfile(const KoColorProfile* _profile)
const
KoColorSpace
*
KoColorConversionSystem
::
defaultColorSpaceForNode
(
const
Node
*
node
)
const
{
return
KoColorSpaceRegistry
::
instance
()
->
colorSpace
(
KoColorSpaceRegistry
::
instance
()
->
colorSpaceId
(
node
->
modelId
,
node
->
depthId
)
,
node
->
profileName
);
return
KoColorSpaceRegistry
::
instance
()
->
colorSpace
(
node
->
modelId
,
node
->
depthId
,
node
->
profileName
);
}
KoColorConversionSystem
::
Node
*
KoColorConversionSystem
::
createNode
(
const
QString
&
_modelId
,
const
QString
&
_depthId
,
const
QString
&
_profileName
)
...
...
libs/pigment/resources/KoStopGradient.cpp
View file @
92e75852
...
...
@@ -31,6 +31,7 @@
#include "KoColorSpaceRegistry.h"
#include <math.h>
#include <KoColorModelStandardIds.h>
KoStopGradient
::
KoStopGradient
(
const
QString
&
filename
)
:
KoAbstractGradient
(
filename
)
...
...
@@ -326,7 +327,7 @@ void KoStopGradient::parseKarbonGradient(const QDomElement& element)
color3
=
e
.
attribute
(
"v3"
,
"0.0"
).
toFloat
();
color4
=
e
.
attribute
(
"v4"
,
"0.0"
).
toFloat
();
stopColorSpace
=
KoColorSpaceRegistry
::
instance
()
->
colorSpace
(
"
CMYK
"
,
QString
());
stopColorSpace
=
KoColorSpaceRegistry
::
instance
()
->
colorSpace
(
CMYK
AColorModelID
.
id
(),
Integer8BitsColorDepthID
.
id
()
,
QString
());
if
(
stopColorSpace
)
{
quint8
data
[
5
];
data
[
0
]
=
static_cast
<
quint8
>
(
color1
*
255
+
0.5
);
...
...
@@ -355,7 +356,7 @@ void KoStopGradient::parseKarbonGradient(const QDomElement& element)
break
;
case
3
:
// gray
color1
=
e
.
attribute
(
"v1"
,
"0.0"
).
toFloat
();
stopColorSpace
=
KoColorSpaceRegistry
::
instance
()
->
colorSpace
(
"GRAY"
,
QString
());
stopColorSpace
=
KoColorSpaceRegistry
::
instance
()
->
colorSpace
(
GrayAColorModelID
.
id
(),
Integer8BitsColorDepthID
.
id
()
,
QString
());
if
(
stopColorSpace
)
{
quint8
data
[
2
];
data
[
0
]
=
static_cast
<
quint8
>
(
color1
*
255
+
0.5
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment