pmbitmap.pas 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. {****************************************************************************
  2. $Id$
  3. This file is part of the Free Pascal run time library.
  4. Copyright (c) 1999-2002 by the Free Pascal development team.
  5. Copyright (c) 1999-2000 by Ramon Bosque
  6. Types and constants for bitmap images manipulation
  7. plus functions implemented in PMPIC.DLL.
  8. See the file COPYING.FPC, included in this distribution,
  9. for details about the copyright.
  10. This program is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13. ****************************************************************************}
  14. unit PMBitmap;
  15. interface
  16. {$PACKRECORDS 1}
  17. type TBitmapInfoHeader=record
  18. cbFix:cardinal;
  19. cx:word;
  20. cy:word;
  21. cPlanes:word;
  22. cBitCount:word;
  23. end;
  24. PBitmapInfoHeader=^TBitmapInfoHeader;
  25. BitmapInfoHeader=TBitmapInfoHeader;
  26. TRgb=record
  27. bBlue,
  28. bGreen,
  29. bRed:byte;
  30. end;
  31. PRgb=^TRgb;
  32. Rgb=TRgb;
  33. TBitmapInfo=record
  34. cbFix:cardinal;
  35. cx:word;
  36. cy:word;
  37. cPlanes:word;
  38. cBitCount:word;
  39. aRgbColor:array[0..0] of TRgb;
  40. end;
  41. PBitmapInfo=^TBitmapInfo;
  42. BitmapInfo=TBitmapInfo;
  43. TBitmapInfoHeader2=record
  44. cbFix:cardinal; { Length of structure }
  45. cx:cardinal; { Bitmap width in pels }
  46. cy:cardinal; { Bitmap height in pels }
  47. cPlanes:word; { Number of bit planes }
  48. cBitCount:word; { Number of bits per pel within a plane }
  49. ulCompression:cardinal; { Compression scheme used
  50. to store the bitmap }
  51. cbImage:cardinal; { Length of bitmap storage data in bytes }
  52. cxResolution:cardinal; { X resolution of target device }
  53. cyResolution:cardinal; { Y resolution of target device }
  54. cClrUsed:cardinal; { Number of color indices used }
  55. cClrImportant:cardinal; { Number of important color indices }
  56. usUnits:word; { Units of measure }
  57. usReserved:word;
  58. usRecording:word; { Recording algorithm }
  59. usRendering:word; { Halftoning algorithm }
  60. cSize1:cardinal; { Size value 1 }
  61. cSize2:cardinal; { Size value 2 }
  62. ulColorEncoding:cardinal; { Color encoding }
  63. ulIdentifier:cardinal; { Reserved for application use }
  64. end;
  65. PBitmapInfoHeader2=^TBitmapInfoHeader2;
  66. BitmapInfoHeader2=TBitmapInfoHeader2;
  67. TRgb2=record
  68. bBlue,
  69. bGreen,
  70. bRed,
  71. fcOptions:byte; { Reserved, must be zero }
  72. end;
  73. PRgb2=^TRgb2;
  74. Rgb2=TRgb2;
  75. TBitmapInfo2=record
  76. cbFix:cardinal;
  77. cx:cardinal;
  78. cy:cardinal;
  79. cPlanes:word;
  80. cBitCount:word;
  81. ulCompression:cardinal;
  82. cbImage:cardinal;
  83. cxResolution:cardinal;
  84. cyResolution:cardinal;
  85. cClrUsed:cardinal;
  86. cClrImportant:cardinal;
  87. usUnits:word;
  88. usReserved:word;
  89. usRecording:word;
  90. usRendering:word;
  91. cSize1:cardinal;
  92. cSize2:cardinal;
  93. ulColorEncoding:cardinal;
  94. ulIdentifier:cardinal;
  95. aRgbColor:array[0..0] of TRgb2;
  96. end;
  97. PBitmapInfo2=^TBitmapInfo2;
  98. BitmapInfo2=TBitmapInfo2;
  99. TBitmapFileHeader=record
  100. usType:word;
  101. cbSize:cardinal;
  102. xHotspot:integer;
  103. yHotspot:integer;
  104. offBits:cardinal;
  105. bmp:TBitmapInfoHeader;
  106. end;
  107. PBitmapFileHeader=^TBitmapFileHeader;
  108. BitmapFileHeader=TBitmapFileHeader;
  109. TBitmapArrayFileHeader=record
  110. usType:word;
  111. cbSize:cardinal;
  112. offNext:cardinal;
  113. cxDisplay:word;
  114. cyDisplay:word;
  115. bfh:TBitmapFileHeader;
  116. end;
  117. PBitmapArrayFileHeader=^TBitmapArrayFileHeader;
  118. BitmapArrayFileHeader=TBitmapArrayFileHeader;
  119. TBitmapFileHeader2=record
  120. usType:word;
  121. cbSize:cardinal;
  122. xHotspot:integer;
  123. yHotspot:integer;
  124. offBits:cardinal;
  125. bmp2:TBitmapInfoHeader2;
  126. end;
  127. PBitmapFileHeader2=^TBitmapFileHeader2;
  128. BitmapFileHeader2=TBitmapFileHeader2;
  129. TBitmapArrayFileHeader2=record
  130. usType:word;
  131. cbSize:cardinal;
  132. offNext:cardinal;
  133. cxDisplay:word;
  134. cyDisplay:word;
  135. bfh2:TBitmapFileHeader2;
  136. end;
  137. PBitmapArrayFileHeader2=^TBitmapArrayFileHeader2;
  138. BitmapArrayFileHeader2=TBitmapArrayFileHeader2;
  139. { Constants for compression/decompression command }
  140. const CBD_COMPRESSION = 1;
  141. CBD_DECOMPRESSION = 2;
  142. CBD_BITS = 0;
  143. { Flags for compression/decompression option }
  144. CBD_COLOR_CONVERSION =$0000001;
  145. { Compression scheme in the ulCompression field of the bitmapinfo structure }
  146. BCA_UNCOMP = 0;
  147. BCA_HUFFMAN1D = 3;
  148. BCA_RLE4 = 2;
  149. BCA_RLE8 = 1;
  150. BCA_RLE24 = 4;
  151. BRU_METRIC = 0;
  152. BRA_BOTTOMUP = 0;
  153. BRH_NOTHALFTONED = 0;
  154. BRH_ERRORDIFFUSION = 1;
  155. BRH_PANDA = 2;
  156. BRH_SUPERCIRCLE = 3;
  157. BCE_PALETTE = -1;
  158. BCE_RGB = 0;
  159. { Values identifying bitmap types used in usType field
  160. of BITMAPFILEHEADER(2) and BITMAPARRAYFILEHEADER(2).
  161. (BFT_ => Bitmap File Type) }
  162. BFT_ICON = $4349;
  163. BFT_BMAP = $4d42;
  164. BFT_POINTER = $5450;
  165. BFT_COLORICON = $4943;
  166. BFT_COLORPOINTER = $5043;
  167. BFT_BITMAPARRAY = $4142;
  168. { type of picture to print }
  169. const PIP_MF = 1;
  170. PIP_PIF = 2;
  171. { type of conversion required }
  172. PIC_PIFTOMET = 0;
  173. PIC_SSTOFONT = 2;
  174. function PicPrint (ahab: longint; var pszFilename: PChar; lType: longint;
  175. var pszParams: PChar): Longbool; cdecl;
  176. function PicIchg (ahab: longint; var pszFilename1, pszFilename2: PChar;
  177. lType: longint): Longbool; cdecl;
  178. implementation
  179. function PicPrint (ahab: longint; var pszFilename: PChar; lType: longint;
  180. var pszParams: PChar): Longbool; cdecl; external 'PMPIC' index 11;
  181. function PicIchg (ahab: longint; var pszFilename1, pszFilename2: PChar;
  182. lType: longint): Longbool; cdecl; external 'PMPIC' index 12;
  183. end.
  184. {
  185. $Log$
  186. Revision 1.4 2002-11-02 11:16:38 hajny
  187. + PMPIC.DLL functions added
  188. Revision 1.3 2002/09/07 16:01:25 peter
  189. * old logs removed and tabs fixed
  190. }