From b9bea18cfe7571f5074b3df7bea91317aa637ad1 Mon Sep 17 00:00:00 2001 From: Dmitry Timoshkov Date: Tue, 26 Feb 2008 09:45:07 +0800 Subject: [PATCH] mscms: Allow compilation without LCMS installed. --- dlls/mscms/transform.c | 116 ++++++++++++++++++++--------------------- 1 file changed, 57 insertions(+), 59 deletions(-) diff --git a/dlls/mscms/transform.c b/dlls/mscms/transform.c index 13bc55a6177..ec33a1086bb 100644 --- a/dlls/mscms/transform.c +++ b/dlls/mscms/transform.c @@ -34,6 +34,63 @@ WINE_DEFAULT_DEBUG_CHANNEL(mscms); +#ifdef HAVE_LCMS + +static DWORD from_profile( HPROFILE profile ) +{ + PROFILEHEADER header; + + GetColorProfileHeader( profile, &header ); + TRACE( "color space: 0x%08x %s\n", header.phDataColorSpace, MSCMS_dbgstr_tag( header.phDataColorSpace ) ); + + switch (header.phDataColorSpace) + { + case 0x434d594b: return TYPE_CMYK_16; /* 'CMYK' */ + case 0x47524159: return TYPE_GRAY_16; /* 'GRAY' */ + case 0x4c616220: return TYPE_Lab_16; /* 'Lab ' */ + case 0x52474220: return TYPE_RGB_16; /* 'RGB ' */ + case 0x58595a20: return TYPE_XYZ_16; /* 'XYZ ' */ + default: + WARN("unhandled format\n"); + return TYPE_RGB_16; + } +} + +static DWORD from_bmformat( BMFORMAT format ) +{ + TRACE( "bitmap format: 0x%08x\n", format ); + + switch (format) + { + case BM_RGBTRIPLETS: return TYPE_RGB_8; + case BM_BGRTRIPLETS: return TYPE_BGR_8; + case BM_GRAY: return TYPE_GRAY_8; + default: + FIXME("unhandled bitmap format\n"); + return TYPE_RGB_8; + } +} + +static DWORD from_type( COLORTYPE type ) +{ + TRACE( "color type: 0x%08x\n", type ); + + switch (type) + { + case COLOR_GRAY: return TYPE_GRAY_16; + case COLOR_RGB: return TYPE_RGB_16; + case COLOR_XYZ: return TYPE_XYZ_16; + case COLOR_Yxy: return TYPE_Yxy_16; + case COLOR_Lab: return TYPE_Lab_16; + case COLOR_CMYK: return TYPE_CMYK_16; + default: + FIXME("unhandled color type\n"); + return TYPE_RGB_16; + } +} + +#endif /* HAVE_LCMS */ + /****************************************************************************** * CreateColorTransformA [MSCMS.@] * @@ -58,28 +115,6 @@ HTRANSFORM WINAPI CreateColorTransformA( LPLOGCOLORSPACEA space, HPROFILE dest, return CreateColorTransformW( &spaceW, dest, target, flags ); } -static DWORD from_profile( HPROFILE profile ) -{ - PROFILEHEADER header; - - GetColorProfileHeader( profile, &header ); - TRACE( "color space: 0x%08x %s\n", header.phDataColorSpace, MSCMS_dbgstr_tag( header.phDataColorSpace ) ); - - switch (header.phDataColorSpace) - { - case 0x434d594b: return TYPE_CMYK_16; /* 'CMYK' */ - case 0x47524159: return TYPE_GRAY_16; /* 'GRAY' */ - case 0x4c616220: return TYPE_Lab_16; /* 'Lab ' */ - case 0x52474220: return TYPE_RGB_16; /* 'RGB ' */ - case 0x58595a20: return TYPE_XYZ_16; /* 'XYZ ' */ - default: - { - WARN("unhandled format\n"); - return TYPE_RGB_16; - } - } -} - /****************************************************************************** * CreateColorTransformW [MSCMS.@] * @@ -234,23 +269,6 @@ BOOL WINAPI DeleteColorTransform( HTRANSFORM transform ) return ret; } -static DWORD from_bmformat( BMFORMAT format ) -{ - TRACE( "bitmap format: 0x%08x\n", format ); - - switch (format) - { - case BM_RGBTRIPLETS: return TYPE_RGB_8; - case BM_BGRTRIPLETS: return TYPE_BGR_8; - case BM_GRAY: return TYPE_GRAY_8; - default: - { - FIXME("unhandled bitmap format\n"); - return TYPE_RGB_8; - } - } -} - /****************************************************************************** * TranslateBitmapBits [MSCMS.@] * @@ -295,26 +313,6 @@ BOOL WINAPI TranslateBitmapBits( HTRANSFORM transform, PVOID srcbits, BMFORMAT i return ret; } -static DWORD from_type( COLORTYPE type ) -{ - TRACE( "color type: 0x%08x\n", type ); - - switch (type) - { - case COLOR_GRAY: return TYPE_GRAY_16; - case COLOR_RGB: return TYPE_RGB_16; - case COLOR_XYZ: return TYPE_XYZ_16; - case COLOR_Yxy: return TYPE_Yxy_16; - case COLOR_Lab: return TYPE_Lab_16; - case COLOR_CMYK: return TYPE_CMYK_16; - default: - { - FIXME("unhandled color type\n"); - return TYPE_RGB_16; - } - } -} - /****************************************************************************** * TranslateColors [MSCMS.@] *