• R/O
  • SSH
  • HTTPS

opfc: コミット


コミットメタ情報

リビジョン919 (tree)
日時2012-01-20 20:07:15
作者sho-otani

ログメッセージ

migration from liblcms1 to liblcms2

変更サマリ

差分

--- pdftoraster/trunk/src/pdftoraster.cc (revision 918)
+++ pdftoraster/trunk/src/pdftoraster.cc (revision 919)
@@ -53,7 +53,38 @@
5353 #include <splash/SplashBitmap.h>
5454 #include <strings.h>
5555 #include <math.h>
56+#ifdef USE_LCMS1
5657 #include <lcms.h>
58+#define cmsColorSpaceSignature icColorSpaceSignature
59+#define cmsSetLogErrorHandler cmsSetErrorHandler
60+#define cmsSigXYZData icSigXYZData
61+#define cmsSigLuvData icSigLuvData
62+#define cmsSigLabData icSigLabData
63+#define cmsSigYCbCrData icSigYCbCrData
64+#define cmsSigYxyData icSigYxyData
65+#define cmsSigRgbData icSigRgbData
66+#define cmsSigHsvData icSigHsvData
67+#define cmsSigHlsData icSigHlsData
68+#define cmsSigCmyData icSigCmyData
69+#define cmsSig3colorData icSig3colorData
70+#define cmsSigGrayData icSigGrayData
71+#define cmsSigCmykData icSigCmykData
72+#define cmsSig4colorData icSig4colorData
73+#define cmsSig2colorData icSig2colorData
74+#define cmsSig5colorData icSig5colorData
75+#define cmsSig6colorData icSig6colorData
76+#define cmsSig7colorData icSig7colorData
77+#define cmsSig8colorData icSig8colorData
78+#define cmsSig9colorData icSig9colorData
79+#define cmsSig10colorData icSig10colorData
80+#define cmsSig11colorData icSig11colorData
81+#define cmsSig12colorData icSig12colorData
82+#define cmsSig13colorData icSig13colorData
83+#define cmsSig14colorData icSig14colorData
84+#define cmsSig15colorData icSig15colorData
85+#else
86+#include <lcms2.h>
87+#endif
5788
5889 #define MAX_CHECK_COMMENT_LINES 20
5990 #define MAX_BYTES_PER_PIXEL 32
@@ -166,11 +197,19 @@
166197 fflush(stderr);
167198 }
168199
200+#ifdef USE_LCMS1
169201 static int lcmsErrorHandler(int ErrorCode, const char *ErrorText)
170202 {
171203 fprintf(stderr, "ERROR: %s\n",ErrorText);
172204 return 1;
173205 }
206+#else
207+static void lcmsErrorHandler(cmsContext contextId, cmsUInt32Number ErrorCode,
208+ const char *ErrorText)
209+{
210+ fprintf(stderr, "ERROR: %s\n",ErrorText);
211+}
212+#endif
174213
175214 static GBool getColorProfilePath(ppd_file_t *ppd, GooString *path)
176215 {
@@ -1134,56 +1173,56 @@
11341173 return false;
11351174 }
11361175
1137-static unsigned int getCMSColorSpaceType(icColorSpaceSignature cs)
1176+static unsigned int getCMSColorSpaceType(cmsColorSpaceSignature cs)
11381177 {
11391178 switch (cs) {
1140- case icSigXYZData:
1179+ case cmsSigXYZData:
11411180 return PT_XYZ;
11421181 break;
1143- case icSigLabData:
1182+ case cmsSigLabData:
11441183 return PT_Lab;
11451184 break;
1146- case icSigLuvData:
1185+ case cmsSigLuvData:
11471186 return PT_YUV;
11481187 break;
1149- case icSigYCbCrData:
1188+ case cmsSigYCbCrData:
11501189 return PT_YCbCr;
11511190 break;
1152- case icSigYxyData:
1191+ case cmsSigYxyData:
11531192 return PT_Yxy;
11541193 break;
1155- case icSigRgbData:
1194+ case cmsSigRgbData:
11561195 return PT_RGB;
11571196 break;
1158- case icSigGrayData:
1197+ case cmsSigGrayData:
11591198 return PT_GRAY;
11601199 break;
1161- case icSigHsvData:
1200+ case cmsSigHsvData:
11621201 return PT_HSV;
11631202 break;
1164- case icSigHlsData:
1203+ case cmsSigHlsData:
11651204 return PT_HLS;
11661205 break;
1167- case icSigCmykData:
1206+ case cmsSigCmykData:
11681207 return PT_CMYK;
11691208 break;
1170- case icSigCmyData:
1209+ case cmsSigCmyData:
11711210 return PT_CMY;
11721211 break;
1173- case icSig2colorData:
1174- case icSig3colorData:
1175- case icSig4colorData:
1176- case icSig5colorData:
1177- case icSig6colorData:
1178- case icSig7colorData:
1179- case icSig8colorData:
1180- case icSig9colorData:
1181- case icSig10colorData:
1182- case icSig11colorData:
1183- case icSig12colorData:
1184- case icSig13colorData:
1185- case icSig14colorData:
1186- case icSig15colorData:
1212+ case cmsSig2colorData:
1213+ case cmsSig3colorData:
1214+ case cmsSig4colorData:
1215+ case cmsSig5colorData:
1216+ case cmsSig6colorData:
1217+ case cmsSig7colorData:
1218+ case cmsSig8colorData:
1219+ case cmsSig9colorData:
1220+ case cmsSig10colorData:
1221+ case cmsSig11colorData:
1222+ case cmsSig12colorData:
1223+ case cmsSig13colorData:
1224+ case cmsSig14colorData:
1225+ case cmsSig15colorData:
11871226 default:
11881227 break;
11891228 }
@@ -1634,7 +1673,11 @@
16341673 case CUPS_CSPACE_ICCF:
16351674 if (colorProfile == NULL) {
16361675 cmsCIExyY wp;
1676+#ifdef USE_LCMS1
16371677 cmsWhitePointFromTemp(6504,&wp); /* D65 White point */
1678+#else
1679+ cmsWhitePointFromTemp(&wp,6504); /* D65 White point */
1680+#endif
16381681 colorProfile = cmsCreateLab4Profile(&wp);
16391682 }
16401683 break;
@@ -1642,7 +1685,11 @@
16421685 if (colorProfile == NULL) {
16431686 /* tansform color space via CIELab */
16441687 cmsCIExyY wp;
1688+#ifdef USE_LCMS1
16451689 cmsWhitePointFromTemp(6504,&wp); /* D65 White point */
1690+#else
1691+ cmsWhitePointFromTemp(&wp,6504); /* D65 White point */
1692+#endif
16461693 cmsxyY2XYZ(&D65WhitePoint,&wp);
16471694 colorProfile = cmsCreateLab4Profile(&wp);
16481695 }
@@ -1691,7 +1738,7 @@
16911738 Catalog *catalog;
16921739
16931740 setErrorFunction(::myErrorFun);
1694- cmsSetErrorHandler(lcmsErrorHandler);
1741+ cmsSetLogErrorHandler(lcmsErrorHandler);
16951742 #ifdef GLOBALPARAMS_HAS_A_ARG
16961743 globalParams = new GlobalParams(0);
16971744 #else
--- pdftoraster/trunk/configure.ac (revision 918)
+++ pdftoraster/trunk/configure.ac (revision 919)
@@ -115,9 +115,19 @@
115115 AC_HELP_STRING([--enable-compile-warnings]
116116 [Turn on compiler warnings.]),,
117117 [enable_compile_warnings="yes"])
118-PKG_CHECK_MODULES(LCMS, lcms)
119-LIBS="$LIBS -llcms"
120118
119+PKG_CHECK_MODULES(LCMS, lcms2, [lcms2=yes], [lcms2=no])
120+if test "x$lcms2" = "xno"; then
121+ PKG_CHECK_MODULES(LCMS, lcms)
122+ lcms1=yes;
123+ AC_DEFINE(USE_LCMS1, 1, [Defines if use lcms1])
124+ LIBS="$LIBS -llcms"
125+else
126+ LIBS="$LIBS -llcms2"
127+fi
128+AM_CONDITIONAL(USE_LCMS1, test x$lcms1 = xyes)
129+
130+
121131 if test x"$enable_compile_warnings" == xyes ;then
122132 CXXFLAGS="-Wall $CXXFLAGS"
123133 fi
旧リポジトリブラウザで表示