2004-10-07 21:12:41 +02:00
|
|
|
/*
|
|
|
|
* MSCMS - Color Management System for Wine
|
|
|
|
*
|
2005-02-14 21:53:59 +01:00
|
|
|
* Copyright 2004, 2005 Hans Leidekker
|
2004-10-07 21:12:41 +02: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
|
2004-10-07 21:12:41 +02:00
|
|
|
*/
|
|
|
|
|
2005-07-18 17:10:36 +02:00
|
|
|
#ifdef HAVE_LCMS
|
2004-10-07 21:12:41 +02:00
|
|
|
|
|
|
|
/* These basic Windows types are defined in lcms.h when compiling on
|
2004-11-30 22:06:14 +01:00
|
|
|
* a non-Windows platform (why?), so they would normally not conflict
|
2004-10-07 21:12:41 +02:00
|
|
|
* with anything included earlier. But since we are building Wine they
|
|
|
|
* most certainly will have been defined before we include lcms.h.
|
|
|
|
* The preprocessor comes to the rescue.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define BYTE LCMS_BYTE
|
|
|
|
#define LPBYTE LCMS_LPBYTE
|
|
|
|
#define WORD LCMS_WORD
|
|
|
|
#define LPWORD LCMS_LPWORD
|
|
|
|
#define DWORD LCMS_DWORD
|
|
|
|
#define LPDWORD LCMS_LPDWORD
|
|
|
|
#define BOOL LCMS_BOOL
|
|
|
|
#define LPSTR LCMS_LPSTR
|
|
|
|
#define LPVOID LCMS_LPVOID
|
|
|
|
|
|
|
|
#undef cdecl
|
|
|
|
#undef FAR
|
|
|
|
|
|
|
|
#undef ZeroMemory
|
|
|
|
#undef CopyMemory
|
|
|
|
|
|
|
|
#undef LOWORD
|
2008-09-22 23:26:42 +02:00
|
|
|
#undef HIWORD
|
2004-10-07 21:12:41 +02:00
|
|
|
#undef MAX_PATH
|
|
|
|
|
2004-11-23 18:33:55 +01:00
|
|
|
#ifdef HAVE_LCMS_LCMS_H
|
|
|
|
#include <lcms/lcms.h>
|
|
|
|
#else
|
2004-10-07 21:12:41 +02:00
|
|
|
#include <lcms.h>
|
2004-11-23 18:33:55 +01:00
|
|
|
#endif
|
2004-10-07 21:12:41 +02:00
|
|
|
|
2006-10-04 11:19:38 +02:00
|
|
|
/* Funny thing is lcms.h defines DWORD as an 'unsigned long' whereas Wine
|
|
|
|
* defines it as an 'unsigned int'. To avoid compiler warnings we use a
|
2006-10-15 17:05:01 +02:00
|
|
|
* preprocessor define for DWORD and LPDWORD to get back Wine's original
|
2006-10-04 11:19:38 +02:00
|
|
|
* (typedef) definitions.
|
|
|
|
*/
|
|
|
|
|
2007-03-13 12:42:40 +01:00
|
|
|
#undef BOOL
|
2006-10-04 11:19:38 +02:00
|
|
|
#undef DWORD
|
|
|
|
#undef LPDWORD
|
|
|
|
|
2007-03-13 12:42:40 +01:00
|
|
|
#define BOOL BOOL
|
2006-10-04 11:19:38 +02:00
|
|
|
#define DWORD DWORD
|
|
|
|
#define LPDWORD LPDWORD
|
|
|
|
|
2008-03-24 21:33:06 +01:00
|
|
|
/* A simple structure to tie together a pointer to an icc profile, an lcms
|
|
|
|
* color profile handle and a Windows file handle. If the profile is memory
|
|
|
|
* based the file handle field is set to INVALID_HANDLE_VALUE. The 'access'
|
|
|
|
* field records the access parameter supplied to an OpenColorProfile()
|
|
|
|
* call, i.e. PROFILE_READ or PROFILE_READWRITE.
|
|
|
|
*/
|
|
|
|
|
|
|
|
struct profile
|
|
|
|
{
|
|
|
|
HANDLE file;
|
|
|
|
DWORD access;
|
|
|
|
icProfile *iccprofile;
|
|
|
|
cmsHPROFILE cmsprofile;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct transform
|
|
|
|
{
|
|
|
|
cmsHTRANSFORM cmstransform;
|
|
|
|
};
|
|
|
|
|
2011-05-01 10:07:20 +02:00
|
|
|
extern HPROFILE create_profile( struct profile * ) DECLSPEC_HIDDEN;
|
|
|
|
extern BOOL close_profile( HPROFILE ) DECLSPEC_HIDDEN;
|
2008-03-24 21:33:06 +01:00
|
|
|
|
2011-05-01 10:07:20 +02:00
|
|
|
extern HTRANSFORM create_transform( struct transform * ) DECLSPEC_HIDDEN;
|
|
|
|
extern BOOL close_transform( HTRANSFORM ) DECLSPEC_HIDDEN;
|
2008-03-24 21:33:06 +01:00
|
|
|
|
2011-05-01 10:07:20 +02:00
|
|
|
struct profile *grab_profile( HPROFILE ) DECLSPEC_HIDDEN;
|
|
|
|
struct transform *grab_transform( HTRANSFORM ) DECLSPEC_HIDDEN;
|
2008-03-24 21:33:06 +01:00
|
|
|
|
2011-05-01 10:07:20 +02:00
|
|
|
void release_profile( struct profile * ) DECLSPEC_HIDDEN;
|
|
|
|
void release_transform( struct transform * ) DECLSPEC_HIDDEN;
|
2008-03-24 21:33:06 +01:00
|
|
|
|
2011-05-01 10:07:20 +02:00
|
|
|
extern void free_handle_tables( void ) DECLSPEC_HIDDEN;
|
2005-02-21 19:38:15 +01:00
|
|
|
|
2011-05-01 10:07:20 +02:00
|
|
|
extern DWORD MSCMS_get_tag_count( const icProfile *iccprofile ) DECLSPEC_HIDDEN;
|
|
|
|
extern void MSCMS_get_tag_by_index( icProfile *iccprofile, DWORD index, icTag *tag ) DECLSPEC_HIDDEN;
|
|
|
|
extern void MSCMS_get_tag_data( const icProfile *iccprofile, const icTag *tag, DWORD offset, void *buffer ) DECLSPEC_HIDDEN;
|
|
|
|
extern void MSCMS_set_tag_data( icProfile *iccprofile, const icTag *tag, DWORD offset, const void *buffer ) DECLSPEC_HIDDEN;
|
|
|
|
extern void MSCMS_get_profile_header( const icProfile *iccprofile, PROFILEHEADER *header ) DECLSPEC_HIDDEN;
|
|
|
|
extern void MSCMS_set_profile_header( icProfile *iccprofile, const PROFILEHEADER *header ) DECLSPEC_HIDDEN;
|
|
|
|
extern DWORD MSCMS_get_profile_size( const icProfile *iccprofile ) DECLSPEC_HIDDEN;
|
2004-12-07 15:42:47 +01:00
|
|
|
|
2005-07-18 17:10:36 +02:00
|
|
|
#endif /* HAVE_LCMS */
|
2011-04-05 09:44:49 +02:00
|
|
|
|
2011-05-01 10:07:20 +02:00
|
|
|
extern const char *MSCMS_dbgstr_tag(DWORD) DECLSPEC_HIDDEN;
|