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.

312 lines
7.3 KiB

  1. /*++
  2. Copyright (c) 1990-1991 Microsoft Corporation
  3. Module Name:
  4. htapi.h
  5. Abstract:
  6. This module contains all the public defines, constants, structures and
  7. functions declarations for htapi.c
  8. Author:
  9. 15-Jan-1991 Wed 21:13:21 updated -by- Daniel Chou (danielc)
  10. add in test pattern support
  11. 15-Jan-1991 Tue 21:13:21 created -by- Daniel Chou (danielc)
  12. wrote it
  13. [Environment:]
  14. GDI Device Driver - Halftone.
  15. [Notes:]
  16. Revision History:
  17. --*/
  18. #ifndef _HTAPI_
  19. #define _HTAPI_
  20. //
  21. // The following are default printer and monitor C.I.E. color space Red,
  22. // Green, Blue, Alignment White's coordinate and its white/black luminance.
  23. //
  24. #define VALID_YC 0xFFFE
  25. #define VALID_YB_DENSITY 0xFFFE
  26. #define MIN_RGB_GAMMA 100
  27. #define MAX_RGB_GAMMA 65500
  28. #define INTENSITY_R (FD6)212674
  29. #define INTENSITY_G (FD6)715151
  30. #define INTENSITY_B (FD6) 72175
  31. #define HT_BRUSH_COLORFULNESS 5
  32. #define HT_K_REF_CLIP (FD6)0
  33. #define HT_W_REF_CLIP (FD6)0
  34. #define HT_K_REF_BASE HT_K_REF_CLIP
  35. #define HT_W_REF_BASE (FD6_1 - HT_W_REF_CLIP)
  36. #define HT_KW_REF_RANGE (FD6_1 - (HT_K_REF_CLIP + HT_W_REF_CLIP))
  37. #define HT_K_REF_ADD (HT_K_REF_CLIP + (FD6)0)
  38. #define HT_W_REF_SUB (HT_W_REF_CLIP + (FD6)0)
  39. #define DEFAULT_SCR_HTPAT_SIZE HTPAT_SIZE_SUPERCELL_M
  40. #if 0
  41. CIEINFO CIEInfoSRGBScreen = {
  42. { 6400, 3300, 0 }, // xr, yr, Yr CIE_NORNAL_MONITOR
  43. { 3000, 6000, 0 }, // xg, yg, Yg
  44. { 1500, 600, 0 }, // xb, yb, Yb
  45. { 0, 0,VALID_YC }, // xc, yc, Yc
  46. { 0, 0, 0 }, // xm, ym, Ym
  47. { 0, 0, 0 }, // xy, yy, Yy
  48. { 3127, 3290,UDECI4_1 } // xw, yw, Yw
  49. };
  50. CIEINFO CIEInfoSRGBPrinter = {
  51. { 6400, 3300, 0 }, // xr, yr, Yr CIE_NORNAL_MONITOR
  52. { 3000, 6000, 0 }, // xg, yg, Yg
  53. { 1500, 600, 0 }, // xb, yb, Yb
  54. { 0, 0,VALID_YC }, // xc, yc, Yc
  55. { 0, 0, 0 }, // xm, ym, Ym
  56. { 0, 0, 0 }, // xy, yy, Yy
  57. { 3457, 3585,UDECI4_1 } // xw, yw, Yw
  58. };
  59. CIEINFO CIEInfoNormalMonitor = {
  60. { 6280, 3475, 0 }, // xr, yr, Yr CIE_NORNAL_MONITOR
  61. { 2750, 5980, 0 }, // xg, yg, Yg
  62. { 1480, 625, 0 }, // xb, yb, Yb
  63. { 0, 0,VALID_YC }, // xc, yc, Yc
  64. { 0, 0, 0 }, // xm, ym, Ym
  65. { 0, 0, 0 }, // xy, yy, Yy
  66. { 3127, 3290,UDECI4_1 } // xw, yw, Yw
  67. };
  68. CIEINFO CIEInfoNTSC = {
  69. { 6700, 3300, 0 }, // xr, yr, Yr CIE_NTSC
  70. { 2100, 7100, 0 }, // xg, yg, Yg
  71. { 1250, 800, 0 }, // xb, yb, Yb
  72. { 1750, 3950,VALID_YC }, // xc, yc, Yc
  73. { 2550, 2050, 0 }, // xm, ym, Ym
  74. { 4250, 5200, 0 }, // xy, yy, Yy
  75. { 3127, 3290,UDECI4_1 } // xw, yw, Yw
  76. };
  77. CIEINFO CIEInfoNormalPrinter = {
  78. { 6380, 3350, 0 }, // xr, yr, Yr
  79. { 2345, 6075, 0 }, // xg, yg, Yg
  80. { 1410, 932, 0 }, // xb, yb, Yb
  81. { 2000, 2450,VALID_YC }, // xc, yc, Yc
  82. { 5210, 2100, 0 }, // xm, ym, Ym
  83. { 4750, 5100, 0 }, // xy, yy, Yy
  84. { 3127, 3290,UDECI4_1 } // xw, yw, Yw
  85. };
  86. CIEINFO CIEInfoColorFilm = {
  87. { 6810, 3050, 0 }, // xr, yr, Yr
  88. { 2260, 6550, 0 }, // xg, yg, Yg
  89. { 1810, 500, 0 }, // xb, yb, Yb
  90. { 2000, 2450,VALID_YC }, // xc, yc, Yc
  91. { 5210, 2100, 0 }, // xm, ym, Ym
  92. { 4750, 5100, 0 }, // xy, yy, Yy
  93. { 3470, 2985,UDECI4_1 } // xw, yw, Yw
  94. };
  95. #endif
  96. #ifdef INCLUDE_DEF_CIEINFO
  97. CONST CIEINFO HT_CIE_SRGB = {
  98. { 6400, 3300, 0 }, // xr, yr, Yr CIE_NORNAL_MONITOR
  99. { 3000, 6000, 0 }, // xg, yg, Yg
  100. { 1500, 600, 0 }, // xb, yb, Yb
  101. { 0, 0,VALID_YC }, // xc, yc, Yc
  102. { 0, 0, 0 }, // xm, ym, Ym
  103. { 0, 0, 0 }, // xy, yy, Yy
  104. { 3127, 3290,UDECI4_1 } // xw, yw, Yw
  105. };
  106. CONST SOLIDDYESINFO DefaultSolidDyesInfo = {
  107. 2720, 1730, // M/C, Y/C
  108. 1720, 1068, // C/M, Y/M
  109. 320, 210, // C/Y, M/Y
  110. };
  111. #if 0
  112. CONST SOLIDDYESINFO DefaultSolidDyesInfo = {
  113. 712, 121, // M/C, Y/C
  114. 86, 468, // C/M, Y/M
  115. 21, 35 // C/Y, M/Y
  116. };
  117. #endif
  118. CONST HTCOLORADJUSTMENT DefaultCA = {
  119. sizeof(COLORADJUSTMENT),
  120. 0,
  121. ILLUMINANT_DEFAULT,
  122. HT_DEF_RGB_GAMMA,
  123. HT_DEF_RGB_GAMMA,
  124. HT_DEF_RGB_GAMMA,
  125. 0,
  126. 10000,
  127. 0,
  128. 0,
  129. 0,
  130. 0
  131. };
  132. #define MAX_RES_PERCENT 15000
  133. #define MIN_RES_PERCENT 333
  134. #define TOT_RES_PERCENT (MAX_RES_PERCENT - MIN_RES_PERCENT + 1)
  135. #endif
  136. #ifndef _HTUI_CIEINFO_ONLY_
  137. typedef struct _HTTESTDATA {
  138. WORD cx;
  139. WORD cy;
  140. FD6 cyRatio;
  141. LPBYTE pBitmap;
  142. } HTTESTDATA, FAR *PHTTESTDATA;
  143. typedef struct _HTTESTINFO {
  144. COLORTRIAD ColorTriad;
  145. PHTTESTDATA pTestData;
  146. BYTE SurfaceFormat;
  147. BYTE TotalData;
  148. BYTE cx;
  149. BYTE cy;
  150. } HTTESTINFO, FAR *PHTTESTINFO;
  151. #define DEFAULT_DENSITY_WHITE (DECI4)9127
  152. #define DEFAULT_DENSITY_BLACK (DECI4)478
  153. #define HTAPI_IDX_INIT 0
  154. #define HTAPI_IDX_CREATE_DHI 1
  155. #define HTAPI_IDX_DESTROY_DHI 2
  156. #define HTAPI_IDX_CHB 3
  157. #define HTAPI_IDX_CCT 4
  158. #define HTAPI_IDX_CREATE_SMP 5
  159. #define HTAPI_IDX_HALFTONE_BMP 6
  160. #if DBG
  161. LONG
  162. HTENTRY
  163. HT_LOADDS
  164. SetHalftoneError(
  165. DWORD HT_FuncIndex,
  166. LONG ErrorID
  167. );
  168. #define SET_ERR(a,b) SetHalftoneError((a),(b))
  169. #define HTAPI_RET(a,b) return((LONG)(((b)<0) ? SET_ERR((a),(b)) : (b)))
  170. #else
  171. #define SET_ERR(a,b)
  172. #define HTAPI_RET(a,b) return(b)
  173. #endif
  174. #define HTINITINFO_INITIAL_CHECKSUM 0x1234f012
  175. #define HTSMP_INITIAL_CHECKSUM 0xa819203f
  176. #define MAX_CDCI_COUNT 16
  177. #define MAX_CSMP_COUNT 10
  178. //
  179. // Following are the function prototype
  180. //
  181. BOOL
  182. HTENTRY
  183. CleanUpDHI(
  184. PDEVICEHALFTONEINFO pDeviceHalftoneInfo
  185. );
  186. PCDCIDATA
  187. HTENTRY
  188. FindCachedDCI(
  189. PDEVICECOLORINFO pDCI
  190. );
  191. BOOL
  192. HTENTRY
  193. AddCachedDCI(
  194. PDEVICECOLORINFO pDCI
  195. );
  196. BOOL
  197. HTENTRY
  198. GetCachedDCI(
  199. PDEVICECOLORINFO pDCI
  200. );
  201. PCSMPBMP
  202. HTENTRY
  203. FindCachedSMP(
  204. PDEVICECOLORINFO pDCI,
  205. UINT PatternIndex
  206. );
  207. LONG
  208. HTENTRY
  209. GetCachedSMP(
  210. PDEVICECOLORINFO pDCI,
  211. PSTDMONOPATTERN pSMP
  212. );
  213. DWORD
  214. HTENTRY
  215. ComputeHTINITINFOChecksum(
  216. PDEVICECOLORINFO pDCI,
  217. PHTINITINFO pHTInitInfo
  218. );
  219. #endif // _HTUI_API_
  220. #endif // _HTAPI_