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.

350 lines
12 KiB

  1. /*++
  2. Copyright (c) 1990-1991 Microsoft Corporation
  3. Module Name:
  4. htgetbmp.h
  5. Abstract:
  6. This module contains all local definitions for the htgetbmp.c
  7. Author:
  8. 28-Mar-1992 Sat 20:54:58 updated -by- Daniel Chou (danielc)
  9. Update it for VGA intensity (16 colors mode), this make all the
  10. codes update to 4 primaries internal.
  11. 05-Apr-1991 Fri 15:54:23 created -by- Daniel Chou (danielc)
  12. [Environment:]
  13. Printer Driver.
  14. [Notes:]
  15. Revision History:
  16. --*/
  17. #ifndef _HTGETBMP_
  18. #define _HTGETBMP_
  19. #define GET_GRAY_RGB(p) (((DWORD)((PBGR3)(p))->r << 2) + \
  20. ((DWORD)((PBGR3)(p))->g << 3) + \
  21. ((DWORD)((PBGR3)(p))->b ))
  22. #define SET_NEXT_PIN(pAASI) \
  23. { \
  24. if (pAASI->Flags & AASIF_INC_PB) { \
  25. \
  26. if ((pAASI->cy == 0) || (--pAASI->cy == 0)) { /* Bug 27036 */ \
  27. \
  28. if (pAASI->Flags & AASIF_TILE_SRC) { \
  29. \
  30. pAASI->pb = pAASI->pbOrg; \
  31. pAASI->cy = pAASI->cyOrg; \
  32. \
  33. } else { \
  34. \
  35. pAASI->Flags &= ~AASIF_INC_PB; \
  36. } \
  37. \
  38. } else { \
  39. \
  40. pAASI->pb += pAASI->cyNext; \
  41. } \
  42. } \
  43. }
  44. #define GET_LBGR(p) (LONG)(((DWORD)*(DWORD UNALIGNED *)(p)) & 0xFFFFFF)
  45. #define SET_CORNER_BGR(p, c0, c1, c2, c3) \
  46. { \
  47. LONG cS = GET_LBGR(p); \
  48. \
  49. (p)->b = (BYTE)((((cS & 0x0000FF) << 3) + \
  50. ((cS & 0x0000FF) << 2) + \
  51. 0x000008 + \
  52. (c0 & 0x0000FF) + \
  53. (c1 & 0x0000FF) + \
  54. (c2 & 0x0000FF) + \
  55. (c3 & 0x0000FF)) >> 4); \
  56. (p)->g = (BYTE)((((cS & 0x00FF00) << 3) + \
  57. ((cS & 0x00FF00) << 2) + \
  58. 0x000800 + \
  59. (c0 & 0x00FF00) + \
  60. (c1 & 0x00FF00) + \
  61. (c2 & 0x00FF00) + \
  62. (c3 & 0x00FF00)) >> (4 + 8)); \
  63. (p)->r = (BYTE)((((cS & 0xFF0000) << 3) + \
  64. ((cS & 0xFF0000) << 2) + \
  65. 0x080000 + \
  66. (c0 & 0xFF0000) + \
  67. (c1 & 0xFF0000) + \
  68. (c2 & 0xFF0000) + \
  69. (c3 & 0xFF0000)) >> (4 + 16)); \
  70. }
  71. #define SET_CORNER_GRAY(p, c0, c1, c2, c3) \
  72. { \
  73. LONG cS = (LONG)*(p); \
  74. \
  75. *(p) = (BYTE)((((cS) << 3) + ((cS) << 2) + 8 + \
  76. (c0) + (c1) + (c2) + (c3)) >> 4); \
  77. }
  78. #define STD_PAL_CY_SKIP 6
  79. #define MAX_FIXUPDIB_PAL 20
  80. #define MIN_FIXUP_SIZE (48 * 48)
  81. #define MIN_PAL_SIZE (128 * 128)
  82. #define GET_PAL_CHK_COUNT(x) ((x) >> 3)
  83. #define GET_PAL_CHK_COUNT2(x) ((x) >> 4)
  84. #define ZERO_MASK_SCAN(pAAHdr) ZeroMemory(pAAHdr->pMaskSrc, pAAHdr->cbMaskSrc)
  85. #define GET_MASK_SCAN(pAAHdr) \
  86. { \
  87. LPBYTE pbSrc = (LPBYTE)pAAHdr->pMaskIn; \
  88. LPBYTE pbDst = (LPBYTE)pAAHdr->pMaskSrc; \
  89. UINT cb = (UINT)pAAHdr->cbMaskSrc; \
  90. UINT cdw; \
  91. \
  92. if (pAAHdr->Flags & AAHF_INVERT_MASK) { \
  93. \
  94. cdw = cb >> 2; \
  95. cb &= 0x03; \
  96. \
  97. while (cdw--) { \
  98. \
  99. *((LPDWORD)pbDst)++ = ~*((LPDWORD)pbSrc)++; \
  100. } \
  101. \
  102. while (cb--) { \
  103. \
  104. *pbDst++ = ~*pbSrc++; \
  105. } \
  106. \
  107. } else { \
  108. \
  109. CopyMemory(pbDst, pbSrc, cb); \
  110. } \
  111. \
  112. if (--pAAHdr->cyMaskIn > 0) { \
  113. \
  114. pAAHdr->pMaskIn += pAAHdr->cyMaskNext; \
  115. } \
  116. }
  117. #define OR_MASK_SCAN(pAAHdr) \
  118. { \
  119. LPBYTE pbSrc = (LPBYTE)pAAHdr->pMaskIn; \
  120. LPBYTE pbDst = (LPBYTE)pAAHdr->pMaskSrc; \
  121. UINT cb = (UINT)pAAHdr->cbMaskSrc; \
  122. UINT cdw; \
  123. \
  124. cdw = cb >> 2; \
  125. cb &= 0x03; \
  126. \
  127. if (pAAHdr->Flags & AAHF_INVERT_MASK) { \
  128. \
  129. while (cdw--) { \
  130. \
  131. *((LPDWORD)pbDst)++ |= ~*((LPDWORD)pbSrc)++; \
  132. } \
  133. \
  134. while (cb--) { \
  135. \
  136. *pbDst++ |= ~*pbSrc++; \
  137. } \
  138. \
  139. } else { \
  140. \
  141. while (cdw--) { \
  142. \
  143. *((LPDWORD)pbDst)++ |= *((LPDWORD)pbSrc)++; \
  144. } \
  145. \
  146. while (cb--) { \
  147. \
  148. *pbDst++ |= *pbSrc++; \
  149. } \
  150. } \
  151. \
  152. if (--pAAHdr->cyMaskIn > 0) { \
  153. \
  154. pAAHdr->pMaskIn += pAAHdr->cyMaskNext; \
  155. } \
  156. }
  157. //
  158. // Function prototypes
  159. //
  160. VOID
  161. HTENTRY
  162. BltAV_CX(
  163. PAAHEADER pAAHdr
  164. );
  165. VOID
  166. HTENTRY
  167. ExpandAV_CX(
  168. PAAHEADER pAAHdr
  169. );
  170. VOID
  171. HTENTRY
  172. ShrinkAV_CX(
  173. PAAHEADER pAAHdr
  174. );
  175. VOID
  176. HTENTRY
  177. BltAV_CY(
  178. PAAHEADER pAAHdr
  179. );
  180. VOID
  181. HTENTRY
  182. TileAV_CY(
  183. PAAHEADER pAAHdr
  184. );
  185. VOID
  186. HTENTRY
  187. ExpandAV_CY(
  188. PAAHEADER pAAHdr
  189. );
  190. VOID
  191. HTENTRY
  192. ShrinkAV_CY(
  193. PAAHEADER pAAHdr
  194. );
  195. VOID
  196. HTENTRY
  197. BltMask_CX(
  198. PAAHEADER pAAHdr
  199. );
  200. VOID
  201. HTENTRY
  202. ExpandMask_CX(
  203. PAAHEADER pAAHdr
  204. );
  205. VOID
  206. HTENTRY
  207. ShrinkMask_CX(
  208. PAAHEADER pAAHdr
  209. );
  210. VOID
  211. HTENTRY
  212. BltMask_CY(
  213. PAAHEADER pAAHdr
  214. );
  215. VOID
  216. HTENTRY
  217. ExpandMask_CY(
  218. PAAHEADER pAAHdr
  219. );
  220. VOID
  221. HTENTRY
  222. ShrinkMask_CY(
  223. PAAHEADER pAAHdr
  224. );
  225. PBGR8
  226. HTENTRY
  227. Input1BPPToAA24(
  228. PAASURFINFO pAASI,
  229. PBGR8 pInBuf
  230. );
  231. PBGR8
  232. HTENTRY
  233. Input4BPPToAA24(
  234. PAASURFINFO pAASI,
  235. PBGR8 pInBuf
  236. );
  237. PBGR8
  238. HTENTRY
  239. Input8BPPToAA24(
  240. PAASURFINFO pAASI,
  241. PBGR8 pInBuf
  242. );
  243. PBGR8
  244. HTENTRY
  245. InputPreMul32BPPToAA24(
  246. PAASURFINFO pAASI,
  247. PBGR8 pInBuf
  248. );
  249. PBGR8
  250. HTENTRY
  251. InputAABFDATAToAA24(
  252. PAASURFINFO pAASI,
  253. PBGR8 pInBuf
  254. );
  255. PBGR8
  256. HTENTRY
  257. GetFixupScan(
  258. PAAHEADER pAAHdr,
  259. PBGR8 pInBuf
  260. );
  261. BOOL
  262. CheckBMPNeedFixup(
  263. PDEVICECOLORINFO pDCI,
  264. PAAHEADER pAAHdr,
  265. PHTSURFACEINFO pSrcSI,
  266. PAABBP pAABBP
  267. );
  268. VOID
  269. HTENTRY
  270. InitializeFUDI(
  271. PAAHEADER pAAHdr
  272. );
  273. #if DBG
  274. LPSTR
  275. GetAAInputFuncName(
  276. AAINPUTFUNC AAInputFunc
  277. );
  278. #endif
  279. #endif // _HTGETBMP_