Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

247 lines
5.7 KiB

  1. /*++
  2. Copyright (c) 1990-2003 Microsoft Corporation
  3. Module Name:
  4. htblt.h
  5. Abstract:
  6. This module contains definitions and prototypes for htblt.c
  7. Author:
  8. 18-Dec-1993 Sat 08:50:09 created
  9. [Environment:]
  10. GDI Device Driver - Plotter.
  11. [Notes:]
  12. Revision History:
  13. 10-Feb-1994 Thu 15:24:13 updated
  14. Adding MonoPal[] to the DRVHTINFO
  15. --*/
  16. #ifndef _HTBLT_
  17. #define _HTBLT_
  18. typedef struct _FOURBYTES {
  19. BYTE b1st;
  20. BYTE b2nd;
  21. BYTE b3rd;
  22. BYTE b4th;
  23. } FOURBYTES, *PFOURBYTES, FAR *LPFOURBYTES;
  24. typedef union _HTXB {
  25. FOURBYTES b4;
  26. DWORD dw;
  27. } HTXB, *PHTXB, FAR *LPHTXB;
  28. #define HTXB_H_NIBBLE_MAX 8
  29. #define HTXB_L_NIBBLE_MAX 8
  30. #define HTXB_H_NIBBLE_DUP 128
  31. #define HTXB_L_NIBBLE_DUP 8
  32. #define HTXB_COUNT (HTXB_H_NIBBLE_DUP * 2)
  33. #define HTXB_TABLE_SIZE (HTXB_COUNT * sizeof(HTXB))
  34. #define HTPAL_XLATE_COUNT 8
  35. #define HTPALXOR_NOTSRCCOPY (DWORD)0xffffffff
  36. #define HTPALXOR_SRCCOPY (DWORD)0x0
  37. #define DHIF_IN_STRETCHBLT 0x01
  38. typedef union _PALDW {
  39. DWORD dw;
  40. PALENTRY Pal;
  41. } PALDW;
  42. typedef struct _DRVHTINFO {
  43. BYTE Flags;
  44. BYTE HTPalCount;
  45. BYTE HTBmpFormat;
  46. BYTE AltBmpFormat;
  47. DWORD HTPalXor;
  48. PHTXB pHTXB;
  49. PALDW RTLPal[2];
  50. BYTE PalXlate[HTPAL_XLATE_COUNT];
  51. } DRVHTINFO, *PDRVHTINFO;
  52. #define PAL_MIN_I 0x00
  53. #define PAL_MAX_I 0xff
  54. #define HTXB_R(htxb) htxb.b4.b1st
  55. #define HTXB_G(htxb) htxb.b4.b2nd
  56. #define HTXB_B(htxb) htxb.b4.b3rd
  57. #define HTXB_I(htxb) htxb.b4.b4th
  58. #define RGB_BLACK 0x00000000
  59. #define RGB_WHITE 0x00FFFFFF
  60. #define P4B_TO_3P_DW(dwRet, pHTXB, pbData) \
  61. { \
  62. (dwRet) = (DWORD)((pHTXB[*(pbData + 0)].dw & (DWORD)0xc0c0c0c0) | \
  63. (pHTXB[*(pbData + 1)].dw & (DWORD)0x30303030) | \
  64. (pHTXB[*(pbData + 2)].dw & (DWORD)0x0c0c0c0c) | \
  65. (pHTXB[*(pbData + 3)].dw & (DWORD)0x03030303)); \
  66. ++((LPDWORD)pbData); \
  67. }
  68. //
  69. // When outputing halftoned bitmaps, the HTENUMRCLS structure can accomodate
  70. // up to MAX_HTENUM_RECTLS when calling the engine.
  71. //
  72. #define MAX_HTENUM_RECTLS 8
  73. typedef struct _HTENUMRCLS {
  74. DWORD c; // count of rectangles enumerated
  75. RECTL rcl[MAX_HTENUM_RECTLS]; // enumerated rectangles array
  76. } HTENUMRCL, *PHTENUMRCL;
  77. //
  78. // HTBMPINFO is passed to the halftone bitmap output function
  79. //
  80. #define HTBIF_FLIP_MONOBITS 0x00000001
  81. #define HTBIF_BA_PAD_1 0x00000002
  82. typedef struct _HTBMPINFO {
  83. PPDEV pPDev; // Our pPDev
  84. LPBYTE pScan0; // point to the first scan line of the bitmap
  85. LONG Delta; // count to be added to next scan line
  86. RECTL rclBmp; // visible area for the final output
  87. POINTL OffBmp; // x/y offset from the rclBmp.left
  88. SIZEL szlBmp; // size of visible rectangle
  89. LPBYTE pScanBuf; // pointer to scan buffer (may be RGB 3 scans)
  90. LPBYTE pRotBuf; // tempoprary rotation buffer if not null
  91. DWORD Flags; // HTBIF_xxxx
  92. PLOTDBGBLK(DWORD cScanBuf) // debug check
  93. PLOTDBGBLK(DWORD cRotBuf) // debug check
  94. } HTBMPINFO, FAR *PHTBMPINFO;
  95. typedef BOOL (*OUTHTBMPFUNC)(PHTBMPINFO);
  96. #define ISHTF_ALTFMT 0x0001
  97. #define ISHTF_HTXB 0x0002
  98. #define ISHTF_DSTPRIM_OK 0x0004
  99. #define OHTF_IN_RTLMODE 0x00000001
  100. #define OHTF_CLIPWINDOW 0x00000002
  101. #define OHTF_SET_TR1 0x00000004
  102. #define OHTF_DONE_ROPTR1 0x08000000
  103. #define OHTF_EXIT_TO_HPGL2 0x80000000
  104. #define OHTF_MASK (OHTF_IN_RTLMODE | \
  105. OHTF_CLIPWINDOW | \
  106. OHTF_SET_TR1 | \
  107. OHTF_DONE_ROPTR1 | \
  108. OHTF_EXIT_TO_HPGL2)
  109. //
  110. // Functions prototype
  111. //
  112. BOOL
  113. IsHTCompatibleSurfObj(
  114. PPDEV pPDev,
  115. SURFOBJ *pso,
  116. XLATEOBJ *pxlo,
  117. DWORD Flags
  118. );
  119. BOOL
  120. OutputHTBitmap(
  121. PPDEV pPDev,
  122. SURFOBJ *psoHT,
  123. CLIPOBJ *pco,
  124. PPOINTL pptlDest,
  125. PRECTL prclSrc,
  126. DWORD Rop3,
  127. LPDWORD pOHTFlags
  128. );
  129. LONG
  130. GetBmpDelta(
  131. DWORD SurfaceFormat,
  132. DWORD cx
  133. );
  134. SURFOBJ *
  135. CreateBitmapSURFOBJ(
  136. PPDEV pPDev,
  137. HBITMAP *phBmp,
  138. LONG cxSize,
  139. LONG cySize,
  140. DWORD Format,
  141. LPVOID pvBits
  142. );
  143. BOOL
  144. HalftoneBlt(
  145. PPDEV pPDev,
  146. SURFOBJ *psoDst,
  147. SURFOBJ *psoHTBlt,
  148. SURFOBJ *psoSrc,
  149. XLATEOBJ *pxlo,
  150. PRECTL prclDst,
  151. PRECTL prclSrc,
  152. PPOINTL pptlHTOrigin,
  153. BOOL DoStretchBlt
  154. );
  155. SURFOBJ *
  156. CreateSolidColorSURFOBJ(
  157. PPDEV pPDev,
  158. SURFOBJ *psoDst,
  159. HBITMAP *phBmp,
  160. DWORD SolidColor
  161. );
  162. SURFOBJ *
  163. CloneBrushSURFOBJ(
  164. PPDEV pPDev,
  165. SURFOBJ *psoDst,
  166. HBITMAP *phBmp,
  167. BRUSHOBJ *pbo
  168. );
  169. SURFOBJ *
  170. CloneSURFOBJToHT(
  171. PPDEV pPDev,
  172. SURFOBJ *psoDst,
  173. SURFOBJ *psoSrc,
  174. XLATEOBJ *pxlo,
  175. HBITMAP *phBmp,
  176. PRECTL prclDst,
  177. PRECTL prclSrc
  178. );
  179. SURFOBJ *
  180. CloneMaskSURFOBJ(
  181. PPDEV pPDev,
  182. SURFOBJ *psoMask,
  183. HBITMAP *phBmp,
  184. PRECTL prclMask
  185. );
  186. #endif // _HTBLT_