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.

220 lines
4.7 KiB

  1. /*++
  2. Copyright (c) 1990-1991 Microsoft Corporation
  3. Module Name:
  4. htp.h
  5. Abstract:
  6. This module contains all the private data structures, constant used
  7. by this DLL
  8. Author:
  9. 15-Jan-1991 Tue 21:26:24 created -by- Daniel Chou (danielc)
  10. [Environment:]
  11. GDI Device Driver - Halftone.
  12. [Notes:]
  13. Revision History:
  14. 23-Apr-1992 Thu 20:01:55 updated -by- Daniel Chou (danielc)
  15. changed 'CHAR' type to 'SHORT' type, this will make sure if compiled
  16. under MIPS the default 'unsigned char' will not affect the signed
  17. operation.
  18. 20-Sep-1991 Fri 19:27:49 updated -by- Daniel Chou (danielc)
  19. Delete #define SRCRGBF_PERCENT_SCREEN_IN_BLUE which will be processes
  20. at API call level (htapi.c)
  21. 12-Dec-1991 Thu 20:44:05 updated -by- Daniel Chou (danielc)
  22. Move all color adjustments relative things to htmapclr.h
  23. --*/
  24. #ifndef _HTP_
  25. #define _HTP_
  26. #include <stddef.h>
  27. #include <stdarg.h>
  28. #include "windef.h"
  29. #include "wingdi.h"
  30. #include "winbase.h"
  31. #include "winddi.h"
  32. #include "ht.h"
  33. #define HALFTONE_DLL_ID (DWORD)0x54484344L // "DCHT"
  34. #define HTENTRY NEAR // local functions
  35. typedef unsigned long ULDECI4;
  36. #ifndef UMODE
  37. #define qsort EngSort
  38. #endif // UMODE
  39. //
  40. // Followings are the internal error IDs, this internal error number are
  41. // all negative number and started at HTERR_INTERNAL_ERRORS_START
  42. //
  43. #define INTERR_STRETCH_FACTOR_TOO_BIG HTERR_INTERNAL_ERRORS_START
  44. #define INTERR_XSTRETCH_FACTOR_TOO_BIG HTERR_INTERNAL_ERRORS_START-1
  45. #define INTERR_STRETCH_NEG_OVERHANG HTERR_INTERNAL_ERRORS_START-2
  46. #define INTERR_COLORSPACE_NOT_MATCH HTERR_INTERNAL_ERRORS_START-3
  47. #define INTERR_INVALID_SRCRGB_SIZE HTERR_INTERNAL_ERRORS_START-4
  48. #define INTERR_INVALID_DEVRGB_SIZE HTERR_INTERNAL_ERRORS_START-5
  49. #if defined(_OS2_) || defined(_OS_20_) || defined(_DOS_)
  50. #define HT_LOADDS _loadds
  51. #else
  52. #define HT_LOADDS
  53. #endif
  54. #define DIVRUNUP(a, b) (((a) + ((b) >> 1)) / (b))
  55. #define SWAP(a, b, t) { (t)=(a); (a)=(b); (b)=(t); }
  56. typedef LPBYTE FAR *PLPBYTE;
  57. #include "htdebug.h"
  58. #include "htmemory.h"
  59. #define BMF_8BPP_MONO (BMF_HT_LAST - 1)
  60. #define BMF_8BPP_B332 (BMF_HT_LAST - 2)
  61. #define BMF_8BPP_L555 (BMF_HT_LAST - 3)
  62. #define BMF_8BPP_L666 (BMF_HT_LAST - 4)
  63. #define BMF_8BPP_K_B332 (BMF_HT_LAST - 5)
  64. #define BMF_8BPP_K_L555 (BMF_HT_LAST - 6)
  65. #define BMF_8BPP_K_L666 (BMF_HT_LAST - 7)
  66. #define COLOR_SWAP_23 0x01
  67. #define COLOR_SWAP_12 0x02
  68. #define COLOR_SWAP_13 0x04
  69. typedef struct _RGB4B {
  70. BYTE b;
  71. BYTE g;
  72. BYTE r;
  73. BYTE a;
  74. } RGB4B, *PRGB4B;
  75. typedef struct _BGR3 {
  76. BYTE b;
  77. BYTE g;
  78. BYTE r;
  79. } BGR3, *PBGR3;
  80. typedef struct _BGR8 {
  81. BYTE b;
  82. BYTE g;
  83. BYTE r;
  84. } BGR8, *PBGR8;
  85. typedef struct _GRAYF {
  86. WORD Gray;
  87. BYTE bReserved;
  88. BYTE f;
  89. } GRAYF, *PGRAYF;
  90. typedef struct _BGRF {
  91. BYTE b;
  92. BYTE g;
  93. BYTE r;
  94. BYTE f;
  95. } BGRF, *PBGRF;
  96. typedef struct _RGBL {
  97. LONG r;
  98. LONG g;
  99. LONG b;
  100. } RGBL, *PRGBL;
  101. typedef union _W2B {
  102. WORD w;
  103. BYTE b[2];
  104. } W2B, *PW2B;
  105. typedef union _DW2W4B {
  106. DWORD dw;
  107. WORD w[2];
  108. BYTE b[4];
  109. } DW2W4B, *PDW2W4B;
  110. typedef union _TW6B {
  111. WORD w[3];
  112. BYTE b[6];
  113. } TW6B, *PTW6B;
  114. typedef union _QW8B {
  115. DWORDLONG qw;
  116. DWORD dw[2];
  117. WORD w[4];
  118. BYTE b[8];
  119. } QW8B, *PQW8B;
  120. /////////////////////////////////////////////////////////////////////////////
  121. #ifndef i8086
  122. #define i8086 0
  123. #endif
  124. #ifndef i286
  125. #define i286 0
  126. #endif
  127. #ifndef i386
  128. #define i386 0
  129. #endif
  130. #if defined(_OS2_) || /* OS/2 PM 1.x */ \
  131. defined(_OS2_20_) || /* OS/2 PM 2.x */ \
  132. defined(_DOS_) || /* DOS Win3 */ \
  133. (i8086 > 0) || \
  134. (i286 > 0) || \
  135. (i386 > 0)
  136. #define Compile80x86Mode
  137. #ifdef HAS_80x86_EQUIVALENT_CODES
  138. #ifndef NO_ASM
  139. #define HT_OK_GEN_80x86_CODES
  140. #pragma message(" <--- *** Using 80x86 assembly equivalent codes.")
  141. #else // otherwise using C codes
  142. #pragma message(" <--- *** Compile C codes.")
  143. #endif // NO_ASM
  144. #endif // HAS_80x86_EQUIVALENT_CODES
  145. #endif // 80x86 cpu
  146. /////////////////////////////////////////////////////////////////////////////
  147. #endif // _HTP_