Source code of Windows XP (NT5)
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.

148 lines
7.5 KiB

  1. #ifndef _DITHER_H_
  2. #define _DITHER_H_
  3. //////////////////////////////////////////////////////////////////////////////
  4. //
  5. // this code dither a 256 color DIB bitmap down to the VGA 16 colors.
  6. //
  7. //////////////////////////////////////////////////////////////////////////////
  8. typedef void (FAR PASCAL *DITHERPROC)(
  9. LPBITMAPINFOHEADER biDst, // --> BITMAPINFO of the dest
  10. LPVOID lpDst, // --> to destination bits
  11. int DstX, // Destination origin - x coordinate
  12. int DstY, // Destination origin - y coordinate
  13. int DstXE, // x extent of the BLT
  14. int DstYE, // y extent of the BLT
  15. LPBITMAPINFOHEADER biSrc, // --> BITMAPINFO of the source
  16. LPVOID lpSrc, // --> to source bits
  17. int SrcX, // Source origin - x coordinate
  18. int SrcY, // Source origin - y coordinate
  19. LPVOID lpDitherTable); // dither table.
  20. //
  21. // call DitherInit() to set up the 16k dither table.
  22. // you need to call DitherInit() whenever the source colors
  23. // change. DitherInit() returns a pointer to the dither table
  24. //
  25. extern LPVOID VFWAPI DitherInit(LPBITMAPINFOHEADER lpbiIn, LPBITMAPINFOHEADER lpbiOut, DITHERPROC FAR *lpDitherProc, LPVOID lpDitherTable);
  26. extern void VFWAPI DitherTerm(LPVOID lpDitherTable);
  27. extern LPVOID FAR PASCAL Dither8Init(LPBITMAPINFOHEADER lpbi, LPBITMAPINFOHEADER lpbiOut, DITHERPROC FAR *lpDitherProc, LPVOID lpDitherTable);
  28. extern void FAR PASCAL Dither8Term(LPVOID lpDitherTable);
  29. extern LPVOID FAR PASCAL DitherDeviceInit(LPBITMAPINFOHEADER lpbi, LPBITMAPINFOHEADER lpbiOut, DITHERPROC FAR *lpDitherProc, LPVOID lpDitherTable);
  30. extern LPVOID FAR PASCAL Dither16Init(LPBITMAPINFOHEADER lpbi, LPBITMAPINFOHEADER lpbiOut, DITHERPROC FAR *lpDitherProc, LPVOID lpDitherTable);
  31. extern void FAR PASCAL Dither16Term(LPVOID lpDitherTable);
  32. extern LPVOID FAR PASCAL Dither24Init(LPBITMAPINFOHEADER lpbi, LPBITMAPINFOHEADER lpbiOut, DITHERPROC FAR *lpDitherProc, LPVOID lpDitherTable);
  33. extern void FAR PASCAL Dither24Term(LPVOID lpDitherTable);
  34. extern LPVOID FAR PASCAL Dither32Init(LPBITMAPINFOHEADER lpbi, LPBITMAPINFOHEADER lpbiOut, DITHERPROC FAR *lpDitherProc, LPVOID lpDitherTable);
  35. extern void FAR PASCAL Dither32Term(LPVOID lpDitherTable);
  36. extern void FAR PASCAL DitherTableFree(void);
  37. //extern HPALETTE FAR CreateDith775Palette(void); // (in dith775.c)
  38. //
  39. // call this to actualy do the dither. (in dither8.asm)
  40. //
  41. extern void FAR PASCAL Dither8(
  42. LPBITMAPINFOHEADER biDst, // --> BITMAPINFO of the dest
  43. LPVOID lpDst, // --> to destination bits
  44. int DstX, // Destination origin - x coordinate
  45. int DstY, // Destination origin - y coordinate
  46. int DstXE, // x extent of the BLT
  47. int DstYE, // y extent of the BLT
  48. LPBITMAPINFOHEADER biSrc, // --> BITMAPINFO of the source
  49. LPVOID lpSrc, // --> to source bits
  50. int SrcX, // Source origin - x coordinate
  51. int SrcY, // Source origin - y coordinate
  52. LPVOID lpDitherTable); // dither table.
  53. //
  54. // call this to actualy do the dither. (in dither.c)
  55. //
  56. extern void FAR PASCAL Dither8C(
  57. LPBITMAPINFOHEADER biDst, // --> BITMAPINFO of the dest
  58. LPVOID lpDst, // --> to destination bits
  59. int DstX, // Destination origin - x coordinate
  60. int DstY, // Destination origin - y coordinate
  61. int DstXE, // x extent of the BLT
  62. int DstYE, // y extent of the BLT
  63. LPBITMAPINFOHEADER biSrc, // --> BITMAPINFO of the source
  64. LPVOID lpSrc, // --> to source bits
  65. int SrcX, // Source origin - x coordinate
  66. int SrcY, // Source origin - y coordinate
  67. LPVOID lpDitherTable); // dither table.
  68. //
  69. // call this to actualy do the dither. (in dith775.c)
  70. //
  71. extern void FAR PASCAL Dither16(
  72. LPBITMAPINFOHEADER biDst, // --> BITMAPINFO of the dest
  73. LPVOID lpDst, // --> to destination bits
  74. int DstX, // Destination origin - x coordinate
  75. int DstY, // Destination origin - y coordinate
  76. int DstXE, // x extent of the BLT
  77. int DstYE, // y extent of the BLT
  78. LPBITMAPINFOHEADER biSrc, // --> BITMAPINFO of the source
  79. LPVOID lpSrc, // --> to source bits
  80. int SrcX, // Source origin - x coordinate
  81. int SrcY, // Source origin - y coordinate
  82. LPVOID lpDitherTable); // dither table.
  83. //
  84. // call this to actualy do the dither. (in dith775.c)
  85. //
  86. extern void FAR PASCAL Dither24(
  87. LPBITMAPINFOHEADER biDst, // --> BITMAPINFO of the dest
  88. LPVOID lpDst, // --> to destination bits
  89. int DstX, // Destination origin - x coordinate
  90. int DstY, // Destination origin - y coordinate
  91. int DstXE, // x extent of the BLT
  92. int DstYE, // y extent of the BLT
  93. LPBITMAPINFOHEADER biSrc, // --> BITMAPINFO of the source
  94. LPVOID lpSrc, // --> to source bits
  95. int SrcX, // Source origin - x coordinate
  96. int SrcY, // Source origin - y coordinate
  97. LPVOID lpDitherTable); // dither table.
  98. //
  99. // call this to map 16 bpp DIBs to 24bit (in mapa.asm)
  100. //
  101. extern void FAR PASCAL Map16to24(
  102. LPBITMAPINFOHEADER biDst, // --> BITMAPINFO of the dest
  103. LPVOID lpDst, // --> to destination bits
  104. int DstX, // Destination origin - x coordinate
  105. int DstY, // Destination origin - y coordinate
  106. int DstXE, // x extent of the BLT
  107. int DstYE, // y extent of the BLT
  108. LPBITMAPINFOHEADER biSrc, // --> BITMAPINFO of the source
  109. LPVOID lpSrc, // --> to source bits
  110. int SrcX, // Source origin - x coordinate
  111. int SrcY, // Source origin - y coordinate
  112. LPVOID lpDitherTable); // dither table.
  113. //
  114. // call this to map 32 bpp DIBs to 24bit (in mapa.asm)
  115. //
  116. extern void FAR PASCAL Map32to24(
  117. LPBITMAPINFOHEADER biDst, // --> BITMAPINFO of the dest
  118. LPVOID lpDst, // --> to destination bits
  119. int DstX, // Destination origin - x coordinate
  120. int DstY, // Destination origin - y coordinate
  121. int DstXE, // x extent of the BLT
  122. int DstYE, // y extent of the BLT
  123. LPBITMAPINFOHEADER biSrc, // --> BITMAPINFO of the source
  124. LPVOID lpSrc, // --> to source bits
  125. int SrcX, // Source origin - x coordinate
  126. int SrcY, // Source origin - y coordinate
  127. LPVOID lpDitherTable); // dither table.
  128. #endif //_DITHER_H_
  129.