📄 icm.h
字号:
//
// + INTENT_RELATIVE_COLORIMETRIC = LCS_GM_GRAPHICS for LOGCOLORSPACE
// = DMICM_COLORIMETRIC for DEVMODE
// = "Proof" for SetupColorMatching/Printer UI
//
// + INTENT_SATURATION = LCS_GM_BUSINESS for LOGCOLORSPACE
// = DMICM_SATURATE for DEVMODE
// = "Graphics" for SetupColorMatching/Printer UI
//
// + INTENT_ABSOLUTE_COLORIMETRIC = LCS_GM_ABS_COLORIMETRIC for LOGCOLORSPACE
// = DMICM_ABS_COLORIMETRIC for DEVMODE
// = "Match" for SetupColorMatching/Printer UI
//
#define INTENT_PERCEPTUAL 0
#define INTENT_RELATIVE_COLORIMETRIC 1
#define INTENT_SATURATION 2
#define INTENT_ABSOLUTE_COLORIMETRIC 3
//
// Profile data structure
//
typedef struct tagPROFILE {
DWORD dwType; // profile type
PVOID pProfileData; // filename or buffer containing profile
DWORD cbDataSize; // size of profile data
} PROFILE;
typedef PROFILE *PPROFILE, *LPPROFILE;
//
// Profile types to be used in the PROFILE structure
//
#define PROFILE_FILENAME 1 // profile data is NULL terminated filename
#define PROFILE_MEMBUFFER 2 // profile data is a buffer containing
// the profile
//
// Desired access mode for opening profiles
//
#define PROFILE_READ 1 // opened for read access
#define PROFILE_READWRITE 2 // opened for read and write access
//
// Handles returned to applications
//
typedef HANDLE HPROFILE; // handle to profile object
typedef HPROFILE *PHPROFILE;
typedef HANDLE HTRANSFORM; // handle to color transform object
//
// CMM selection for CreateMultiProfileTransform and SelectCMM.
//
#define INDEX_DONT_CARE 0
#define CMM_FROM_PROFILE INDEX_DONT_CARE // Use CMM specified in profile.
#define CMM_WINDOWS_DEFAULT 'Win ' // Use Windows default CMM always.
//
// Tags found in ICC profiles
//
typedef DWORD TAGTYPE;
typedef TAGTYPE *PTAGTYPE, *LPTAGTYPE;
//
// Profile enumeration data structure
//
#define ENUM_TYPE_VERSION 0x0300
typedef struct tagENUMTYPEA {
DWORD dwSize; // structure size
DWORD dwVersion; // structure version
DWORD dwFields; // bit fields
PCSTR pDeviceName; // device friendly name
DWORD dwMediaType; // media type
DWORD dwDitheringMode; // dithering mode
DWORD dwResolution[2]; // x and y resolutions
DWORD dwCMMType; // cmm ID
DWORD dwClass; // profile class
DWORD dwDataColorSpace; // color space of data
DWORD dwConnectionSpace; // pcs
DWORD dwSignature; // magic number
DWORD dwPlatform; // primary platform
DWORD dwProfileFlags; // various bit settings in profile
DWORD dwManufacturer; // manufacturer ID
DWORD dwModel; // model ID
DWORD dwAttributes[2]; // device attributes
DWORD dwRenderingIntent; // rendering intent
DWORD dwCreator; // profile creator
DWORD dwDeviceClass; // device class
} ENUMTYPEA, *PENUMTYPEA, *LPENUMTYPEA;
typedef struct tagENUMTYPEW {
DWORD dwSize; // structure size
DWORD dwVersion; // structure version
DWORD dwFields; // bit fields
PCWSTR pDeviceName; // device friendly name
DWORD dwMediaType; // media type
DWORD dwDitheringMode; // dithering mode
DWORD dwResolution[2]; // x and y resolutions
DWORD dwCMMType; // cmm ID
DWORD dwClass; // profile class
DWORD dwDataColorSpace; // color space of data
DWORD dwConnectionSpace; // pcs
DWORD dwSignature; // magic number
DWORD dwPlatform; // primary platform
DWORD dwProfileFlags; // various bit settings in profile
DWORD dwManufacturer; // manufacturer ID
DWORD dwModel; // model ID
DWORD dwAttributes[2]; // device attributes
DWORD dwRenderingIntent; // rendering intent
DWORD dwCreator; // profile creator
DWORD dwDeviceClass; // device class
} ENUMTYPEW, *PENUMTYPEW, *LPENUMTYPEW;
//
// Bitfields for enumeration record above
//
#define ET_DEVICENAME 0x00000001
#define ET_MEDIATYPE 0x00000002
#define ET_DITHERMODE 0x00000004
#define ET_RESOLUTION 0x00000008
#define ET_CMMTYPE 0x00000010
#define ET_CLASS 0x00000020
#define ET_DATACOLORSPACE 0x00000040
#define ET_CONNECTIONSPACE 0x00000080
#define ET_SIGNATURE 0x00000100
#define ET_PLATFORM 0x00000200
#define ET_PROFILEFLAGS 0x00000400
#define ET_MANUFACTURER 0x00000800
#define ET_MODEL 0x00001000
#define ET_ATTRIBUTES 0x00002000
#define ET_RENDERINGINTENT 0x00004000
#define ET_CREATOR 0x00008000
#define ET_DEVICECLASS 0x00010000
//
// Flags for creating color transforms
//
#define PROOF_MODE 0x00000001
#define NORMAL_MODE 0x00000002
#define BEST_MODE 0x00000003
#define ENABLE_GAMUT_CHECKING 0x00010000
#define USE_RELATIVE_COLORIMETRIC 0x00020000
#define FAST_TRANSLATE 0x00040000
#define RESERVED 0x80000000
//
// Paremeter for GetPS2ColorSpaceArray
//
#define CSA_A 1
#define CSA_ABC 2
#define CSA_DEF 3
#define CSA_DEFG 4
#define CSA_GRAY 5
#define CSA_RGB 6
#define CSA_CMYK 7
#define CSA_Lab 8
//
// Parameter for CMGetInfo()
//
#define CMM_WIN_VERSION 0
#define CMM_IDENT 1
#define CMM_DRIVER_VERSION 2
#define CMM_DLL_VERSION 3
#define CMM_VERSION 4
#define CMM_DESCRIPTION 5
#define CMM_LOGOICON 6
//
// Parameter for CMTranslateRGBs()
//
#define CMS_FORWARD 0
#define CMS_BACKWARD 1
//
// Constants for SetupColorMatching()
//
#define COLOR_MATCH_VERSION 0x0200
//
// Constants for flags
//
#define CMS_DISABLEICM 1 // Disable color matching
#define CMS_ENABLEPROOFING 2 // Enable proofing
#define CMS_SETRENDERINTENT 4 // Use passed in value
#define CMS_SETPROOFINTENT 8
#define CMS_SETMONITORPROFILE 0x10 // Use passed in profile name initially
#define CMS_SETPRINTERPROFILE 0x20
#define CMS_SETTARGETPROFILE 0x40
#define CMS_USEHOOK 0x80 // Use hook procedure in lpfnHook
#define CMS_USEAPPLYCALLBACK 0x100 // Use callback procedure when applied
#define CMS_USEDESCRIPTION 0x200 // Use profile description in UI
// (default is filename)
#define CMS_DISABLEINTENT 0x400 // Disable intent selection (render & proofing) always
#define CMS_DISABLERENDERINTENT 0x800 // Disable rendering intent selection while in proofing mode
// Only proofing intent selection is enabled.
//
// Used to denote too-small buffers (output only)
//
#define CMS_MONITOROVERFLOW 0x80000000L
#define CMS_PRINTEROVERFLOW 0x40000000L
#define CMS_TARGETOVERFLOW 0x20000000L
//
// Structures (both ANSI and Unicode)
//
struct _tagCOLORMATCHSETUPW;
struct _tagCOLORMATCHSETUPA;
typedef BOOL (WINAPI *PCMSCALLBACKW)(struct _tagCOLORMATCHSETUPW *,LPARAM);
typedef BOOL (WINAPI *PCMSCALLBACKA)(struct _tagCOLORMATCHSETUPA *,LPARAM);
typedef struct _tagCOLORMATCHSETUPW {
DWORD dwSize; // Size of structure in bytes
DWORD dwVersion; // Set to COLOR_MATCH_VERSION
DWORD dwFlags; // See constants listed previously
HWND hwndOwner; // Window handle of owner
PCWSTR pSourceName; // Name of Image Source, defaults to "sRGB Color Space"
PCWSTR pDisplayName; // If null, defaults to first enumerated monitor
PCWSTR pPrinterName; // If null, defaults to default printer.
DWORD dwRenderIntent; // Rendering Intent
DWORD dwProofingIntent; // Rendering Intent for Proofing
PWSTR pMonitorProfile; // Monitor profile name
DWORD ccMonitorProfile; // Size of above in characters
PWSTR pPrinterProfile; // Printer profile name
DWORD ccPrinterProfile; // Size of above in characters
PWSTR pTargetProfile; // Target profile name
DWORD ccTargetProfile; // Size of above in characters
DLGPROC lpfnHook; // Hook Procedure address
LPARAM lParam; // Given to hook procedure at WM_INITDIALOG
PCMSCALLBACKW lpfnApplyCallback; // Callback Procedure address when apply is pushed
LPARAM lParamApplyCallback; // Given to callback Procedure for apply
} COLORMATCHSETUPW, *PCOLORMATCHSETUPW, *LPCOLORMATCHSETUPW;
typedef struct _tagCOLORMATCHSETUPA {
DWORD dwSize; // Size of structure in bytes
DWORD dwVersion; // Set to COLOR_MATCH_VERSION
DWORD dwFlags; // See constants listed previously
HWND hwndOwner; // Window handle of owner
PCSTR pSourceName; // Name of Image Source, defaults to "This Document"
PCSTR pDisplayName; // If null, defaults to first enumerated monitor
PCSTR pPrinterName; // If null, defaults to default printer.
DWORD dwRenderIntent; // Rendering Intent
DWORD dwProofingIntent; // Rendering Intent for Proofing
PSTR pMonitorProfile; // Monitor profile name
DWORD ccMonitorProfile; // Size of above in characters
PSTR pPrinterProfile; // Printer profile name
DWORD ccPrinterProfile; // Size of above in characters
PSTR pTargetProfile; // Target profile name
DWORD ccTargetProfile; // Size of above in characters
DLGPROC lpfnHook; // Hook Procedure address
LPARAM lParam; // Given to hook procedure at WM_INITDIALOG
PCMSCALLBACKA lpfnApplyCallback; // Callback Procedure address when apply is pushed
LPARAM lParamApplyCallback; // Given to callback Procedure for apply
} COLORMATCHSETUPA, *PCOLORMATCHSETUPA, *LPCOLORMATCHSETUPA;
//
// Windows API definitions
//
HPROFILE WINAPI OpenColorProfileA(PPROFILE, DWORD, DWORD, DWORD);
HPROFILE WINAPI OpenColorProfileW(PPROFILE, DWORD, DWORD, DWORD);
BOOL WINAPI CloseColorProfile(HPROFILE);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -