📄 winddi.h
字号:
// }
//
// //
// // We running from end of table to the begining, because
// // when in CMYInverted mode, the index 0 is black and index
// // 255 is white. Since we only generate 'Count' of index
// // and place them at center, we will change xC, xM, xY max.
// // index to same as cC, cM and cY.
// //
//
// IdxInc = -1;
// xC = cC;
// xM = cM;
// xY = cY;
//
// } else {
//
// IdxInc = 1;
// pILEnd = pInkLevels + 256;
// }
//
// //
// // At following, the composition of ink levels, index always
// // from 0 CMY Ink levels (WHITE) to maximum ink levels (BLACK),
// // the different with CMY_INVERTED mode is we compose it from
// // index 255 to index 0 rather than from index 0 to 255
// //
//
// if (CMYMask) {
//
// INT Idx332C;
// INT Idx332M;
//
// for (iC = 0, Idx332C = -mC; iC <= xC; iC++) {
//
// if (iC <= cC) {
//
// InkLevels.Cyan = (BYTE)iC;
// Idx332C += mC;
// }
//
// for (iM = 0, Idx332M = -mM; iM <= xM; iM++) {
//
// if (iM <= cM) {
//
// InkLevels.Magenta = (BYTE)iM;
// Idx332M += mM;
// }
//
// for (iY = 0; iY <= xY; iY++) {
//
// if (iY <= cY) {
//
// InkLevels.Yellow = (BYTE)iY;
// }
//
// InkLevels.CMY332Idx = (BYTE)(Idx332C + Idx332M) +
// InkLevels.Yellow;
// *pInkLevels = InkLevels;
//
// if ((pInkLevels += IdxInc) == pILDup) {
//
// *pInkLevels = InkLevels;
// pInkLevels += IdxInc;
// }
// }
// }
// }
//
// //
// // Now if we need to pack black at other end of the
// // translation table then do it here, Notice that InkLevels
// // are at cC, cM and cY here and the CMY332Idx is at BLACK
// //
//
// while (pInkLevels != pILEnd) {
//
// *pInkLevels = InkLevels;
// pInkLevels += IdxInc;
// }
//
// } else {
//
// //
// // Gray Scale case
// //
//
// for (iC = 0; iC < 256; iC++, pInkLevels += IdxInc) {
//
// pInkLevels->Cyan =
// pInkLevels->Magenta =
// pInkLevels->Yellow =
// pInkLevels->CMY332Idx = (BYTE)iC;
// }
// }
//
// return(TRUE);
// }
//
//
// 6. For CMYMask Mode 0 (Gray scale), the gray scale table just inverted
// between CMY and CMY_INVERTED mode.
//
// CMY mode: 0 to 255 gray scale from WHITE to BLACK increment,
// CMY_INVERTED Mode: 0 to 255 gray scale from BLACK to WHITE increment.
//
//
// 7. For CMYMask Mode 1 and 2, the caller should use a translation table for
// translate indices to CMY ink levels.
//
// 8. For CMYMode mode 3 to 255,
//
// if in CMY Mode (Windows 2000) is specified then The final CMY ink levels
// indices byte has following meanings
//
// Bit 7 6 5 4 3 2 1 0
// | | | | | |
// +---+ +---+ +=+
// | | |
// | | +-- Yellow 0-3 (Max. 4 levels)
// | |
// | +-- Magenta 0-7 (Max. 8 levels)
// |
// +-- Cyan 0-7 (Max. 8 levels)
//
//
// If a CMY_INVERTED mode is specified then caller must use a translation
// table to convert a index to the ink levels, to generate this table,
// please see above #5 description.
//
//============================================================================
// END HALFTONE INFORMATION
//============================================================================
typedef struct _GDIINFO
{
ULONG ulVersion;
ULONG ulTechnology;
ULONG ulHorzSize;
ULONG ulVertSize;
ULONG ulHorzRes;
ULONG ulVertRes;
ULONG cBitsPixel;
ULONG cPlanes;
ULONG ulNumColors;
ULONG flRaster;
ULONG ulLogPixelsX;
ULONG ulLogPixelsY;
ULONG flTextCaps;
ULONG ulDACRed;
ULONG ulDACGreen;
ULONG ulDACBlue;
ULONG ulAspectX;
ULONG ulAspectY;
ULONG ulAspectXY;
LONG xStyleStep;
LONG yStyleStep;
LONG denStyleStep;
POINTL ptlPhysOffset;
SIZEL szlPhysSize;
ULONG ulNumPalReg;
// These fields are for halftone initialization.
COLORINFO ciDevice;
ULONG ulDevicePelsDPI;
ULONG ulPrimaryOrder;
ULONG ulHTPatternSize;
ULONG ulHTOutputFormat;
ULONG flHTFlags;
ULONG ulVRefresh;
ULONG ulBltAlignment;
ULONG ulPanningHorzRes;
ULONG ulPanningVertRes;
ULONG xPanningAlignment;
ULONG yPanningAlignment;
// The following fields are for user defined halftone dither patterns. These
// fields are only checked if ulHTPatternSize is eqaul to HT_PATSIZE_USER.
//
// The user defined pHTPatA, pHTPatB, pHTPatC pointers correspond to the primary
// color order defined in ulPrimaryOrder as PRIMARY_ORDER_xxx.
//
// The size of halftone dither pattern must range from 4 to 256. For each
// dither pattern, pHTPatA, pHTPatB, pHTPatC must point to a
// valid byte array of (cxHTPat x cyHTPat) size. pHTPatA, pHTPatB and
// pHTPatC may point to the same dither pattern array.
//
// Each byte threshold within the dither pattern defines the additive
// intensity threshold of pixels. A zero threshold value indicates the pixel
// location is ignored (always black), while 1 to 255 threshold values give the
// dither pattern 255 level of grays.
ULONG cxHTPat; // cxHTPat must range from 4-256
ULONG cyHTPat; // cyHTPat must range from 4-256
LPBYTE pHTPatA; // for Primary Color Order A
LPBYTE pHTPatB; // for Primary Color Order B
LPBYTE pHTPatC; // for Primary Color Order C
// Shade and blend caps
ULONG flShadeBlend;
ULONG ulPhysicalPixelCharacteristics;
ULONG ulPhysicalPixelGamma;
} GDIINFO, *PGDIINFO;
/*
* User objects
*/
typedef struct _BRUSHOBJ
{
ULONG iSolidColor;
PVOID pvRbrush;
FLONG flColorType;
} BRUSHOBJ;
//
// BRUSHOBJ::flColorType
//
#define BR_DEVICE_ICM 0x01
#define BR_HOST_ICM 0x02
#define BR_CMYKCOLOR 0x04
#define BR_ORIGCOLOR 0x08
typedef struct _CLIPOBJ
{
ULONG iUniq;
RECTL rclBounds;
BYTE iDComplexity;
BYTE iFComplexity;
BYTE iMode;
BYTE fjOptions;
} CLIPOBJ;
typedef struct _DRIVEROBJ DRIVEROBJ;
typedef BOOL (CALLBACK * FREEOBJPROC)(DRIVEROBJ *pDriverObj);
typedef struct _DRIVEROBJ
{
PVOID pvObj;
FREEOBJPROC pFreeProc;
HDEV hdev;
DHPDEV dhpdev;
} DRIVEROBJ;
typedef struct _FONTOBJ
{
ULONG iUniq;
ULONG iFace;
ULONG cxMax;
FLONG flFontType;
ULONG_PTR iTTUniq;
ULONG_PTR iFile;
SIZE sizLogResPpi;
ULONG ulStyleSize;
PVOID pvConsumer;
PVOID pvProducer;
} FONTOBJ;
typedef struct _BLENDOBJ
{
BLENDFUNCTION BlendFunction;
}BLENDOBJ,*PBLENDOBJ;
typedef BYTE GAMMA_TABLES[2][256];
//
// FONTOBJ::flFontType
//
#define FO_TYPE_RASTER RASTER_FONTTYPE /* 0x1 */
#define FO_TYPE_DEVICE DEVICE_FONTTYPE /* 0x2 */
#define FO_TYPE_TRUETYPE TRUETYPE_FONTTYPE /* 0x4 */
#define FO_TYPE_OPENTYPE OPENTYPE_FONTTYPE /* 0X8 */
#define FO_SIM_BOLD 0x00002000
#define FO_SIM_ITALIC 0x00004000
#define FO_EM_HEIGHT 0x00008000
#define FO_GRAY16 0x00010000 /* [1] */
#define FO_NOGRAY16 0x00020000 /* [1] */
#define FO_NOHINTS 0x00040000 /* [3] */
#define FO_NO_CHOICE 0x00080000 /* [3] */
// new accelerators so that printer drivers do not need to look to ifimetrics
#define FO_CFF 0x00100000
#define FO_POSTSCRIPT 0x00200000
#define FO_MULTIPLEMASTER 0x00400000
#define FO_VERT_FACE 0x00800000
#define FO_DBCS_FONT 0X01000000
// cleartype flags for horizontally or vertically striped LCD screen
#define FO_NOCLEARTYPE 0x02000000
#define FO_CLEARTYPE_X 0x10000000
#define FO_CLEARTYPE_Y 0x20000000
/**************************************************************************\
*
* [1]
*
* If the FO_GRAY16 flag is set then the bitmaps of the font
* are 4-bit per pixel blending (alpha) values. A value of zero
* means that the the resulting pixel should be equal to the
* background color. If the value of the alpha value is k != 0
* then the resulting pixel must be:
*
* c0 = background color
* c1 = foreground color
* b = blending value = (k+1)/16 // {k = 1,2,..,15}
* b = 0 (k = 0)
* d0 = gamma[c0], d1 = gamma[c1] // luminance components
* d = (1 - b)*d0 + b*d1 // blended luminance
* c = lambda[d] // blended device voltage
*
* where gamma[] takes a color component from application space
* to CIE space and labmda[] takes a color from CIE space to
* device color space
*
* GDI will set this bit if it request a font be gray scaled
* to 16 values then GDI will set FO_GRAY16 upon entry to
* DrvQueryFontData(). If the font driver cannot (or will
* not) grayscale a particular realization of a font then the
* font provider will zero out FO_GRAY16 and set FO_NOGRAY16
* to inform GDI that
* the gray scaling request cannot (or should not) be
* satisfied.
*
* [2]
*
* The FO_NOHINTS indicates that hints were not used in the formation
* of the glyph images. GDI will set this bit to request that hinting
* be supressed. The font provider will set this bit accroding to the
* rendering scheme that it used in generating the glyph image.
*
* [3]
*
* The FO_NO_CHOICE flag indicates that the flags FO_GRAY16 and
* FO_NOHINTS must be obeyed if at all possible.
*
\**************************************************************************/
typedef struct _PALOBJ
{
ULONG ulReserved;
} PALOBJ;
typedef struct _PATHOBJ
{
FLONG fl;
ULONG cCurves;
} PATHOBJ;
typedef struct _SURFOBJ
{
DHSURF dhsurf;
HSURF hsurf;
DHPDEV dhpdev;
HDEV hdev;
SIZEL sizlBitmap;
ULONG cjBits;
PVOID pvBits;
PVOID pvScan0;
LONG lDelta;
ULONG iUniq;
ULONG iBitmapFormat;
USHORT iType;
USHORT fjBitmap;
} SURFOBJ;
typedef struct _WNDOBJ
{
CLIPOBJ coClient;
PVOID pvConsumer;
RECTL rclClient;
SURFOBJ *psoOwner;
} WNDOBJ, *PWNDOBJ;
typedef struct _XFORMOBJ
{
ULONG ulReserved;
} XFORMOBJ;
typedef struct _XLATEOBJ
{
ULONG iUniq;
FLONG flXlate;
USHORT iSrcType; // Obsolete
USHORT iDstType; // Obsolete
ULONG cEntries;
ULONG *pulXlate;
} XLATEOBJ;
/*
* BRUSHOBJ callbacks
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -