small portability fixes

This commit is contained in:
John Cupitt 2012-11-18 09:44:45 +00:00
parent 9710679240
commit b3a6596732
2 changed files with 15 additions and 15 deletions

View File

@ -2,6 +2,7 @@ noinst_LTLIBRARIES = libcolour.la
libcolour_la_SOURCES = \ libcolour_la_SOURCES = \
colour.c \ colour.c \
colour.h \
colourspace.c \ colourspace.c \
colour_dispatch.c \ colour_dispatch.c \
dE76.c \ dE76.c \

View File

@ -65,16 +65,15 @@
*/ */
#ifdef HAVE_LCMS2 #ifdef HAVE_LCMS2
#include <lcms2.h> #include <lcms2.h>
/* This is slightly different in lcms2.
*/
#define SIG_LAB ((cmsColorSpaceSignature) icSigLabData)
#else /*HAVE_LCMS*/ #else /*HAVE_LCMS*/
#include <lcms.h> #include <lcms.h>
#define SIG_LAB icSigLabData
#endif
#include <icc34.h> /* Use the lcms2 names.
*/
#define icSigRgbData cmsSigRgbData
#define icSigLabData cmsSigLabData
#define icSigCmykData cmsSigCmykData
#endif
#include <vips/vips.h> #include <vips/vips.h>
@ -198,7 +197,7 @@ vips_icc_build( VipsObject *object )
if( icc->in_profile && if( icc->in_profile &&
code->in ) { code->in ) {
switch( cmsGetColorSpace( icc->in_profile ) ) { switch( cmsGetColorSpace( icc->in_profile ) ) {
case icSigRgbData: case cmsSigRgbData:
code->input_bands = 3; code->input_bands = 3;
code->input_format = code->input_format =
code->in->BandFmt == VIPS_FORMAT_USHORT ? code->in->BandFmt == VIPS_FORMAT_USHORT ?
@ -208,7 +207,7 @@ vips_icc_build( VipsObject *object )
TYPE_RGB_16 : TYPE_RGB_8; TYPE_RGB_16 : TYPE_RGB_8;
break; break;
case icSigCmykData: case cmsSigCmykData:
code->input_bands = 4; code->input_bands = 4;
code->input_format = code->input_format =
code->in->BandFmt == VIPS_FORMAT_USHORT ? code->in->BandFmt == VIPS_FORMAT_USHORT ?
@ -218,7 +217,7 @@ vips_icc_build( VipsObject *object )
TYPE_CMYK_16 : TYPE_CMYK_8; TYPE_CMYK_16 : TYPE_CMYK_8;
break; break;
case icSigLabData: case cmsSigLabData:
code->input_bands = 3; code->input_bands = 3;
code->input_format = VIPS_FORMAT_FLOAT; code->input_format = VIPS_FORMAT_FLOAT;
icc->in_icc_format = TYPE_Lab_16; icc->in_icc_format = TYPE_Lab_16;
@ -234,7 +233,7 @@ vips_icc_build( VipsObject *object )
if( icc->out_profile ) if( icc->out_profile )
switch( cmsGetColorSpace( icc->out_profile ) ) { switch( cmsGetColorSpace( icc->out_profile ) ) {
case icSigRgbData: case cmsSigRgbData:
colour->interpretation = colour->interpretation =
icc->depth == 8 ? icc->depth == 8 ?
VIPS_INTERPRETATION_RGB : VIPS_INTERPRETATION_RGB :
@ -248,7 +247,7 @@ vips_icc_build( VipsObject *object )
TYPE_RGB_16 : TYPE_RGB_8; TYPE_RGB_16 : TYPE_RGB_8;
break; break;
case icSigCmykData: case cmsSigCmykData:
colour->interpretation = VIPS_INTERPRETATION_CMYK; colour->interpretation = VIPS_INTERPRETATION_CMYK;
colour->format = colour->format =
icc->depth == 8 ? icc->depth == 8 ?
@ -259,7 +258,7 @@ vips_icc_build( VipsObject *object )
TYPE_CMYK_16 : TYPE_CMYK_8; TYPE_CMYK_16 : TYPE_CMYK_8;
break; break;
case icSigLabData: case cmsSigLabData:
colour->interpretation = VIPS_INTERPRETATION_LAB; colour->interpretation = VIPS_INTERPRETATION_LAB;
colour->format = VIPS_FORMAT_FLOAT; colour->format = VIPS_FORMAT_FLOAT;
colour->bands = 3; colour->bands = 3;
@ -277,8 +276,8 @@ vips_icc_build( VipsObject *object )
*/ */
if( icc->in_profile && if( icc->in_profile &&
icc->out_profile && icc->out_profile &&
cmsGetColorSpace( icc->in_profile ) == SIG_LAB && cmsGetColorSpace( icc->in_profile ) == cmsSigLabData &&
cmsGetColorSpace( icc->out_profile ) == SIG_LAB ) { cmsGetColorSpace( icc->out_profile ) == cmsSigLabData ) {
vips_error( class->nickname, vips_error( class->nickname,
"%s", _( "no device profile" ) ); "%s", _( "no device profile" ) );
return( -1 ); return( -1 );