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.

130 lines
4.5 KiB

  1. // Copyright (c) Microsoft Corp. 1993-95
  2. /*==============================================================================
  3. Interfaces to decode AWD image streams.
  4. 17-Oct-93 RajeevD Created.
  5. ==============================================================================*/
  6. #ifndef _VIEWREND_
  7. #define _VIEWREND_
  8. #include <windows.h>
  9. #include <buffers.h>
  10. #ifdef __cplusplus
  11. extern "C" {
  12. #endif
  13. #ifdef IFBGPROC
  14. #ifndef _BITMAP_
  15. #define _BITMAP_
  16. // Win 3.1 Bitmap
  17. typedef struct
  18. {
  19. int bmType;
  20. int bmWidth;
  21. int bmHeight;
  22. int bmWidthBytes;
  23. BYTE bmPlanes;
  24. BYTE bmBitsPixel;
  25. void FAR* bmBits;
  26. }
  27. BITMAP, FAR *LPBITMAP;
  28. #endif // _BITMAP_
  29. #endif // IFBGPROC
  30. /*==============================================================================
  31. VIEWER INTERFACE OVERVIEW
  32. This interface is used to decode AWD image streams. First, ViewerOpen is called,
  33. filling a VIEWINFO structure. ViewerSetPage seeks to a page. ViewerGetBand may
  34. be called multiple times to fetch bitmaps for the next band of the page. Finally,
  35. ViewerClose is called to terminate the session.
  36. ==============================================================================*/
  37. /*==============================================================================
  38. For AWD files created by Win95 RTM, yMax will be an upper bound, possibly 72
  39. scan lines more than the exact value. For AWD files created with awdenc32.dll
  40. or the SDK release of awrbae32.dll, the yMax reported will be the exact value.
  41. ==============================================================================*/
  42. #pragma pack (push)
  43. #pragma pack(1)
  44. typedef struct
  45. {
  46. WORD cPage; // number of pages
  47. WORD xRes; // horizontal resolution [dpi]
  48. WORD yRes; // vertical resolution [dpi]
  49. WORD yMax; // maximum page height [pixels]
  50. }
  51. VIEWINFO, FAR* LPVIEWINFO;
  52. #pragma pack(pop)
  53. /*==============================================================================
  54. ViewerOpen is passed a pointer to the image stream. The caller may request
  55. HRAW_DATA for Windows bitmaps, where the high bit (sign) of each byte is
  56. leftmost in the image, or LRAW_DATA for fax bitmaps, where it is rightmost.
  57. These constants are defined in buffers.h.
  58. Upon return, the lpwBandSize parameter will contain the size of the band to
  59. be allocated to receive bitmaps fetched with ViewerGetBand. The VIEWINFO
  60. structure will also be filled.
  61. ==============================================================================*/
  62. LPVOID // returns context (NULL on failure)
  63. WINAPI
  64. ViewerOpen
  65. (
  66. LPVOID lpImage, // OLE2 IStream*
  67. DWORD nType, // data type: HRAW_DATA or LRAW_DATA
  68. LPWORD lpwReserved, // reserved, pass NULL
  69. LPWORD lpwBandSize, // output pointer to output band size
  70. LPVIEWINFO lpViewInfo // output pointer to VIEWINFO struct
  71. );
  72. /*==============================================================================
  73. ViewerSetPage seeks to the current page. The first page has index 0.
  74. ==============================================================================*/
  75. BOOL // returns TRUE for success
  76. WINAPI
  77. ViewerSetPage
  78. (
  79. LPVOID lpContext, // context returned from ViewerOpen
  80. UINT iPage // page index (first page is 0)
  81. );
  82. /*==============================================================================
  83. ViewerGetBand may be called to fetch successive bands of a page. Upon call,
  84. bmBits must point to an output buffer of size determined by ViewerOpen.
  85. Upon return, the remaining fields will be filled as follows...
  86. bmType must be 0
  87. bmWidth pixel width, will be same for all bands and a multiple of 32
  88. bmHeight pixel height, will be same for all bands except last on page
  89. bmWidthBytes will be bmWidth / 8
  90. bmPlanes will be 1
  91. bmBitsPixel will be 1
  92. If there are no more bands on the page, bmHeight will be 0 and ViewerSetPage
  93. must be called before calling ViewerGetBand again.
  94. ==============================================================================*/
  95. BOOL // returns TRUE for success
  96. WINAPI
  97. ViewerGetBand
  98. (
  99. LPVOID lpContext, // context returned from ViewerOpen
  100. LPBITMAP lpbmBand // bitmap and bmBits to be filled
  101. );
  102. /*==============================================================================
  103. ViewerClose must be called to release the context returned by ViewerOpen.
  104. ==============================================================================*/
  105. BOOL WINAPI ViewerClose
  106. (
  107. LPVOID lpContext // context returned from ViewerOpen
  108. );
  109. #ifdef __cplusplus
  110. } // extern "C"
  111. #endif
  112. #endif // _VIEWREND_