home *** CD-ROM | disk | FTP | other *** search
/ POINT Software Programming / PPROG1.ISO / misc / vfwdk / inc / drawdib.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-02-02  |  4.8 KB  |  165 lines

  1. /**************************************************************************
  2.  
  3.     DRAWDIB.H   - routines for drawing DIBs to the screen.
  4.     
  5.     Copyright (c) 1990-1993, Microsoft Corp.  All rights reserved. 
  6.  
  7.     this code handles stretching and dithering with custom code
  8.  
  9.     the following DIB formats are supported:
  10.  
  11.         8bpp
  12.         16bpp
  13.         24bpp
  14.  
  15.     drawing to:
  16.  
  17.         16 color DC         (will dither 8bpp down)
  18.         256 (palletized) DC (will dither 16 and 24bpp down)
  19.         Full-color DC       (will just draw it!)
  20.  
  21. **************************************************************************/
  22.  
  23. #ifndef _LOADDS
  24.     #define _LOADDS _loadds
  25. #endif
  26.  
  27. typedef HANDLE HDRAWDIB; /* hdd */
  28.  
  29. /*********************************************************************
  30.  
  31.   DrawDib Flags
  32.       
  33. **********************************************************************/
  34. #define DDF_PAL_COLORS      0x0001          /* ? */
  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.  
  44. #define DDF_SAME_DIB        DDF_SAME_DRAW
  45. #define DDF_SAME_SIZE       DDF_SAME_DRAW
  46.  
  47. #define HDRAWDIB_DEFAULT    ((HDRAWDIB)1)
  48.  
  49.  
  50. /*********************************************************************
  51.  
  52.     DrawDib functions
  53.     
  54. *********************************************************************/
  55. /*
  56. **  DrawDibOpen()
  57. **
  58. */
  59. extern HDRAWDIB FAR _LOADDS PASCAL DrawDibOpen(void);
  60.  
  61. /*
  62. **  DrawDibClose()
  63. **
  64. */
  65. extern BOOL FAR _LOADDS PASCAL DrawDibClose(HDRAWDIB hdd);
  66.  
  67. /*
  68. **  DrawDibError()
  69. */
  70. extern UINT FAR _LOADDS PASCAL DrawDibError(HDRAWDIB hdd);
  71.  
  72. /*
  73. **  DrawDibGetPalette()
  74. **
  75. **  get the palette used for drawing DIBs
  76. **
  77. */
  78. extern HPALETTE FAR _LOADDS PASCAL DrawDibGetPalette(HDRAWDIB hdd);
  79.  
  80.  
  81. /*
  82. **  DrawDibSetPalette()
  83. **
  84. **  get the palette used for drawing DIBs
  85. **
  86. */
  87. extern BOOL FAR _LOADDS PASCAL DrawDibSetPalette(HDRAWDIB hdd, HPALETTE hpal);
  88.  
  89. /*
  90. **  DrawDibChangePalette()
  91. */
  92. extern BOOL FAR _LOADDS PASCAL DrawDibChangePalette(HDRAWDIB hdd, int iStart, int iLen, LPPALETTEENTRY lppe);
  93.  
  94. /*
  95. **  DrawDibRealize()
  96. **
  97. **  realize the palette in a HDD
  98. **
  99. */
  100. extern UINT FAR _LOADDS PASCAL DrawDibRealize(HDRAWDIB hdd, HDC hdc, BOOL fBackground);
  101.  
  102. /*
  103. **  DrawDibBegin()
  104. **
  105. **  prepare to draw
  106. **
  107. */
  108. extern BOOL FAR _LOADDS PASCAL DrawDibBegin(HDRAWDIB hdd,
  109.                                     HDC      hdc,
  110.                                     int      dxDst,
  111.                                     int      dyDst,
  112.                                     LPBITMAPINFOHEADER lpbi,
  113.                                     int      dxSrc,
  114.                                     int      dySrc,
  115.                                     UINT     wFlags);
  116. /*
  117. **  DrawDibDraw()
  118. **
  119. **  actualy draw a DIB to the screen.
  120. **
  121. */
  122. extern BOOL FAR _LOADDS PASCAL DrawDibDraw(HDRAWDIB hdd,
  123.                                    HDC      hdc,
  124.                                    int      xDst,
  125.                                    int      yDst,
  126.                                    int      dxDst,
  127.                                    int      dyDst,
  128.                                    LPBITMAPINFOHEADER lpbi,
  129.                                    LPVOID   lpBits,
  130.                                    int      xSrc,
  131.                                    int      ySrc,
  132.                                    int      dxSrc,
  133.                                    int      dySrc,
  134.                                    UINT     wFlags);
  135.  
  136. /*
  137. **  DrawDibEnd()
  138. */
  139. extern BOOL FAR _LOADDS PASCAL DrawDibEnd(HDRAWDIB hdd);
  140.  
  141. /*
  142. **  DrawDibTime()  [for debugging purposes only]
  143. */
  144. typedef struct {
  145.     LONG    timeCount;
  146.     LONG    timeDraw;
  147.     LONG    timeDecompress;
  148.     LONG    timeDither;
  149.     LONG    timeStretch;
  150.     LONG    timeBlt;
  151.     LONG    timeSetDIBits;
  152. }   DRAWDIBTIME, FAR *LPDRAWDIBTIME;
  153.  
  154. BOOL FAR _LOADDS PASCAL DrawDibTime(HDRAWDIB hdd, LPDRAWDIBTIME lpddtime);
  155.  
  156.  
  157. /* display profiling */
  158. #define PD_CAN_DRAW_DIB         0x0001      /* if you can draw at all */
  159. #define PD_CAN_STRETCHDIB       0x0002      /* basicly RC_STRETCHDIB */
  160. #define PD_STRETCHDIB_1_1_OK    0x0004      /* is it fast? */
  161. #define PD_STRETCHDIB_1_2_OK    0x0008      /* ... */
  162. #define PD_STRETCHDIB_1_N_OK    0x0010      /* ... */
  163.  
  164. DWORD FAR PASCAL _LOADDS DrawDibProfileDisplay(LPBITMAPINFOHEADER lpbi);
  165.