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.

144 lines
5.5 KiB

  1. // Copyright (c) Microsoft Corp. 1995
  2. /*==============================================================================
  3. Interfaces to encode AWD image streams.
  4. 19-Jul-95 RajeevD Created
  5. ==============================================================================*/
  6. #ifndef _AWDENC_
  7. #define _AWDENC_
  8. #include <windows.h>
  9. #include <buffers.h>
  10. #ifdef __cplusplus
  11. extern "C" {
  12. #endif
  13. /*==============================================================================
  14. IMAGE INTERFACE OVERVIEW
  15. This interface is used to create an image file suitable for embedding in an AWD
  16. file. First, an IMAGEINFO structure is be initialized and passed to ImageCreate.
  17. Next, ImageSetBand can be called multiple times to append bitmap data to the
  18. current page or start a new page. Finally, ImageClose must be called at the end
  19. of the last page.
  20. ==============================================================================*/
  21. /*==============================================================================
  22. The IMAGEINFO structure must be initialized before passing it to ImageCreate.
  23. The dwTypeIn field may be set to HRAW_DATA if passing Windows bitmaps, where
  24. the high (sign) bit of each byte is leftmost in the image, or LRAW_DATA for fax
  25. bitmaps, where it is rightmost. The dwTypeOut field must be set to RAMBO_DATA.
  26. These constants are defined in buffers.h.
  27. ==============================================================================*/
  28. typedef struct
  29. {
  30. DWORD dwTypeIn; // HRAW_DATA or LRAW_DATA
  31. DWORD dwTypeOut; // must be RAMBO_DATA
  32. WORD xRes; // horizontal resolution [dpi]
  33. WORD yRes; // vertical resolution [dpi]
  34. }
  35. IMAGEINFO, FAR *LPIMAGEINFO;
  36. /*==============================================================================
  37. ImageCreate creates an image file with the specified name, returning a context
  38. pointer to be passed to ImageSetBand and ImageClose.
  39. ==============================================================================*/
  40. LPVOID // returns context (NULL on failure)
  41. WINAPI
  42. ImageCreate
  43. (
  44. LPTSTR lpszImagePath, // image file name
  45. LPIMAGEINFO lpImageInfo // image parameters
  46. );
  47. /*==============================================================================
  48. ImageSetBand will encode a BITMAP with the following restrictions:
  49. bmType must be 0
  50. bmWidth pixel width, must be same for all bands and a multiple of 32
  51. bmHeight pixel height, must be same for all bands except last on page
  52. bmWidthBytes must be bmWidth / 8
  53. bmPlanes must be 1
  54. bmBitsPixel must be 1
  55. bmBits must point to less than 64K of data
  56. All bitmaps must have the same height, except the last one on a page, which may
  57. be less. To start a new page, ImageSetBand is called with bmHeight set to 0.
  58. A new page should not be started before the first page or after the last page.
  59. ==============================================================================*/
  60. BOOL // returns TRUE on success
  61. WINAPI
  62. ImageSetBand
  63. (
  64. LPVOID lpImage, // context returned from ImageCreate
  65. LPBITMAP lpbmBand // bitmap data to be added
  66. );
  67. /*==============================================================================
  68. ImageClose is called at the end of the last page. If ImageClose fails, the
  69. incomplete image file must be deleted. If ImageSetBand fails, ImageClose must
  70. be called before deleting the image file.
  71. ==============================================================================*/
  72. BOOL // returns TRUE on success
  73. WINAPI
  74. ImageClose
  75. (
  76. LPVOID lpImage // context returned from ImageCreate
  77. );
  78. /*==============================================================================
  79. AWD INTERFACE OVERVIEW
  80. This interface is used to create an AWD file and embed image files within it.
  81. The current implementation relies on static variables; therefore Win32 clients
  82. should not use it from more than one thread and Win16 clients should not yield
  83. (PeekMessage etc.) between AWDCreate and AWDClose.
  84. ==============================================================================*/
  85. /*==============================================================================
  86. AWDCreate creates a file with the specified name, returning a context pointer to
  87. be passed to AWDAddImage and AWDClose.
  88. ==============================================================================*/
  89. LPVOID // returns context (NULL on failure)
  90. WINAPI
  91. AWDCreate
  92. (
  93. LPTSTR lpszAWDPath, // AWD file name
  94. LPVOID lpReserved // must be NULL
  95. );
  96. /*==============================================================================
  97. AWDAddImage may be called multiple times to embed images within the AWD file.
  98. It is the responsibility of the client to delete the image file if no longer
  99. needed.
  100. ==============================================================================*/
  101. BOOL // returns TRUE on success
  102. WINAPI
  103. AWDAddImage
  104. (
  105. LPVOID lpAWD, // context returned from AWDCreate
  106. LPTSTR lpszImagePath // image file to embed in AWD file
  107. );
  108. /*==============================================================================
  109. AWDClose is called after no more image are to be added to the AWD file. If
  110. AWDClose fails, the incomplete AWD file should be deleted. If AWDAddImage fails,
  111. AWDClose must be called before deleting the incomplete AWD file.
  112. ==============================================================================*/
  113. BOOL
  114. WINAPI
  115. AWDClose
  116. (
  117. LPVOID lpAWD
  118. );
  119. #ifdef __cplusplus
  120. } // extern "C"
  121. #endif
  122. #endif // _AWDENC_