📄 icm.h
字号:
/*++
Copyright (c) 1996 Microsoft Corporation
Module Name:
icm.h
Abstract:
Public header file for Image Color Management
Revision History:
--*/
#ifndef _ICM_H_
#define _ICM_H_
#ifdef __cplusplus
extern "C" {
#endif
//
// Support for named color profiles
//
typedef char COLOR_NAME[32];
typedef COLOR_NAME *PCOLOR_NAME, *LPCOLOR_NAME;
typedef struct tagNAMED_PROFILE_INFO{
DWORD dwFlags;
DWORD dwCount;
DWORD dwCountDevCoordinates;
COLOR_NAME szPrefix;
COLOR_NAME szSuffix;
}NAMED_PROFILE_INFO;
typedef NAMED_PROFILE_INFO *PNAMED_PROFILE_INFO, *LPNAMED_PROFILE_INFO;
//
// Color spaces
//
// The following color spaces are supported.
// Gray, RGB, CMYK, XYZ, Yxy, Lab, generic 3 channel color spaces where
// the profiles defines how to interpret the 3 channels, named color spaces
// which can either be indices into the space or have color names, and
// multichannel spaces with 1 byte per channel upto MAX_COLOR_CHANNELS.
//
#define MAX_COLOR_CHANNELS 8 // maximum number of HiFi color channels
struct GRAYCOLOR {
WORD gray;
};
struct RGBCOLOR {
WORD red;
WORD green;
WORD blue;
};
struct CMYKCOLOR {
WORD cyan;
WORD magenta;
WORD yellow;
WORD black;
};
struct XYZCOLOR {
WORD X;
WORD Y;
WORD Z;
};
struct YxyCOLOR {
WORD Y;
WORD x;
WORD y;
};
struct LabCOLOR {
WORD L;
WORD a;
WORD b;
};
struct GENERIC3CHANNEL {
WORD ch1;
WORD ch2;
WORD ch3;
};
struct NAMEDCOLOR {
DWORD dwIndex;
};
struct HiFiCOLOR {
BYTE channel[MAX_COLOR_CHANNELS];
};
typedef union tagCOLOR {
struct GRAYCOLOR gray;
struct RGBCOLOR rgb;
struct CMYKCOLOR cmyk;
struct XYZCOLOR XYZ;
struct YxyCOLOR Yxy;
struct LabCOLOR Lab;
struct GENERIC3CHANNEL gen3ch;
struct NAMEDCOLOR named;
struct HiFiCOLOR hifi;
} COLOR;
typedef COLOR *PCOLOR, *LPCOLOR;
typedef enum {
COLOR_GRAY = 1,
COLOR_RGB,
COLOR_XYZ,
COLOR_Yxy,
COLOR_Lab,
COLOR_3_CHANNEL, // WORD per channel
COLOR_CMYK,
COLOR_5_CHANNEL, // BYTE per channel
COLOR_6_CHANNEL, // - do -
COLOR_7_CHANNEL, // - do -
COLOR_8_CHANNEL, // - do -
COLOR_NAMED,
} COLORTYPE;
typedef COLORTYPE *PCOLORTYPE, *LPCOLORTYPE;
//
// Bitmap formats supported
//
typedef enum {
//
// 16bpp - 5 bits per channel. The most significant bit is ignored.
//
BM_x555RGB = 0x0000,
BM_x555XYZ = 0x0101,
BM_x555Yxy,
BM_x555Lab,
BM_x555G3CH,
//
// Packed 8 bits per channel => 8bpp for GRAY and
// 24bpp for the 3 channel colors, more for hifi channels
//
BM_RGBTRIPLETS = 0x0002,
BM_BGRTRIPLETS = 0x0004,
BM_XYZTRIPLETS = 0x0201,
BM_YxyTRIPLETS,
BM_LabTRIPLETS,
BM_G3CHTRIPLETS,
BM_5CHANNEL,
BM_6CHANNEL,
BM_7CHANNEL,
BM_8CHANNEL,
BM_GRAY,
//
// 32bpp - 8 bits per channel. The most significant byte is ignored
// for the 3 channel colors.
//
BM_xRGBQUADS = 0x0008,
BM_xBGRQUADS = 0x0010,
BM_xXYZQUADS = 0x0301,
BM_xYxyQUADS,
BM_xLabQUADS,
BM_xG3CHQUADS,
BM_KYMCQUADS,
BM_CMYKQUADS = 0x0020,
//
// 32bpp - 10 bits per channel. The 2 most significant bits are ignored.
//
BM_10b_RGB = 0x0009,
BM_10b_XYZ = 0x0401,
BM_10b_Yxy,
BM_10b_Lab,
BM_10b_G3CH,
//
// 32bpp - named color indices (1-based)
//
BM_NAMED_INDEX,
//
// Packed 16 bits per channel => 16bpp for GRAY and
// 48bpp for the 3 channel colors.
//
BM_16b_RGB = 0x000A,
BM_16b_XYZ = 0x0501,
BM_16b_Yxy,
BM_16b_Lab,
BM_16b_G3CH,
BM_16b_GRAY,
//
// 16 bpp - 5 bits for Red & Blue, 6 bits for Green
//
BM_565RGB = 0x0001,
} BMFORMAT;
typedef BMFORMAT *PBMFORMAT, *LPBMFORMAT;
//
// Callback function definition
//
typedef BOOL (WINAPI *PBMCALLBACKFN)(ULONG, ULONG, ULONG);
typedef PBMCALLBACKFN LPBMCALLBACKFN;
//
// ICC profile header
//
typedef struct tagPROFILEHEADER {
DWORD phSize; // profile size in bytes
DWORD phCMMType; // CMM for this profile
DWORD phVersion; // profile format version number
DWORD phClass; // type of profile
DWORD phDataColorSpace; // color space of data
DWORD phConnectionSpace; // PCS
DWORD phDateTime[3]; // date profile was created
DWORD phSignature; // magic number
DWORD phPlatform; // primary platform
DWORD phProfileFlags; // various bit settings
DWORD phManufacturer; // device manufacturer
DWORD phModel; // device model number
DWORD phAttributes[2]; // device attributes
DWORD phRenderingIntent; // rendering intent
CIEXYZ phIlluminant; // profile illuminant
DWORD phCreator; // profile creator
BYTE phReserved[44]; // reserved for future use
} PROFILEHEADER;
typedef PROFILEHEADER *PPROFILEHEADER, *LPPROFILEHEADER;
//
// Profile class values
//
#define CLASS_MONITOR 'mntr'
#define CLASS_PRINTER 'prtr'
#define CLASS_SCANNER 'scnr'
#define CLASS_LINK 'link'
#define CLASS_ABSTRACT 'abst'
#define CLASS_COLORSPACE 'spac'
#define CLASS_NAMED 'nmcl'
//
// Color space values
//
#define SPACE_XYZ 'XYZ '
#define SPACE_Lab 'Lab '
#define SPACE_Luv 'Luv '
#define SPACE_YCbCr 'YCbr'
#define SPACE_Yxy 'Yxy '
#define SPACE_RGB 'RGB '
#define SPACE_GRAY 'GRAY'
#define SPACE_HSV 'HSV '
#define SPACE_HLS 'HLS '
#define SPACE_CMYK 'CMYK'
#define SPACE_CMY 'CMY '
//
// Profile flag bitfield values
//
#define FLAG_EMBEDDEDPROFILE 0x00000001
#define FLAG_DEPENDENTONDATA 0x00000002
//
// Profile attributes bitfield values
//
#define ATTRIB_TRANSPARENCY 0x00000001
#define ATTRIB_MATTE 0x00000002
//
// Rendering Intents
//
#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
//
// Use built-in CMM selection in CreateMultiProfileTransform
//
#define INDEX_DONT_CARE 0
//
// Tags found in ICC profiles
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -