📄 icm.h
字号:
/*++
Copyright (c) 1996-1999 Microsoft Corporation
Module Name:
icm.h
Abstract:
Public header file for Image Color Management
Revision History:
--*/
#ifndef _ICM_H_
#pragma option push -b -a8 -pc -A- /*P_O_Push*/
#define _ICM_H_
#if _MSC_VER > 1000
#pragma once
#endif
#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_xG3CHQUADS = 0x0304,
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, LPARAM);
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 '
#define SPACE_2_CHANNEL '2CLR'
#define SPACE_3_CHANNEL '3CLR'
#define SPACE_4_CHANNEL '4CLR'
#define SPACE_5_CHANNEL '5CLR'
#define SPACE_6_CHANNEL '6CLR'
#define SPACE_7_CHANNEL '7CLR'
#define SPACE_8_CHANNEL '8CLR'
//
// 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
//
// + INTENT_PERCEPTUAL = LCS_GM_IMAGES for LOGCOLORSPACE
// = DMICM_CONTRAST for DEVMODE
// = "Pictures" for SetupColorMathing/Printer UI
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -