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.

301 lines
6.0 KiB

  1. /**************************************************************************
  2. DRAWDIB.H - routines for drawing DIBs to the screen.
  3. Copyright (c) 1990-1995, Microsoft Corp. All rights reserved.
  4. this code handles stretching and dithering with custom code.
  5. the following DIB formats are supported:
  6. 8bpp
  7. 16bpp
  8. 24bpp
  9. drawing to:
  10. 16 color DC (will dither 8bpp down)
  11. 256 (palletized) DC (will dither 16 and 24bpp down)
  12. Full-color DC (will just draw it!)
  13. **************************************************************************/
  14. #ifndef _INC_DRAWDIB
  15. #define _INC_DRAWDIB
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19. #ifndef RC_INVOKED
  20. #ifndef VFWAPI
  21. #define VFWAPI WINAPI
  22. #ifdef WINAPIV
  23. #define VFWAPIV WINAPIV
  24. #else
  25. #define VFWAPIV FAR CDECL
  26. #endif
  27. #endif
  28. #endif
  29. // begin_vfw32
  30. typedef HANDLE HDRAWDIB; /* hdd */
  31. /*********************************************************************
  32. DrawDib Flags
  33. **********************************************************************/
  34. #define DDF_0001 0x0001 /* ;Internal */
  35. #define DDF_UPDATE 0x0002 /* re-draw the last DIB */
  36. #define DDF_SAME_HDC 0x0004 /* HDC same as last call (all setup) */
  37. #define DDF_SAME_DRAW 0x0008 /* draw params are the same */
  38. #define DDF_DONTDRAW 0x0010 /* dont draw frame, just decompress */
  39. #define DDF_ANIMATE 0x0020 /* allow palette animation */
  40. #define DDF_BUFFER 0x0040 /* always buffer image */
  41. #define DDF_JUSTDRAWIT 0x0080 /* just draw it with GDI */
  42. #define DDF_FULLSCREEN 0x0100 /* use DisplayDib */
  43. #define DDF_BACKGROUNDPAL 0x0200 /* Realize palette in background */
  44. #define DDF_NOTKEYFRAME 0x0400 /* this is a partial frame update, hint */
  45. #define DDF_HURRYUP 0x0800 /* hurry up please! */
  46. #define DDF_HALFTONE 0x1000 /* always halftone */
  47. #define DDF_2000 0x2000 /* ;Internal */
  48. #define DDF_PREROLL DDF_DONTDRAW /* Builing up a non-keyframe */
  49. #define DDF_SAME_DIB DDF_SAME_DRAW
  50. #define DDF_SAME_SIZE DDF_SAME_DRAW
  51. /*********************************************************************
  52. DrawDib functions
  53. *********************************************************************/
  54. /* // ;Internal
  55. ** DrawDibInit() // ;Internal
  56. ** // ;Internal
  57. */ // ;Internal
  58. extern BOOL VFWAPI DrawDibInit(void); // ;Internal
  59. // ;Internal
  60. /*
  61. ** DrawDibOpen()
  62. **
  63. */
  64. extern HDRAWDIB VFWAPI DrawDibOpen(void);
  65. /*
  66. ** DrawDibClose()
  67. **
  68. */
  69. extern
  70. BOOL
  71. VFWAPI
  72. DrawDibClose(
  73. IN HDRAWDIB hdd
  74. );
  75. /*
  76. ** DrawDibGetBuffer()
  77. **
  78. */
  79. extern
  80. LPVOID
  81. VFWAPI
  82. DrawDibGetBuffer(
  83. IN HDRAWDIB hdd,
  84. OUT LPBITMAPINFOHEADER lpbi,
  85. IN DWORD dwSize,
  86. IN DWORD dwFlags
  87. );
  88. /* // ;Internal
  89. ** DrawDibError() // ;Internal
  90. */ // ;Internal
  91. extern UINT VFWAPI DrawDibError(HDRAWDIB hdd); // ;Internal
  92. // ;Internal
  93. /*
  94. ** DrawDibGetPalette()
  95. **
  96. ** get the palette used for drawing DIBs
  97. **
  98. */
  99. extern
  100. HPALETTE
  101. VFWAPI
  102. DrawDibGetPalette(
  103. IN HDRAWDIB hdd
  104. );
  105. /*
  106. ** DrawDibSetPalette()
  107. **
  108. ** get the palette used for drawing DIBs
  109. **
  110. */
  111. extern
  112. BOOL
  113. VFWAPI
  114. DrawDibSetPalette(
  115. IN HDRAWDIB hdd,
  116. IN HPALETTE hpal
  117. );
  118. /*
  119. ** DrawDibChangePalette()
  120. */
  121. extern
  122. BOOL
  123. VFWAPI
  124. DrawDibChangePalette(
  125. IN HDRAWDIB hdd,
  126. IN int iStart,
  127. IN int iLen,
  128. IN LPPALETTEENTRY lppe
  129. );
  130. /*
  131. ** DrawDibRealize()
  132. **
  133. ** realize the palette in a HDD
  134. **
  135. */
  136. extern
  137. UINT
  138. VFWAPI
  139. DrawDibRealize(
  140. IN HDRAWDIB hdd,
  141. IN HDC hdc,
  142. IN BOOL fBackground
  143. );
  144. /*
  145. ** DrawDibStart()
  146. **
  147. ** start of streaming playback
  148. **
  149. */
  150. extern
  151. BOOL
  152. VFWAPI
  153. DrawDibStart(
  154. IN HDRAWDIB hdd,
  155. IN DWORD rate
  156. );
  157. /*
  158. ** DrawDibStop()
  159. **
  160. ** start of streaming playback
  161. **
  162. */
  163. extern
  164. BOOL
  165. VFWAPI
  166. DrawDibStop(
  167. IN HDRAWDIB hdd
  168. );
  169. /*
  170. ** DrawDibBegin()
  171. **
  172. ** prepare to draw
  173. **
  174. */
  175. extern
  176. BOOL
  177. VFWAPI
  178. DrawDibBegin(
  179. IN HDRAWDIB hdd,
  180. IN HDC hdc,
  181. IN int dxDst,
  182. IN int dyDst,
  183. IN LPBITMAPINFOHEADER lpbi,
  184. IN int dxSrc,
  185. IN int dySrc,
  186. IN UINT wFlags
  187. );
  188. /*
  189. ** DrawDibDraw()
  190. **
  191. ** actualy draw a DIB to the screen.
  192. **
  193. */
  194. extern
  195. BOOL
  196. VFWAPI
  197. DrawDibDraw(
  198. IN HDRAWDIB hdd,
  199. IN HDC hdc,
  200. IN int xDst,
  201. IN int yDst,
  202. IN int dxDst,
  203. IN int dyDst,
  204. IN LPBITMAPINFOHEADER lpbi,
  205. IN LPVOID lpBits,
  206. IN int xSrc,
  207. IN int ySrc,
  208. IN int dxSrc,
  209. IN int dySrc,
  210. IN UINT wFlags
  211. );
  212. /*
  213. ** DrawDibUpdate()
  214. **
  215. ** redraw the last image (may only be valid with DDF_BUFFER)
  216. */
  217. #define DrawDibUpdate(hdd, hdc, x, y) \
  218. DrawDibDraw(hdd, hdc, x, y, 0, 0, NULL, NULL, 0, 0, 0, 0, DDF_UPDATE)
  219. /*
  220. ** DrawDibEnd()
  221. */
  222. extern
  223. BOOL
  224. VFWAPI
  225. DrawDibEnd(
  226. IN HDRAWDIB hdd
  227. );
  228. /*
  229. ** DrawDibTime() [for debugging purposes only]
  230. */
  231. typedef struct {
  232. LONG timeCount;
  233. LONG timeDraw;
  234. LONG timeDecompress;
  235. LONG timeDither;
  236. LONG timeStretch;
  237. LONG timeBlt;
  238. LONG timeSetDIBits;
  239. } DRAWDIBTIME, FAR *LPDRAWDIBTIME;
  240. BOOL
  241. VFWAPI
  242. DrawDibTime(
  243. IN HDRAWDIB hdd,
  244. OUT LPDRAWDIBTIME lpddtime
  245. );
  246. /* display profiling */
  247. #define PD_CAN_DRAW_DIB 0x0001 /* if you can draw at all */
  248. #define PD_CAN_STRETCHDIB 0x0002 /* basicly RC_STRETCHDIB */
  249. #define PD_STRETCHDIB_1_1_OK 0x0004 /* is it fast? */
  250. #define PD_STRETCHDIB_1_2_OK 0x0008 /* ... */
  251. #define PD_STRETCHDIB_1_N_OK 0x0010 /* ... */
  252. LRESULT
  253. VFWAPI
  254. DrawDibProfileDisplay(
  255. IN LPBITMAPINFOHEADER lpbi
  256. );
  257. // end_vfw32
  258. #ifdef __cplusplus
  259. }
  260. #endif
  261. #endif // _INC_DRAWDIB