summaryrefslogtreecommitdiffstats
path: root/src/sp-image.cpp
diff options
context:
space:
mode:
authorJon A. Cruz <jon@joncruz.org>2012-02-13 09:27:56 +0000
committerJon A. Cruz <jon@joncruz.org>2012-02-13 09:27:56 +0000
commit33e08823fec6157953453a938b10e2c731c8e1df (patch)
treef0c0214357fb5faeef6e2214d075384e72eccb8f /src/sp-image.cpp
parentFix wrong placement in authors (diff)
downloadinkscape-33e08823fec6157953453a938b10e2c731c8e1df.tar.gz
inkscape-33e08823fec6157953453a938b10e2c731c8e1df.zip
Enable LCMS2 for other than OSX, where it still has some issues. Fixes bug #885324.
Fixed bugs: - https://launchpad.net/bugs/885324 (bzr r10969)
Diffstat (limited to 'src/sp-image.cpp')
-rw-r--r--src/sp-image.cpp36
1 files changed, 21 insertions, 15 deletions
diff --git a/src/sp-image.cpp b/src/sp-image.cpp
index fd5a8037e..df0d052dd 100644
--- a/src/sp-image.cpp
+++ b/src/sp-image.cpp
@@ -44,10 +44,16 @@
#include "snap-candidate.h"
#include "io/sys.h"
-#if ENABLE_LCMS
+#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
#include "cms-system.h"
#include "color-profile.h"
-#include <lcms.h>
+
+#if HAVE_LIBLCMS2
+# include <lcms2.h>
+#elif HAVE_LIBLCMS1
+# include <lcms.h>
+#endif // HAVE_LIBLCMS2
+
//#define DEBUG_LCMS
#ifdef DEBUG_LCMS
@@ -60,7 +66,7 @@
#include "preferences.h"
#include <gtk/gtk.h>
#endif // DEBUG_LCMS
-#endif // ENABLE_LCMS
+#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
/*
* SPImage
*/
@@ -610,9 +616,9 @@ static void sp_image_init( SPImage *image )
image->curve = NULL;
image->href = 0;
-#if ENABLE_LCMS
+#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
image->color_profile = 0;
-#endif // ENABLE_LCMS
+#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
image->pixbuf = 0;
image->pixPath = 0;
image->lastMod = 0;
@@ -655,12 +661,12 @@ static void sp_image_release( SPObject *object )
image->pixbuf = NULL;
}
-#if ENABLE_LCMS
+#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
if (image->color_profile) {
g_free (image->color_profile);
image->color_profile = NULL;
}
-#endif // ENABLE_LCMS
+#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
if (image->pixPath) {
g_free(image->pixPath);
@@ -772,7 +778,7 @@ static void sp_image_set( SPObject *object, unsigned int key, const gchar *value
image->aspect_clip = clip;
}
break;
-#if ENABLE_LCMS
+#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
case SP_PROP_COLOR_PROFILE:
if ( image->color_profile ) {
g_free (image->color_profile);
@@ -788,7 +794,7 @@ static void sp_image_set( SPObject *object, unsigned int key, const gchar *value
// TODO check on this HREF_MODIFIED flag
object->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG | SP_IMAGE_HREF_MODIFIED_FLAG);
break;
-#endif // ENABLE_LCMS
+#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
default:
if (((SPObjectClass *) (parent_class))->set)
((SPObjectClass *) (parent_class))->set (object, key, value);
@@ -832,7 +838,7 @@ static void sp_image_update( SPObject *object, SPCtx *ctx, unsigned int flags )
if (pixbuf) {
pixbuf = sp_image_pixbuf_force_rgba (pixbuf);
// BLIP
-#if ENABLE_LCMS
+#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
if ( image->color_profile )
{
int imagewidth = gdk_pixbuf_get_width( pixbuf );
@@ -849,8 +855,8 @@ static void sp_image_update( SPObject *object, SPCtx *ctx, unsigned int flags )
&profIntent,
image->color_profile );
if ( prof ) {
- icProfileClassSignature profileClass = cmsGetDeviceClass( prof );
- if ( profileClass != icSigNamedColorClass ) {
+ cmsProfileClassSignature profileClass = cmsGetDeviceClass( prof );
+ if ( profileClass != cmsSigNamedColorClass ) {
int intent = INTENT_PERCEPTUAL;
switch ( profIntent ) {
case Inkscape::RENDERING_INTENT_RELATIVE_COLORIMETRIC:
@@ -907,7 +913,7 @@ static void sp_image_update( SPObject *object, SPCtx *ctx, unsigned int flags )
#endif // DEBUG_LCMS
}
}
-#endif // ENABLE_LCMS
+#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
image->pixbuf = pixbuf;
// convert to premultiplied native-endian ARGB for display with Cairo
convert_pixbuf_normal_to_argb32(image->pixbuf);
@@ -1044,11 +1050,11 @@ static Inkscape::XML::Node *sp_image_write( SPObject *object, Inkscape::XML::Doc
//XML Tree being used directly here while it shouldn't be...
repr->setAttribute("preserveAspectRatio", object->getRepr()->attribute("preserveAspectRatio"));
-#if ENABLE_LCMS
+#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
if (image->color_profile) {
repr->setAttribute("color-profile", image->color_profile);
}
-#endif // ENABLE_LCMS
+#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
if (((SPObjectClass *) (parent_class))->write) {
((SPObjectClass *) (parent_class))->write (object, xml_doc, repr, flags);