diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/cmscnvrt.c | 5 | ||||
-rw-r--r-- | src/cmsxform.c | 15 | ||||
-rw-r--r-- | src/lcms2_internal.h | 4 |
3 files changed, 20 insertions, 4 deletions
diff --git a/src/cmscnvrt.c b/src/cmscnvrt.c index 5c76d27..9490a9e 100644 --- a/src/cmscnvrt.c +++ b/src/cmscnvrt.c @@ -1,7 +1,7 @@ //--------------------------------------------------------------------------------- // // Little Color Management System -// Copyright (c) 1998-2010 Marti Maria Saguer +// Copyright (c) 1998-2011 Marti Maria Saguer // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the "Software"), @@ -847,7 +847,8 @@ cmsPipeline* BlackPreservingKPlaneIntents(cmsContext ContextID, // Check for non-cmyk profiles if (cmsGetColorSpace(hProfiles[0]) != cmsSigCmykData || - cmsGetColorSpace(hProfiles[nProfiles-1]) != cmsSigCmykData) + cmsGetColorSpace(hProfiles[nProfiles-1]) != cmsSigCmykData || + cmsGetDeviceClass(hProfiles[nProfiles-1]) != cmsSigOutputClass)) return DefaultICCintents(ContextID, nProfiles, ICCIntents, hProfiles, BPC, AdaptationStates, dwFlags); // Allocate an empty LUT for holding the result diff --git a/src/cmsxform.c b/src/cmsxform.c index 0d34001..4e13e1a 100644 --- a/src/cmsxform.c +++ b/src/cmsxform.c @@ -752,7 +752,22 @@ cmsContext CMSEXPORT cmsGetTransformContextID(cmsHTRANSFORM hTransform) return xform -> ContextID; } +// Grab the input/output formats +cmsUInt32Number CMSEXPORT cmsGetTransformInputFormat(cmsHTRANSFORM hTransform) +{ + _cmsTRANSFORM* xform = (_cmsTRANSFORM*) hTransform; + + if (xform == NULL) return 0; + return xform->InputFormat; +} +cmsUInt32Number CMSEXPORT cmsGetTransformOutputFormat(cmsHTRANSFORM hTransform) +{ + _cmsTRANSFORM* xform = (_cmsTRANSFORM*) hTransform; + + if (xform == NULL) return 0; + return xform->OutputFormat; +} // For backwards compatibility cmsBool CMSEXPORT cmsChangeBuffersFormat(cmsHTRANSFORM hTransform, diff --git a/src/lcms2_internal.h b/src/lcms2_internal.h index 8cb8bd0..cdcba71 100644 --- a/src/lcms2_internal.h +++ b/src/lcms2_internal.h @@ -46,8 +46,8 @@ # define M_LOG10E 0.434294481903251827651 #endif -// BorlandC 5.5 is broken on that -#ifdef __BORLANDC__ +// BorlandC 5.5, VC2003 are broken on that +#if defined(__BORLANDC__) || (_MSC_VER <= 1400) // 1400 == VC++ 8.0 #define sinf(x) (float)sin((float)x) #define sqrtf(x) (float)sqrt((float)x) #endif |