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
|
|
|
*/
|
|
|
|
|
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.
|
|
|
|
*/
|
|
|
|
|
2021-10-19 11:25:14 +02:00
|
|
|
#include <lcms2.h>
|
|
|
|
|
2008-03-24 21:33:06 +01:00
|
|
|
struct profile
|
|
|
|
{
|
2013-07-26 13:02:40 +02:00
|
|
|
HANDLE file;
|
|
|
|
DWORD access;
|
|
|
|
char *data;
|
|
|
|
DWORD size;
|
2021-10-19 11:25:14 +02:00
|
|
|
cmsHPROFILE cmsprofile;
|
2008-03-24 21:33:06 +01:00
|
|
|
};
|
|
|
|
|
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
|
|
|
|
2021-10-19 11:25:14 +02:00
|
|
|
extern HTRANSFORM create_transform( cmsHTRANSFORM ) DECLSPEC_HIDDEN;
|
2011-05-01 10:07:20 +02:00
|
|
|
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;
|
2021-10-19 11:25:14 +02:00
|
|
|
cmsHTRANSFORM 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;
|
2021-10-19 11:25:14 +02:00
|
|
|
void release_transform( cmsHTRANSFORM ) 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
|
|
|
|
2020-11-10 12:40:09 +01:00
|
|
|
struct tag_entry
|
|
|
|
{
|
|
|
|
DWORD sig;
|
|
|
|
DWORD offset;
|
|
|
|
DWORD size;
|
|
|
|
};
|
|
|
|
|
|
|
|
extern DWORD get_tag_count( const struct profile * ) DECLSPEC_HIDDEN;
|
|
|
|
extern BOOL get_tag_entry( const struct profile *, DWORD, struct tag_entry * ) DECLSPEC_HIDDEN;
|
|
|
|
extern BOOL get_adjusted_tag( const struct profile *, TAGTYPE, struct tag_entry * ) DECLSPEC_HIDDEN;
|
|
|
|
extern BOOL get_tag_data( const struct profile *, TAGTYPE, DWORD, void *, DWORD *, BOOL * ) DECLSPEC_HIDDEN;
|
2013-07-26 13:02:40 +02:00
|
|
|
extern BOOL set_tag_data( const struct profile *, TAGTYPE, DWORD, const void *, DWORD * ) DECLSPEC_HIDDEN;
|
|
|
|
extern void get_profile_header( const struct profile *, PROFILEHEADER * ) DECLSPEC_HIDDEN;
|
|
|
|
extern void set_profile_header( const struct profile *, const PROFILEHEADER * ) DECLSPEC_HIDDEN;
|
2004-12-07 15:42:47 +01:00
|
|
|
|
2020-11-10 12:46:37 +01:00
|
|
|
struct lcms_funcs
|
|
|
|
{
|
|
|
|
void * (CDECL *open_profile)( void *data, DWORD size );
|
|
|
|
void (CDECL *close_profile)( void *profile );
|
|
|
|
void * (CDECL *create_transform)( void *output, void *target, DWORD intent );
|
|
|
|
void * (CDECL *create_multi_transform)( void *profiles, DWORD count, DWORD intent );
|
|
|
|
BOOL (CDECL *translate_bits)( void *transform, void *srcbits, BMFORMAT input,
|
|
|
|
void *dstbits, BMFORMAT output, DWORD size );
|
|
|
|
BOOL (CDECL *translate_colors)( void *transform, COLOR *in, DWORD count, COLORTYPE input_type,
|
|
|
|
COLOR *out, COLORTYPE output_type );
|
|
|
|
void (CDECL *close_transform)( void *transform );
|
|
|
|
};
|
|
|
|
|
|
|
|
extern const struct lcms_funcs *lcms_funcs;
|
2011-04-05 09:44:49 +02:00
|
|
|
|
2013-07-26 13:03:15 +02:00
|
|
|
extern const char *dbgstr_tag(DWORD) DECLSPEC_HIDDEN;
|