diff --git a/dlls/mscms/lcms_api.h b/dlls/mscms/lcms_api.h index f88f59743b8..4f071ba307b 100644 --- a/dlls/mscms/lcms_api.h +++ b/dlls/mscms/lcms_api.h @@ -31,6 +31,7 @@ LCMS_API_FUNCTION(cmsCreate_sRGBProfile) LCMS_API_FUNCTION(cmsCreateMultiprofileTransform) LCMS_API_FUNCTION(cmsCreateTransform) LCMS_API_FUNCTION(cmsDeleteTransform) +LCMS_API_FUNCTION(cmsDoTransform) LCMS_API_FUNCTION(cmsOpenProfileFromMem) #ifndef LCMS_API_NO_REDEFINE @@ -39,6 +40,7 @@ LCMS_API_FUNCTION(cmsOpenProfileFromMem) #define cmsCreateMultiprofileTransform pcmsCreateMultiprofileTransform #define cmsCreateTransform pcmsCreateTransform #define cmsDeleteTransform pcmsDeleteTransform +#define cmsDoTransform pcmsDoTransform #define cmsOpenProfileFromMem pcmsOpenProfileFromMem #endif /* LCMS_API_NO_REDEFINE */ diff --git a/dlls/mscms/mscms_main.c b/dlls/mscms/mscms_main.c index 689eed12900..895a8af90bd 100644 --- a/dlls/mscms/mscms_main.c +++ b/dlls/mscms/mscms_main.c @@ -77,6 +77,7 @@ static BOOL MSCMS_init_lcms() LOAD_FUNCPTR(cmsCreateMultiprofileTransform); LOAD_FUNCPTR(cmsCreateTransform); LOAD_FUNCPTR(cmsDeleteTransform); + LOAD_FUNCPTR(cmsDoTransform); LOAD_FUNCPTR(cmsOpenProfileFromMem); #undef LOAD_FUNCPTR diff --git a/dlls/mscms/stub.c b/dlls/mscms/stub.c index 6a62c5c26f8..46cc9a58cf1 100644 --- a/dlls/mscms/stub.c +++ b/dlls/mscms/stub.c @@ -202,18 +202,6 @@ BOOL WINAPI SetColorProfileElementSize( HPROFILE profile, TAGTYPE type, DWORD si return FALSE; } -BOOL WINAPI TranslateBitmapBits( HTRANSFORM transform, PVOID srcbits, BMFORMAT input, - DWORD width, DWORD height, DWORD inputstride, PVOID destbits, - BMFORMAT output, DWORD outputstride, PBMCALLBACKFN callback, - ULONG data ) -{ - FIXME( "( %p, %p, 0x%08x, 0x%08lx, 0x%08lx, 0x%08lx, %p, 0x%08x, 0x%08lx, %p, 0x%08lx ) stub\n", - transform, srcbits, input, width, height, inputstride, destbits, output, outputstride, - callback, data ); - - return FALSE; -} - BOOL WINAPI TranslateColors( HTRANSFORM transform, PCOLOR inputcolors, DWORD number, COLORTYPE input, PCOLOR outputcolors, COLORTYPE output ) { diff --git a/dlls/mscms/transform.c b/dlls/mscms/transform.c index 234a336c8e6..ab928172f96 100644 --- a/dlls/mscms/transform.c +++ b/dlls/mscms/transform.c @@ -62,11 +62,14 @@ HTRANSFORM WINAPI CreateColorTransformW( LPLOGCOLORSPACEW space, HPROFILE dest, #ifdef HAVE_LCMS_H cmsHTRANSFORM cmstransform; cmsHPROFILE cmsprofiles[3]; + int intent; TRACE( "( %p, %p, %p, 0x%08lx )\n", space, dest, target, flags ); if (!space || !dest) return FALSE; + intent = space->lcsIntent > 3 ? INTENT_PERCEPTUAL : space->lcsIntent; + cmsprofiles[0] = cmsCreate_sRGBProfile(); /* FIXME: create from supplied color space */ cmsprofiles[1] = MSCMS_hprofile2cmsprofile( dest ); @@ -74,14 +77,13 @@ HTRANSFORM WINAPI CreateColorTransformW( LPLOGCOLORSPACEW space, HPROFILE dest, { cmsprofiles[2] = MSCMS_hprofile2cmsprofile( target ); cmstransform = cmsCreateMultiprofileTransform( cmsprofiles, 3, TYPE_BGR_8, - TYPE_BGR_8, space->lcsIntent, 0 ); + TYPE_BGR_8, intent, 0 ); } else { cmstransform = cmsCreateTransform( cmsprofiles[0], TYPE_BGR_8, cmsprofiles[1], - TYPE_BGR_8, space->lcsIntent, 0 ); + TYPE_BGR_8, intent, 0 ); } - ret = MSCMS_create_htransform_handle( cmstransform ); #endif /* HAVE_LCMS_H */ @@ -136,3 +138,24 @@ BOOL WINAPI DeleteColorTransform( HTRANSFORM transform ) #endif /* HAVE_LCMS_H */ return ret; } + +BOOL WINAPI TranslateBitmapBits( HTRANSFORM transform, PVOID srcbits, BMFORMAT input, + DWORD width, DWORD height, DWORD inputstride, PVOID destbits, BMFORMAT output, + DWORD outputstride, PBMCALLBACKFN callback, ULONG data ) +{ + BOOL ret = FALSE; +#ifdef HAVE_LCMS_H + cmsHTRANSFORM cmstransform; + + TRACE( "( %p, %p, 0x%08x, 0x%08lx, 0x%08lx, 0x%08lx, %p, 0x%08x, 0x%08lx, %p, 0x%08lx )\n", + transform, srcbits, input, width, height, inputstride, destbits, output, + outputstride, callback, data ); + + cmstransform = MSCMS_htransform2cmstransform( transform ); + + cmsDoTransform( cmstransform, srcbits, destbits, width * height ); + ret = TRUE; + +#endif /* HAVE_LCMS_H */ + return ret; +}