DSDibHelper.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. //------------------------------------------------------------------------------
  2. // File: DibHelper.H
  3. //
  4. // Desc: DirectShow sample code - Helper code for bitmap manipulation
  5. //
  6. // Copyright (c) Microsoft Corporation. All rights reserved.
  7. //------------------------------------------------------------------------------
  8. #ifndef PLUGIN_DSHOW_DSDIBHELPER_H
  9. #define PLUGIN_DSHOW_DSDIBHELPER_H
  10. #define HDIB HANDLE
  11. /* DIB macros */
  12. #define IS_WIN30_DIB(lpbi) ((*(LPDWORD)(lpbi)) == sizeof(BITMAPINFOHEADER))
  13. #define RECTWIDTH(lpRect) ((lpRect)->right - (lpRect)->left)
  14. #define RECTHEIGHT(lpRect) ((lpRect)->bottom - (lpRect)->top)
  15. // Function prototypes
  16. HDIB BitmapToDIB (HBITMAP hBitmap, HPALETTE hPal);
  17. HDIB ChangeBitmapFormat (HBITMAP hBitmap,
  18. WORD wBitCount,
  19. DWORD dwCompression,
  20. HPALETTE hPal);
  21. HDIB ChangeDIBFormat (HDIB hDIB, WORD wBitCount, DWORD dwCompression);
  22. HBITMAP CopyScreenToBitmap(LPRECT lpRect, BYTE *pData, BITMAPINFO *pHeader);
  23. HDIB CopyScreenToDIB (LPRECT);
  24. HBITMAP CopyWindowToBitmap (HWND, WORD);
  25. HDIB CopyWindowToDIB (HWND, WORD);
  26. HPALETTE CreateDIBPalette (HDIB);
  27. HDIB CreateDIB(DWORD, DWORD, WORD);
  28. WORD DestroyDIB (HDIB);
  29. void DIBError (int ErrNo);
  30. DWORD DIBHeight (LPSTR lpDIB);
  31. WORD DIBNumColors (LPSTR lpDIB);
  32. HBITMAP DIBToBitmap (HDIB hDIB, HPALETTE hPal);
  33. DWORD DIBWidth (LPSTR lpDIB);
  34. LPSTR FindDIBBits (LPSTR lpDIB);
  35. HPALETTE GetSystemPalette (void);
  36. HDIB LoadDIB (LPSTR);
  37. BOOL PaintBitmap (HDC, LPRECT, HBITMAP, LPRECT, HPALETTE);
  38. BOOL PaintDIB (HDC, LPRECT, HDIB, LPRECT, HPALETTE);
  39. int PalEntriesOnDevice (HDC hDC);
  40. WORD PaletteSize (LPSTR lpDIB);
  41. WORD SaveDIB (HDIB, LPSTR);
  42. #endif /* PLUGIN_DSHOW_DSDIBHELPER_H */
  43. //------------------------------------------------------------------------------
  44. // File: DibHelper.H
  45. //
  46. // Desc: DirectShow sample code - Helper code for bitmap manipulation
  47. //
  48. // Copyright (c) Microsoft Corporation. All rights reserved.
  49. //------------------------------------------------------------------------------
  50. #ifndef PLUGIN_DSHOW_DSDIBHELPER_H
  51. #define PLUGIN_DSHOW_DSDIBHELPER_H
  52. #define HDIB HANDLE
  53. /* DIB macros */
  54. #define IS_WIN30_DIB(lpbi) ((*(LPDWORD)(lpbi)) == sizeof(BITMAPINFOHEADER))
  55. #define RECTWIDTH(lpRect) ((lpRect)->right - (lpRect)->left)
  56. #define RECTHEIGHT(lpRect) ((lpRect)->bottom - (lpRect)->top)
  57. // Function prototypes
  58. HDIB BitmapToDIB (HBITMAP hBitmap, HPALETTE hPal);
  59. HDIB ChangeBitmapFormat (HBITMAP hBitmap,
  60. WORD wBitCount,
  61. DWORD dwCompression,
  62. HPALETTE hPal);
  63. HDIB ChangeDIBFormat (HDIB hDIB, WORD wBitCount, DWORD dwCompression);
  64. HBITMAP CopyScreenToBitmap(LPRECT lpRect, BYTE *pData, BITMAPINFO *pHeader);
  65. HDIB CopyScreenToDIB (LPRECT);
  66. HBITMAP CopyWindowToBitmap (HWND, WORD);
  67. HDIB CopyWindowToDIB (HWND, WORD);
  68. HPALETTE CreateDIBPalette (HDIB);
  69. HDIB CreateDIB(DWORD, DWORD, WORD);
  70. WORD DestroyDIB (HDIB);
  71. void DIBError (int ErrNo);
  72. DWORD DIBHeight (LPSTR lpDIB);
  73. WORD DIBNumColors (LPSTR lpDIB);
  74. HBITMAP DIBToBitmap (HDIB hDIB, HPALETTE hPal);
  75. DWORD DIBWidth (LPSTR lpDIB);
  76. LPSTR FindDIBBits (LPSTR lpDIB);
  77. HPALETTE GetSystemPalette (void);
  78. HDIB LoadDIB (LPSTR);
  79. BOOL PaintBitmap (HDC, LPRECT, HBITMAP, LPRECT, HPALETTE);
  80. BOOL PaintDIB (HDC, LPRECT, HDIB, LPRECT, HPALETTE);
  81. int PalEntriesOnDevice (HDC hDC);
  82. WORD PaletteSize (LPSTR lpDIB);
  83. WORD SaveDIB (HDIB, LPSTR);
  84. #endif /* PLUGIN_DSHOW_DSDIBHELPER_H */