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.

184 lines
4.7 KiB

  1. /*++
  2. Copyright (c) 1990-1991 Microsoft Corporation
  3. Module Name:
  4. htpat.h
  5. Abstract:
  6. This module contains the local structures, constants definitions for the
  7. htpat.c
  8. Author:
  9. 23-Oct-1997 Thu 15:14:14 updated -by- Daniel Chou (danielc)
  10. Re-write regress for color mapping
  11. 23-Apr-1992 Thu 20:01:55 updated -by- Daniel Chou (danielc)
  12. 1. Changed SHIFTMASK data structure.
  13. A. changed the NextDest[] from 'CHAR' to SHORT, this is will make
  14. sure if compiled under MIPS the default 'unsigned char' will
  15. not affect the signed operation.
  16. B. Change Shift1st From 'BYTE' to 'WORD'
  17. 28-Mar-1992 Sat 20:58:07 updated -by- Daniel Chou (danielc)
  18. Add all the functions which related the device pel/intensities
  19. regression analysis.
  20. 18-Jan-1991 Fri 16:53:41 created -by- Daniel Chou (danielc)
  21. [Environment:]
  22. GDI Device Driver - Halftone.
  23. [Notes:]
  24. Revision History:
  25. 20-Sep-1991 Fri 18:09:50 updated -by- Daniel Chou (danielc)
  26. Change DrawPatLine() prototype to DrawCornerLine()
  27. 13-Apr-1992 Mon 18:40:44 updated -by- Daniel Chou (danielc)
  28. Rewrite MakeHalftoneBrush()
  29. --*/
  30. #ifndef _HTPAT_
  31. #define _HTPAT_
  32. #define MOD_PAT_XY(s,xy,c) if (((s) = (SHORT)(xy)%(c)) < 0) { (s) += (c); }
  33. typedef struct _PATINFO {
  34. LPBYTE pYData;
  35. HTCELL HTCell;
  36. } PATINFO, FAR *PPATINFO;
  37. typedef struct _SCDATA {
  38. BYTE Value;
  39. BYTE xSubC;
  40. WORD Index;
  41. } SCDATA, FAR *PSCDATA;
  42. typedef struct _STDHTPAT {
  43. BYTE cx;
  44. BYTE cy;
  45. WORD cbSrcPat;
  46. CONST BYTE *pbSrcPat;
  47. } STDHTPAT, *PSTDHTPAT;
  48. //
  49. // This is the default using by the NT GDI
  50. //
  51. #define DEFAULT_SMP_LINE_WIDTH 8 // 0.008 inch
  52. #define DEFAULT_SMP_LINES_PER_INCH 15 // 15 lines per inch
  53. typedef struct _MONOPATRATIO {
  54. UDECI4 YSize;
  55. UDECI4 Distance;
  56. } MONOPATRATIO;
  57. #define CACHED_PAT_MIN_WIDTH 64
  58. #define CACHED_PAT_MAX_WIDTH 256
  59. #define CHB_TYPE_PACK8 0
  60. #define CHB_TYPE_PACK2 1
  61. #define CHB_TYPE_BYTE 2
  62. #define CHB_TYPE_WORD 3
  63. #define CHB_TYPE_DWORD 4
  64. #define CX_RGB555PAT 65
  65. #define CY_RGB555PAT 65
  66. #define CX_SIZE_RGB555PAT (CX_RGB555PAT + 1)
  67. #define CB_RGB555PAT (CX_SIZE_RGB555PAT * CY_RGB555PAT)
  68. typedef struct _AAPATINFO {
  69. LPBYTE pbPatBGR; // Starting pattern scan X/Y offset
  70. LPBYTE pbWrapBGR; // point of wrapping of whole pattern
  71. LPBYTE pbBegBGR; // Whole pattern wrapping location
  72. LONG cyNextBGR; // cb to next pattern scan
  73. LONG cbEndBGR; // cb to the LAST PAT of scan from pbPatBGR
  74. LONG cbWrapBGR; // cb to wrap from LAST PATTERN
  75. RGBORDER DstOrder; // Destination order
  76. LPBYTE pbPat555; // Starting pattern scan X/Y offset
  77. LPBYTE pbWrap555; // point of wrapping of whole pattern
  78. LPBYTE pbBeg555; // Whole pattern wrapping location
  79. LONG cyNext555; // cb to next pattern scan
  80. LONG cbEnd555; // cb to the LAST PAT of scan from pbPat555
  81. } AAPATINFO, *PAAPATINFO;
  82. #define MAX_BGR_IDX 0xFFF
  83. #define MAX_K_IDX ((MAX_BGR_IDX + 2) / 3)
  84. #define PAT_CX_ADD 7
  85. #define CB_PAT sizeof(WORD)
  86. #define COUNT_PER_PAT 3
  87. #define SIZE_PER_PAT (CB_PAT * COUNT_PER_PAT)
  88. #define INC_PPAT(p,i) (LPBYTE)(p) += (i * SIZE_PER_PAT)
  89. #define GETPAT(p, Order, Idx) \
  90. (DWORD)*((LPWORD)((LPBYTE)(p) + Order + (Idx * SIZE_PER_PAT)))
  91. #define GETMONOPAT(p, Idx) GETPAT(p, 2, Idx)
  92. //
  93. // Function Prototype
  94. //
  95. LONG
  96. HTENTRY
  97. ComputeHTCell(
  98. WORD HTPatternIndex,
  99. PHALFTONEPATTERN pHalftonePattern,
  100. PDEVICECOLORINFO pDeviceColorInfo
  101. );
  102. VOID
  103. HTENTRY
  104. DrawCornerLine(
  105. LPBYTE pPattern,
  106. WORD cxPels,
  107. WORD cyPels,
  108. WORD BytesPerScanLine,
  109. WORD LineWidthPels,
  110. BOOL FlipY
  111. );
  112. LONG
  113. HTENTRY
  114. CreateStandardMonoPattern(
  115. PDEVICECOLORINFO pDeviceColorInfo,
  116. PSTDMONOPATTERN pStdMonoPat
  117. );
  118. LONG
  119. HTENTRY
  120. CachedHalftonePattern(
  121. PDEVICECOLORINFO pDCI,
  122. PDEVCLRADJ pDevClrAdj,
  123. PAAPATINFO pAAPI,
  124. LONG PatX,
  125. LONG PatY,
  126. BOOL FlipYPat
  127. );
  128. #endif // _HTPAT_