summaryrefslogtreecommitdiffstats
path: root/src/svg
diff options
context:
space:
mode:
authorJon A. Cruz <jon@joncruz.org>2011-07-10 07:13:05 +0000
committerJon A. Cruz <jon@joncruz.org>2011-07-10 07:13:05 +0000
commitdf7bda1a8b9d4a1c6f0fd4b82cdeb614eb1ea8d2 (patch)
tree7e530343b12dd9ec752c6171c82f6108714c9acf /src/svg
parentMerge upstream GDL: GNOME_2_30_0 (diff)
downloadinkscape-df7bda1a8b9d4a1c6f0fd4b82cdeb614eb1ea8d2.tar.gz
inkscape-df7bda1a8b9d4a1c6f0fd4b82cdeb614eb1ea8d2.zip
Refactored to abstract lcms usage more. Added CMSSystem class.
(bzr r10437)
Diffstat (limited to 'src/svg')
-rw-r--r--src/svg/svg-color.cpp17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/svg/svg-color.cpp b/src/svg/svg-color.cpp
index 3605bde55..9293564d5 100644
--- a/src/svg/svg-color.cpp
+++ b/src/svg/svg-color.cpp
@@ -1,5 +1,3 @@
-#define __SP_SVG_COLOR_C__
-
/**
* \file
* Reading \& writing of SVG/CSS colors.
@@ -37,17 +35,16 @@
#include "svg-icc-color.h"
#if ENABLE_LCMS
-#include <lcms.h>
#include "color.h"
#include "color-profile.h"
#include "document.h"
#include "inkscape.h"
#include "profile-manager.h"
-#include "color-profile-cms-fns.h"
#endif // ENABLE_LCMS
-#include "color-profile-fns.h"
+#include "cms-system.h"
using std::sprintf;
+using Inkscape::CMSSystem;
struct SPSVGColor {
unsigned long rgb;
@@ -467,7 +464,7 @@ sp_svg_create_color_hash()
#if ENABLE_LCMS
//helper function borrowed from src/widgets/sp-color-icc-selector.cpp:
-void getThings( DWORD space, gchar const**& namers, gchar const**& tippies, guint const*& scalies );
+void getThings( Inkscape::ColorProfile *prof, gchar const**& namers, gchar const**& tippies, guint const*& scalies );
void icc_color_to_sRGB(SVGICCColor* icc, guchar* r, guchar* g, guchar* b){
guchar color_out[4];
@@ -481,18 +478,18 @@ g_message("profile name: %s", icc->colorProfile.c_str());
gchar const** names = 0;
gchar const** tips = 0;
guint const* scales = 0;
- getThings( asICColorSpaceSig(prof->getColorSpace()), names, tips, scales );
+ getThings( prof, names, tips, scales );
- guint count = _cmsChannelsOf( asICColorSpaceSig(prof->getColorSpace()) );
+ gint count = CMSSystem::getChannelCount( prof );
if (count > 4) {
count = 4; //do we need it? Should we allow an arbitrary number of color values? Or should we limit to a maximum? (max==4?)
}
- for (guint i=0;i<count; i++){
+ for (gint i = 0; i < count; i++){
color_in[i] = (guchar) ((((gdouble)icc->colors[i])*256.0) * (gdouble)scales[i]);
g_message("input[%d]: %d",i, color_in[i]);
}
- cmsDoTransform( trans, color_in, color_out, 1 );
+ CMSSystem::doTransform( trans, color_in, color_out, 1 );
g_message("transform to sRGB done");
}
*r = color_out[0];