2005-02-21 19:38:15 +01:00
|
|
|
/*
|
|
|
|
* MSCMS - Color Management System for Wine
|
|
|
|
*
|
2008-02-24 15:20:15 +01:00
|
|
|
* Copyright 2005, 2006, 2008 Hans Leidekker
|
2005-02-21 19:38:15 +01:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2006-05-18 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2005-02-21 19:38:15 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
#include "wine/debug.h"
|
|
|
|
|
|
|
|
#include <stdarg.h>
|
|
|
|
|
|
|
|
#include "windef.h"
|
|
|
|
#include "winbase.h"
|
|
|
|
#include "winnls.h"
|
|
|
|
#include "wingdi.h"
|
|
|
|
#include "winuser.h"
|
|
|
|
#include "icm.h"
|
|
|
|
|
2005-07-15 12:09:43 +02:00
|
|
|
#include "mscms_priv.h"
|
2005-02-21 19:38:15 +01:00
|
|
|
|
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(mscms);
|
|
|
|
|
2013-07-26 13:02:40 +02:00
|
|
|
#ifdef HAVE_LCMS2
|
2008-02-26 02:45:07 +01:00
|
|
|
|
|
|
|
static DWORD from_bmformat( BMFORMAT format )
|
|
|
|
{
|
2013-11-12 01:16:38 +01:00
|
|
|
static BOOL quietfixme = FALSE;
|
2015-08-06 14:46:34 +02:00
|
|
|
DWORD ret;
|
2008-02-26 02:45:07 +01:00
|
|
|
|
|
|
|
switch (format)
|
|
|
|
{
|
2015-08-06 14:46:34 +02:00
|
|
|
case BM_RGBTRIPLETS: ret = TYPE_RGB_8; break;
|
|
|
|
case BM_BGRTRIPLETS: ret = TYPE_BGR_8; break;
|
|
|
|
case BM_GRAY: ret = TYPE_GRAY_8; break;
|
|
|
|
case BM_xRGBQUADS: ret = TYPE_ARGB_8; break;
|
|
|
|
case BM_xBGRQUADS: ret = TYPE_ABGR_8; break;
|
2019-02-25 09:12:37 +01:00
|
|
|
case BM_KYMCQUADS: ret = TYPE_KYMC_8; break;
|
2008-02-26 02:45:07 +01:00
|
|
|
default:
|
2013-11-12 01:16:38 +01:00
|
|
|
if (!quietfixme)
|
2008-10-18 01:03:49 +02:00
|
|
|
{
|
2015-08-06 14:46:34 +02:00
|
|
|
FIXME( "unhandled bitmap format %08x\n", format );
|
2013-11-12 01:16:38 +01:00
|
|
|
quietfixme = TRUE;
|
2008-10-18 01:03:49 +02:00
|
|
|
}
|
2015-08-06 14:46:34 +02:00
|
|
|
ret = TYPE_RGB_8;
|
|
|
|
break;
|
2008-02-26 02:45:07 +01:00
|
|
|
}
|
2015-08-06 14:46:34 +02:00
|
|
|
TRACE( "color space: %08x -> %08x\n", format, ret );
|
|
|
|
return ret;
|
2008-02-26 02:45:07 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static DWORD from_type( COLORTYPE type )
|
|
|
|
{
|
2015-08-06 14:46:34 +02:00
|
|
|
DWORD ret;
|
2008-02-26 02:45:07 +01:00
|
|
|
|
|
|
|
switch (type)
|
|
|
|
{
|
2015-08-06 14:46:34 +02:00
|
|
|
case COLOR_GRAY: ret = TYPE_GRAY_16; break;
|
|
|
|
case COLOR_RGB: ret = TYPE_RGB_16; break;
|
|
|
|
case COLOR_XYZ: ret = TYPE_XYZ_16; break;
|
|
|
|
case COLOR_Yxy: ret = TYPE_Yxy_16; break;
|
|
|
|
case COLOR_Lab: ret = TYPE_Lab_16; break;
|
|
|
|
case COLOR_CMYK: ret = TYPE_CMYK_16; break;
|
2008-02-26 02:45:07 +01:00
|
|
|
default:
|
2015-08-06 14:46:34 +02:00
|
|
|
FIXME( "unhandled color type %08x\n", type );
|
|
|
|
ret = TYPE_RGB_16;
|
|
|
|
break;
|
2008-02-26 02:45:07 +01:00
|
|
|
}
|
2015-08-06 14:46:34 +02:00
|
|
|
|
|
|
|
TRACE( "color type: %08x -> %08x\n", type, ret );
|
|
|
|
return ret;
|
2008-02-26 02:45:07 +01:00
|
|
|
}
|
|
|
|
|
2013-07-26 13:02:40 +02:00
|
|
|
#endif /* HAVE_LCMS2 */
|
2008-02-26 02:45:07 +01:00
|
|
|
|
2006-10-05 15:35:56 +02:00
|
|
|
/******************************************************************************
|
|
|
|
* CreateColorTransformA [MSCMS.@]
|
|
|
|
*
|
|
|
|
* See CreateColorTransformW.
|
|
|
|
*/
|
2005-02-21 19:38:15 +01:00
|
|
|
HTRANSFORM WINAPI CreateColorTransformA( LPLOGCOLORSPACEA space, HPROFILE dest,
|
|
|
|
HPROFILE target, DWORD flags )
|
|
|
|
{
|
|
|
|
LOGCOLORSPACEW spaceW;
|
|
|
|
DWORD len;
|
|
|
|
|
2006-09-30 12:07:13 +02:00
|
|
|
TRACE( "( %p, %p, %p, 0x%08x )\n", space, dest, target, flags );
|
2005-02-21 19:38:15 +01:00
|
|
|
|
|
|
|
if (!space || !dest) return FALSE;
|
|
|
|
|
|
|
|
memcpy( &spaceW, space, FIELD_OFFSET(LOGCOLORSPACEA, lcsFilename) );
|
|
|
|
spaceW.lcsSize = sizeof(LOGCOLORSPACEW);
|
|
|
|
|
|
|
|
len = MultiByteToWideChar( CP_ACP, 0, space->lcsFilename, -1, NULL, 0 );
|
|
|
|
MultiByteToWideChar( CP_ACP, 0, space->lcsFilename, -1, spaceW.lcsFilename, len );
|
|
|
|
|
|
|
|
return CreateColorTransformW( &spaceW, dest, target, flags );
|
|
|
|
}
|
|
|
|
|
2006-10-05 15:35:56 +02:00
|
|
|
/******************************************************************************
|
|
|
|
* CreateColorTransformW [MSCMS.@]
|
|
|
|
*
|
|
|
|
* Create a color transform.
|
|
|
|
*
|
|
|
|
* PARAMS
|
|
|
|
* space [I] Input color space.
|
|
|
|
* dest [I] Color profile of destination device.
|
|
|
|
* target [I] Color profile of target device.
|
|
|
|
* flags [I] Flags.
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* Success: Handle to a transform.
|
|
|
|
* Failure: NULL
|
|
|
|
*/
|
2005-02-21 19:38:15 +01:00
|
|
|
HTRANSFORM WINAPI CreateColorTransformW( LPLOGCOLORSPACEW space, HPROFILE dest,
|
|
|
|
HPROFILE target, DWORD flags )
|
|
|
|
{
|
|
|
|
HTRANSFORM ret = NULL;
|
2013-07-26 13:02:40 +02:00
|
|
|
#ifdef HAVE_LCMS2
|
2008-03-24 21:33:06 +01:00
|
|
|
struct transform transform;
|
|
|
|
struct profile *dst, *tgt = NULL;
|
2008-02-24 15:20:15 +01:00
|
|
|
cmsHPROFILE cmsinput, cmsoutput, cmstarget = NULL;
|
2015-08-06 14:46:34 +02:00
|
|
|
DWORD proofing = 0;
|
2005-03-08 20:00:14 +01:00
|
|
|
int intent;
|
2005-02-21 19:38:15 +01:00
|
|
|
|
2006-09-30 12:07:13 +02:00
|
|
|
TRACE( "( %p, %p, %p, 0x%08x )\n", space, dest, target, flags );
|
2005-02-21 19:38:15 +01:00
|
|
|
|
2008-03-24 21:33:06 +01:00
|
|
|
if (!space || !(dst = grab_profile( dest ))) return FALSE;
|
2005-02-21 19:38:15 +01:00
|
|
|
|
2008-03-24 21:33:06 +01:00
|
|
|
if (target && !(tgt = grab_profile( target )))
|
|
|
|
{
|
|
|
|
release_profile( dst );
|
|
|
|
return FALSE;
|
|
|
|
}
|
2005-03-08 20:00:14 +01:00
|
|
|
intent = space->lcsIntent > 3 ? INTENT_PERCEPTUAL : space->lcsIntent;
|
|
|
|
|
2008-02-24 15:20:15 +01:00
|
|
|
TRACE( "lcsIntent: %x\n", space->lcsIntent );
|
2013-07-26 13:03:15 +02:00
|
|
|
TRACE( "lcsCSType: %s\n", dbgstr_tag( space->lcsCSType ) );
|
2008-02-24 15:20:15 +01:00
|
|
|
TRACE( "lcsFilename: %s\n", debugstr_w( space->lcsFilename ) );
|
2005-02-21 19:38:15 +01:00
|
|
|
|
2008-02-24 15:20:15 +01:00
|
|
|
cmsinput = cmsCreate_sRGBProfile(); /* FIXME: create from supplied color space */
|
2005-02-21 19:38:15 +01:00
|
|
|
if (target)
|
|
|
|
{
|
2008-02-24 15:20:15 +01:00
|
|
|
proofing = cmsFLAGS_SOFTPROOFING;
|
2008-03-24 21:33:06 +01:00
|
|
|
cmstarget = tgt->cmsprofile;
|
2005-02-21 19:38:15 +01:00
|
|
|
}
|
2008-03-24 21:33:06 +01:00
|
|
|
cmsoutput = dst->cmsprofile;
|
2015-08-06 14:46:34 +02:00
|
|
|
transform.cmstransform = cmsCreateProofingTransform(cmsinput, 0, cmsoutput, 0, cmstarget,
|
|
|
|
intent, INTENT_ABSOLUTE_COLORIMETRIC,
|
|
|
|
proofing);
|
2015-08-06 14:46:15 +02:00
|
|
|
if (!transform.cmstransform)
|
|
|
|
{
|
|
|
|
if (tgt) release_profile( tgt );
|
|
|
|
release_profile( dst );
|
|
|
|
return FALSE;
|
|
|
|
}
|
2006-10-05 15:35:56 +02:00
|
|
|
|
2008-03-24 21:33:06 +01:00
|
|
|
ret = create_transform( &transform );
|
|
|
|
|
|
|
|
if (tgt) release_profile( tgt );
|
|
|
|
release_profile( dst );
|
2005-02-21 19:38:15 +01:00
|
|
|
|
2013-07-26 13:02:40 +02:00
|
|
|
#endif /* HAVE_LCMS2 */
|
2005-02-21 19:38:15 +01:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2006-10-05 15:35:56 +02:00
|
|
|
/******************************************************************************
|
|
|
|
* CreateMultiProfileTransform [MSCMS.@]
|
|
|
|
*
|
|
|
|
* Create a color transform from an array of color profiles.
|
|
|
|
*
|
|
|
|
* PARAMS
|
|
|
|
* profiles [I] Array of color profiles.
|
|
|
|
* nprofiles [I] Number of color profiles.
|
|
|
|
* intents [I] Array of rendering intents.
|
|
|
|
* flags [I] Flags.
|
|
|
|
* cmm [I] Profile to take the CMM from.
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* Success: Handle to a transform.
|
|
|
|
* Failure: NULL
|
|
|
|
*/
|
2005-02-21 19:38:15 +01:00
|
|
|
HTRANSFORM WINAPI CreateMultiProfileTransform( PHPROFILE profiles, DWORD nprofiles,
|
|
|
|
PDWORD intents, DWORD nintents, DWORD flags, DWORD cmm )
|
|
|
|
{
|
|
|
|
HTRANSFORM ret = NULL;
|
2013-07-26 13:02:40 +02:00
|
|
|
#ifdef HAVE_LCMS2
|
2015-08-06 14:46:34 +02:00
|
|
|
cmsHPROFILE *cmsprofiles;
|
2008-03-24 21:33:06 +01:00
|
|
|
struct transform transform;
|
|
|
|
struct profile *profile0, *profile1;
|
2005-02-21 19:38:15 +01:00
|
|
|
|
2008-02-24 15:20:15 +01:00
|
|
|
TRACE( "( %p, 0x%08x, %p, 0x%08x, 0x%08x, 0x%08x )\n",
|
2005-02-21 19:38:15 +01:00
|
|
|
profiles, nprofiles, intents, nintents, flags, cmm );
|
|
|
|
|
2008-02-24 15:20:15 +01:00
|
|
|
if (!profiles || !nprofiles || !intents) return NULL;
|
2005-02-21 19:38:15 +01:00
|
|
|
|
2008-02-24 15:20:15 +01:00
|
|
|
if (nprofiles > 2)
|
|
|
|
{
|
|
|
|
FIXME("more than 2 profiles not supported\n");
|
|
|
|
return NULL;
|
|
|
|
}
|
2005-02-21 19:38:15 +01:00
|
|
|
|
2008-03-24 21:33:06 +01:00
|
|
|
profile0 = grab_profile( profiles[0] );
|
|
|
|
if (!profile0) return NULL;
|
|
|
|
profile1 = grab_profile( profiles[1] );
|
|
|
|
if (!profile1)
|
|
|
|
{
|
|
|
|
release_profile( profile0 );
|
|
|
|
return NULL;
|
|
|
|
}
|
2005-02-21 19:38:15 +01:00
|
|
|
|
2015-08-06 14:46:34 +02:00
|
|
|
if ((cmsprofiles = HeapAlloc( GetProcessHeap(), 0, (nprofiles + 1) * sizeof(cmsHPROFILE) )))
|
2008-02-24 15:20:15 +01:00
|
|
|
{
|
2008-03-24 21:33:06 +01:00
|
|
|
cmsprofiles[0] = profile0->cmsprofile;
|
2015-08-06 14:46:34 +02:00
|
|
|
cmsprofiles[1] = profile1->cmsprofile;
|
|
|
|
|
|
|
|
transform.cmstransform = cmsCreateMultiprofileTransform( cmsprofiles, nprofiles, 0,
|
|
|
|
0, *intents, 0 );
|
2008-02-24 15:20:15 +01:00
|
|
|
HeapFree( GetProcessHeap(), 0, cmsprofiles );
|
2015-08-06 14:46:15 +02:00
|
|
|
if (!transform.cmstransform)
|
|
|
|
{
|
|
|
|
release_profile( profile0 );
|
|
|
|
release_profile( profile1 );
|
|
|
|
return FALSE;
|
|
|
|
}
|
2008-03-24 21:33:06 +01:00
|
|
|
ret = create_transform( &transform );
|
2008-02-24 15:20:15 +01:00
|
|
|
}
|
2005-02-21 19:38:15 +01:00
|
|
|
|
2008-03-24 21:33:06 +01:00
|
|
|
release_profile( profile0 );
|
|
|
|
release_profile( profile1 );
|
|
|
|
|
2013-07-26 13:02:40 +02:00
|
|
|
#endif /* HAVE_LCMS2 */
|
2005-02-21 19:38:15 +01:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2006-10-05 15:35:56 +02:00
|
|
|
/******************************************************************************
|
|
|
|
* DeleteColorTransform [MSCMS.@]
|
|
|
|
*
|
|
|
|
* Delete a color transform.
|
|
|
|
*
|
|
|
|
* PARAMS
|
|
|
|
* transform [I] Handle to a color transform.
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* Success: TRUE
|
|
|
|
* Failure: FALSE
|
|
|
|
*/
|
2008-03-24 21:33:06 +01:00
|
|
|
BOOL WINAPI DeleteColorTransform( HTRANSFORM handle )
|
2005-02-21 19:38:15 +01:00
|
|
|
{
|
|
|
|
BOOL ret = FALSE;
|
2013-07-26 13:02:40 +02:00
|
|
|
#ifdef HAVE_LCMS2
|
2005-02-21 19:38:15 +01:00
|
|
|
|
2008-03-24 21:33:06 +01:00
|
|
|
TRACE( "( %p )\n", handle );
|
2005-02-21 19:38:15 +01:00
|
|
|
|
2008-03-24 21:33:06 +01:00
|
|
|
ret = close_transform( handle );
|
2005-02-21 19:38:15 +01:00
|
|
|
|
2013-07-26 13:02:40 +02:00
|
|
|
#endif /* HAVE_LCMS2 */
|
2005-02-21 19:38:15 +01:00
|
|
|
return ret;
|
|
|
|
}
|
2005-03-08 20:00:14 +01:00
|
|
|
|
2006-10-05 15:35:56 +02:00
|
|
|
/******************************************************************************
|
|
|
|
* TranslateBitmapBits [MSCMS.@]
|
|
|
|
*
|
|
|
|
* Perform color translation.
|
|
|
|
*
|
|
|
|
* PARAMS
|
|
|
|
* transform [I] Handle to a color transform.
|
|
|
|
* srcbits [I] Source bitmap.
|
|
|
|
* input [I] Format of the source bitmap.
|
|
|
|
* width [I] Width of the source bitmap.
|
|
|
|
* height [I] Height of the source bitmap.
|
|
|
|
* inputstride [I] Number of bytes in one scanline.
|
|
|
|
* destbits [I] Destination bitmap.
|
|
|
|
* output [I] Format of the destination bitmap.
|
|
|
|
* outputstride [I] Number of bytes in one scanline.
|
|
|
|
* callback [I] Callback function.
|
|
|
|
* data [I] Callback data.
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* Success: TRUE
|
|
|
|
* Failure: FALSE
|
|
|
|
*/
|
2008-03-24 21:33:06 +01:00
|
|
|
BOOL WINAPI TranslateBitmapBits( HTRANSFORM handle, PVOID srcbits, BMFORMAT input,
|
2005-03-08 20:00:14 +01:00
|
|
|
DWORD width, DWORD height, DWORD inputstride, PVOID destbits, BMFORMAT output,
|
|
|
|
DWORD outputstride, PBMCALLBACKFN callback, ULONG data )
|
|
|
|
{
|
|
|
|
BOOL ret = FALSE;
|
2013-07-26 13:02:40 +02:00
|
|
|
#ifdef HAVE_LCMS2
|
2008-03-24 21:33:06 +01:00
|
|
|
struct transform *transform = grab_transform( handle );
|
2005-03-08 20:00:14 +01:00
|
|
|
|
2006-09-30 12:07:13 +02:00
|
|
|
TRACE( "( %p, %p, 0x%08x, 0x%08x, 0x%08x, 0x%08x, %p, 0x%08x, 0x%08x, %p, 0x%08x )\n",
|
2008-03-24 21:33:06 +01:00
|
|
|
handle, srcbits, input, width, height, inputstride, destbits, output,
|
2005-03-08 20:00:14 +01:00
|
|
|
outputstride, callback, data );
|
|
|
|
|
2008-03-24 21:33:06 +01:00
|
|
|
if (!transform) return FALSE;
|
2015-08-06 14:46:15 +02:00
|
|
|
if (!cmsChangeBuffersFormat( transform->cmstransform, from_bmformat(input), from_bmformat(output) ))
|
|
|
|
return FALSE;
|
2008-02-24 15:20:15 +01:00
|
|
|
|
2008-03-24 21:33:06 +01:00
|
|
|
cmsDoTransform( transform->cmstransform, srcbits, destbits, width * height );
|
|
|
|
release_transform( transform );
|
2005-03-08 20:00:14 +01:00
|
|
|
ret = TRUE;
|
|
|
|
|
2013-07-26 13:02:40 +02:00
|
|
|
#endif /* HAVE_LCMS2 */
|
2005-03-08 20:00:14 +01:00
|
|
|
return ret;
|
|
|
|
}
|
2008-02-24 15:20:15 +01:00
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* TranslateColors [MSCMS.@]
|
|
|
|
*
|
|
|
|
* Perform color translation.
|
|
|
|
*
|
|
|
|
* PARAMS
|
|
|
|
* transform [I] Handle to a color transform.
|
|
|
|
* input [I] Array of input colors.
|
|
|
|
* number [I] Number of colors to translate.
|
|
|
|
* input_type [I] Input color format.
|
|
|
|
* output [O] Array of output colors.
|
|
|
|
* output_type [I] Output color format.
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* Success: TRUE
|
|
|
|
* Failure: FALSE
|
|
|
|
*/
|
2008-03-24 21:33:06 +01:00
|
|
|
BOOL WINAPI TranslateColors( HTRANSFORM handle, PCOLOR in, DWORD count,
|
2008-02-24 15:20:15 +01:00
|
|
|
COLORTYPE input_type, PCOLOR out, COLORTYPE output_type )
|
|
|
|
{
|
2013-07-26 13:02:40 +02:00
|
|
|
#ifdef HAVE_LCMS2
|
2010-10-18 10:18:31 +02:00
|
|
|
BOOL ret = TRUE;
|
2008-03-24 21:33:06 +01:00
|
|
|
struct transform *transform = grab_transform( handle );
|
|
|
|
cmsHTRANSFORM xfrm;
|
2008-02-24 15:20:15 +01:00
|
|
|
unsigned int i;
|
|
|
|
|
2008-03-24 21:33:06 +01:00
|
|
|
TRACE( "( %p, %p, %d, %d, %p, %d )\n", handle, in, count, input_type, out, output_type );
|
|
|
|
|
|
|
|
if (!transform) return FALSE;
|
2008-02-24 15:20:15 +01:00
|
|
|
|
2008-03-24 21:33:06 +01:00
|
|
|
xfrm = transform->cmstransform;
|
2015-08-06 14:46:15 +02:00
|
|
|
if (!cmsChangeBuffersFormat( xfrm, from_type(input_type), from_type(output_type) ))
|
|
|
|
return FALSE;
|
2008-02-24 15:20:15 +01:00
|
|
|
|
|
|
|
switch (input_type)
|
|
|
|
{
|
|
|
|
case COLOR_RGB:
|
|
|
|
{
|
|
|
|
switch (output_type)
|
|
|
|
{
|
2010-10-18 10:18:31 +02:00
|
|
|
case COLOR_RGB: for (i = 0; i < count; i++) cmsDoTransform( xfrm, &in[i].rgb, &out[i].rgb, 1 ); goto done;
|
|
|
|
case COLOR_Lab: for (i = 0; i < count; i++) cmsDoTransform( xfrm, &in[i].rgb, &out[i].Lab, 1 ); goto done;
|
|
|
|
case COLOR_GRAY: for (i = 0; i < count; i++) cmsDoTransform( xfrm, &in[i].rgb, &out[i].gray, 1 ); goto done;
|
|
|
|
case COLOR_CMYK: for (i = 0; i < count; i++) cmsDoTransform( xfrm, &in[i].rgb, &out[i].cmyk, 1 ); goto done;
|
|
|
|
case COLOR_XYZ: for (i = 0; i < count; i++) cmsDoTransform( xfrm, &in[i].rgb, &out[i].XYZ, 1 ); goto done;
|
2008-02-24 15:20:15 +01:00
|
|
|
default:
|
|
|
|
FIXME("unhandled input/output pair: %d/%d\n", input_type, output_type);
|
2010-10-18 10:18:31 +02:00
|
|
|
ret = FALSE;
|
|
|
|
break;
|
2008-02-24 15:20:15 +01:00
|
|
|
}
|
2011-04-02 09:36:56 +02:00
|
|
|
break;
|
2008-02-24 15:20:15 +01:00
|
|
|
}
|
|
|
|
case COLOR_Lab:
|
|
|
|
{
|
|
|
|
switch (output_type)
|
|
|
|
{
|
2010-10-18 10:18:31 +02:00
|
|
|
case COLOR_RGB: for (i = 0; i < count; i++) cmsDoTransform( xfrm, &in[i].Lab, &out[i].rgb, 1 ); goto done;
|
|
|
|
case COLOR_Lab: for (i = 0; i < count; i++) cmsDoTransform( xfrm, &in[i].Lab, &out[i].Lab, 1 ); goto done;
|
|
|
|
case COLOR_GRAY: for (i = 0; i < count; i++) cmsDoTransform( xfrm, &in[i].Lab, &out[i].gray, 1 ); goto done;
|
|
|
|
case COLOR_CMYK: for (i = 0; i < count; i++) cmsDoTransform( xfrm, &in[i].Lab, &out[i].cmyk, 1 ); goto done;
|
|
|
|
case COLOR_XYZ: for (i = 0; i < count; i++) cmsDoTransform( xfrm, &in[i].Lab, &out[i].XYZ, 1 ); goto done;
|
2008-02-24 15:20:15 +01:00
|
|
|
default:
|
|
|
|
FIXME("unhandled input/output pair: %d/%d\n", input_type, output_type);
|
2010-10-18 10:18:31 +02:00
|
|
|
ret = FALSE;
|
|
|
|
break;
|
2008-02-24 15:20:15 +01:00
|
|
|
}
|
2011-04-02 09:36:56 +02:00
|
|
|
break;
|
2008-02-24 15:20:15 +01:00
|
|
|
}
|
|
|
|
case COLOR_GRAY:
|
|
|
|
{
|
|
|
|
switch (output_type)
|
|
|
|
{
|
2010-10-18 10:18:31 +02:00
|
|
|
case COLOR_RGB: for (i = 0; i < count; i++) cmsDoTransform( xfrm, &in[i].gray, &out[i].rgb, 1 ); goto done;
|
|
|
|
case COLOR_Lab: for (i = 0; i < count; i++) cmsDoTransform( xfrm, &in[i].gray, &out[i].Lab, 1 ); goto done;
|
|
|
|
case COLOR_GRAY: for (i = 0; i < count; i++) cmsDoTransform( xfrm, &in[i].gray, &out[i].gray, 1 ); goto done;
|
|
|
|
case COLOR_CMYK: for (i = 0; i < count; i++) cmsDoTransform( xfrm, &in[i].gray, &out[i].cmyk, 1 ); goto done;
|
|
|
|
case COLOR_XYZ: for (i = 0; i < count; i++) cmsDoTransform( xfrm, &in[i].gray, &out[i].XYZ, 1 ); goto done;
|
2008-02-24 15:20:15 +01:00
|
|
|
default:
|
|
|
|
FIXME("unhandled input/output pair: %d/%d\n", input_type, output_type);
|
2010-10-18 10:18:31 +02:00
|
|
|
ret = FALSE;
|
|
|
|
break;
|
2008-02-24 15:20:15 +01:00
|
|
|
}
|
2011-04-02 09:36:56 +02:00
|
|
|
break;
|
2008-02-24 15:20:15 +01:00
|
|
|
}
|
|
|
|
case COLOR_CMYK:
|
|
|
|
{
|
|
|
|
switch (output_type)
|
|
|
|
{
|
2010-10-18 10:18:31 +02:00
|
|
|
case COLOR_RGB: for (i = 0; i < count; i++) cmsDoTransform( xfrm, &in[i].cmyk, &out[i].rgb, 1 ); goto done;
|
|
|
|
case COLOR_Lab: for (i = 0; i < count; i++) cmsDoTransform( xfrm, &in[i].cmyk, &out[i].Lab, 1 ); goto done;
|
|
|
|
case COLOR_GRAY: for (i = 0; i < count; i++) cmsDoTransform( xfrm, &in[i].cmyk, &out[i].gray, 1 ); goto done;
|
|
|
|
case COLOR_CMYK: for (i = 0; i < count; i++) cmsDoTransform( xfrm, &in[i].cmyk, &out[i].cmyk, 1 ); goto done;
|
|
|
|
case COLOR_XYZ: for (i = 0; i < count; i++) cmsDoTransform( xfrm, &in[i].cmyk, &out[i].XYZ, 1 ); goto done;
|
2008-02-24 15:20:15 +01:00
|
|
|
default:
|
|
|
|
FIXME("unhandled input/output pair: %d/%d\n", input_type, output_type);
|
2010-10-18 10:18:31 +02:00
|
|
|
ret = FALSE;
|
|
|
|
break;
|
2008-02-24 15:20:15 +01:00
|
|
|
}
|
2011-04-02 09:36:56 +02:00
|
|
|
break;
|
2008-02-24 15:20:15 +01:00
|
|
|
}
|
|
|
|
case COLOR_XYZ:
|
|
|
|
{
|
|
|
|
switch (output_type)
|
|
|
|
{
|
2010-10-18 10:18:31 +02:00
|
|
|
case COLOR_RGB: for (i = 0; i < count; i++) cmsDoTransform( xfrm, &in[i].XYZ, &out[i].rgb, 1 ); goto done;
|
|
|
|
case COLOR_Lab: for (i = 0; i < count; i++) cmsDoTransform( xfrm, &in[i].XYZ, &out[i].Lab, 1 ); goto done;
|
|
|
|
case COLOR_GRAY: for (i = 0; i < count; i++) cmsDoTransform( xfrm, &in[i].XYZ, &out[i].gray, 1 ); goto done;
|
|
|
|
case COLOR_CMYK: for (i = 0; i < count; i++) cmsDoTransform( xfrm, &in[i].XYZ, &out[i].cmyk, 1 ); goto done;
|
|
|
|
case COLOR_XYZ: for (i = 0; i < count; i++) cmsDoTransform( xfrm, &in[i].XYZ, &out[i].XYZ, 1 ); goto done;
|
2008-02-24 15:20:15 +01:00
|
|
|
default:
|
|
|
|
FIXME("unhandled input/output pair: %d/%d\n", input_type, output_type);
|
2010-10-18 10:18:31 +02:00
|
|
|
ret = FALSE;
|
|
|
|
break;
|
2008-02-24 15:20:15 +01:00
|
|
|
}
|
2011-04-02 09:36:56 +02:00
|
|
|
break;
|
2008-02-24 15:20:15 +01:00
|
|
|
}
|
|
|
|
default:
|
|
|
|
FIXME("unhandled input/output pair: %d/%d\n", input_type, output_type);
|
2010-10-18 10:18:31 +02:00
|
|
|
ret = FALSE;
|
2008-02-24 15:20:15 +01:00
|
|
|
break;
|
|
|
|
}
|
2010-10-18 10:18:31 +02:00
|
|
|
|
|
|
|
done:
|
2008-03-24 21:33:06 +01:00
|
|
|
release_transform( transform );
|
2010-10-18 10:18:31 +02:00
|
|
|
return ret;
|
2008-02-24 15:20:15 +01:00
|
|
|
|
2013-07-26 13:02:40 +02:00
|
|
|
#else /* HAVE_LCMS2 */
|
2010-10-18 10:18:31 +02:00
|
|
|
return FALSE;
|
2013-07-26 13:02:40 +02:00
|
|
|
#endif /* HAVE_LCMS2 */
|
2008-02-24 15:20:15 +01:00
|
|
|
}
|