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.

354 lines
5.8 KiB

  1. /*++
  2. Copyright (c) 1996 Microsoft Corporation
  3. Module Name:
  4. tifflib.h
  5. Abstract:
  6. This file contains the interfaces for the
  7. Windows NT FAX Server TIFF I/O Library.
  8. Environment:
  9. WIN32 User Mode
  10. Author:
  11. Wesley Witt (wesw) 17-Feb-1996
  12. --*/
  13. #ifndef _TIFFLIB_
  14. #define _TIFFLIB_
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18. #define TIFF_COMPRESSION_NONE 1
  19. #define TIFF_COMPRESSION_MH 2
  20. #define TIFF_COMPRESSION_MR 3
  21. #define TIFF_COMPRESSION_MMR 4
  22. typedef struct _TIFF_INFO {
  23. DWORD ImageWidth;
  24. DWORD ImageHeight;
  25. DWORD PageCount;
  26. DWORD PhotometricInterpretation;
  27. DWORD ImageSize;
  28. DWORD CompressionType;
  29. DWORD FillOrder;
  30. DWORD YResolution;
  31. } UNALIGNED TIFF_INFO, *PTIFF_INFO;
  32. typedef struct _MS_TAG_INFO {
  33. LPWSTR RecipName;
  34. LPWSTR RecipNumber;
  35. LPWSTR SenderName;
  36. LPWSTR Routing;
  37. LPWSTR CallerId;
  38. LPWSTR Csid;
  39. LPWSTR Tsid;
  40. DWORDLONG FaxTime;
  41. } MS_TAG_INFO, *PMS_TAG_INFO;
  42. HANDLE
  43. TiffCreate(
  44. LPTSTR FileName,
  45. DWORD CompressionType,
  46. DWORD ImageWidth,
  47. DWORD FillOrder,
  48. DWORD HiRes
  49. );
  50. HANDLE
  51. TiffOpen(
  52. LPTSTR FileName,
  53. PTIFF_INFO TiffInfo,
  54. BOOL ReadOnly,
  55. DWORD RequestedFillOrder
  56. );
  57. BOOL
  58. TiffClose(
  59. HANDLE hTiff
  60. );
  61. BOOL
  62. TiffStartPage(
  63. HANDLE hTiff
  64. );
  65. BOOL
  66. TiffEndPage(
  67. HANDLE hTiff
  68. );
  69. BOOL
  70. TiffWrite(
  71. HANDLE hTiff,
  72. LPBYTE TiffData
  73. );
  74. BOOL
  75. TiffWriteRaw(
  76. HANDLE hTiff,
  77. LPBYTE TiffData,
  78. DWORD Size
  79. );
  80. BOOL
  81. TiffRead(
  82. HANDLE hTiff,
  83. LPBYTE TiffData,
  84. DWORD PadLength
  85. );
  86. BOOL
  87. TiffReadRaw(
  88. HANDLE hTiff,
  89. IN OUT LPBYTE Buffer,
  90. IN OUT LPDWORD BufferSize,
  91. IN DWORD RequestedCompressionType,
  92. IN DWORD FillOrder,
  93. IN BOOL HiRes
  94. );
  95. BOOL
  96. TiffSeekToPage(
  97. HANDLE hTiff,
  98. DWORD PageNumber,
  99. DWORD FillOrder
  100. );
  101. BOOL
  102. TiffPostProcess(
  103. LPTSTR FileName
  104. );
  105. BOOL
  106. TiffRecoverGoodPages(
  107. LPWSTR SrcFileName,
  108. LPDWORD RecoveredPages,
  109. LPDWORD TotalPages
  110. );
  111. // fast tiff
  112. void
  113. BuildLookupTables(
  114. DWORD TableLength
  115. );
  116. BOOL
  117. DecodeMrPage(
  118. HANDLE hTiff,
  119. LPBYTE OutputBuffer,
  120. BOOL SingleLineBuffer,
  121. BOOL HiRes
  122. );
  123. BOOL
  124. DecodeMhPage(
  125. HANDLE hTiff,
  126. LPBYTE OutputBuffer,
  127. BOOL SingleLineBuffer
  128. );
  129. BOOL
  130. DecodeMmrPage(
  131. HANDLE hTiff,
  132. LPBYTE OutputBuffer,
  133. BOOL SingleLineBuffer,
  134. BOOL HiRes
  135. );
  136. BOOL
  137. ConvMmrPageToMrSameRes(
  138. HANDLE hTiff,
  139. LPDWORD lpdwOutputBuffer,
  140. DWORD *lpdwSizeOutputBuffer,
  141. BOOL NegotHiRes
  142. );
  143. BOOL
  144. ConvMmrPageHiResToMrLoRes(
  145. HANDLE hTiff,
  146. LPDWORD lpdwOutputBuffer,
  147. DWORD *lpdwSizeOutputBuffer
  148. );
  149. BOOL
  150. ConvMmrPageToMh(
  151. HANDLE hTiff,
  152. LPDWORD lpdwOutputBuffer,
  153. DWORD *lpdwSizeOutputBuffer,
  154. BOOL NegotHiRes,
  155. BOOL SrcHiRes
  156. );
  157. BOOL
  158. ConvMmrHiResToLowRes(
  159. LPTSTR SrcFileName,
  160. LPTSTR DestFileName
  161. );
  162. BOOL
  163. ConvFileMhToMmr(
  164. LPTSTR SrcFileName,
  165. LPTSTR DestFileName
  166. );
  167. BOOL
  168. OutputMmrLine(
  169. LPDWORD lpdwOut,
  170. BYTE BitOut,
  171. WORD *pCurLine,
  172. WORD *pRefLine,
  173. LPDWORD *lpdwResPtr,
  174. BYTE *ResBit,
  175. LPDWORD lpdwOutLimit
  176. );
  177. BOOL
  178. TiffPostProcessFast(
  179. LPTSTR SrcFileName,
  180. LPTSTR DstFileName // can be null for generated name
  181. );
  182. BOOL
  183. MmrAddBranding(
  184. LPTSTR SrcFileName,
  185. LPTSTR Branding,
  186. LPTSTR BrandingOf,
  187. INT BrandingHeight
  188. );
  189. BOOL
  190. ScanMhSegment(
  191. LPDWORD *lplpdwResPtr,
  192. BYTE *lpResBit,
  193. LPDWORD EndPtr,
  194. LPDWORD EndBuffer,
  195. DWORD *Lines,
  196. DWORD *BadFaxLines,
  197. DWORD *ConsecBadLines,
  198. DWORD AllowedBadFaxLines,
  199. DWORD AllowedConsecBadLines
  200. );
  201. BOOL
  202. ScanMrSegment(
  203. LPDWORD *lplpdwResPtr,
  204. BYTE *lpResBit,
  205. LPDWORD EndPtr,
  206. LPDWORD EndBuffer,
  207. DWORD *Lines,
  208. DWORD *BadFaxLines,
  209. DWORD *ConsecBadLines,
  210. DWORD AllowedBadFaxLines,
  211. DWORD AllowedConsecBadLines,
  212. BOOL *f1D
  213. );
  214. BOOL
  215. FaxTiffInitialize();
  216. BOOL
  217. TiffGetCurrentPageData(
  218. HANDLE hTiff,
  219. LPDWORD Lines,
  220. LPDWORD StripDataSize,
  221. LPDWORD ImageWidth,
  222. LPDWORD ImageHeight
  223. );
  224. BOOL
  225. TiffUncompressMmrPage(
  226. HANDLE hTiff,
  227. LPDWORD lpdwOutputBuffer,
  228. LPDWORD Lines
  229. );
  230. BOOL
  231. TiffUncompressMmrPageRaw(
  232. LPBYTE StripData,
  233. DWORD StripDataSize,
  234. DWORD ImageWidth,
  235. LPDWORD lpdwOutputBuffer,
  236. LPDWORD LinesOut
  237. );
  238. BOOL
  239. TiffExtractFirstPage(
  240. LPWSTR FileName,
  241. LPBYTE *Buffer,
  242. LPDWORD BufferSize,
  243. LPDWORD ImageWidth,
  244. LPDWORD ImageHeight
  245. );
  246. BOOL
  247. TiffAddMsTags(
  248. LPWSTR FileName,
  249. PMS_TAG_INFO MsTagInfo
  250. );
  251. BOOL
  252. PrintTiffFile(
  253. HDC PrinterDC,
  254. LPWSTR FileName
  255. );
  256. #define TIFFCF_ORIGINAL_FILE_GOOD 0x00000001
  257. #define TIFFCF_UNCOMPRESSED_BITS 0x00000002
  258. #define TIFFCF_NOT_TIFF_FILE 0x00000004
  259. BOOL
  260. ConvertTiffFileToValidFaxFormat(
  261. LPWSTR TiffFileName,
  262. LPWSTR NewFileName,
  263. LPDWORD Flags
  264. );
  265. BOOL
  266. MergeTiffFiles(
  267. LPWSTR BaseTiffFile,
  268. LPWSTR NewTiffFile
  269. );
  270. #ifdef __cplusplus
  271. }
  272. #endif
  273. #endif