home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / sp15demo.zip / libsrc.zip / LIBSRC / PMBITMAP.PAS < prev    next >
Pascal/Delphi Source File  |  1995-10-08  |  7KB  |  217 lines

  1. UNIT PMBitMap;
  2.  
  3.  
  4. INTERFACE
  5.  
  6. USES Os2Def;
  7.  
  8. { bitmap parameterization used by GpiCreateBitmap and others }
  9.  
  10. TYPE
  11.     PBITMAPINFOHEADER=^BITMAPINFOHEADER;
  12.     BITMAPINFOHEADER=RECORD
  13.                          cbFix:ULONG;
  14.                          cx:USHORT;
  15.                          cy:USHORT;
  16.                          cPlanes:USHORT;
  17.                          cBitCount:USHORT;
  18.                      END;
  19.  
  20.    { RGB data for _BITMAPINFO struct }
  21.  
  22. TYPE
  23.     PRGB=^RGB;
  24.     RGB=RECORD  {pack 1}
  25.               bBlue:BYTE;
  26.               bGreen:BYTE;
  27.               bRed:BYTE;
  28.         END;
  29.  
  30.     TRGBArray=ARRAY[0..0] OF RGB;
  31.  
  32.    { bitmap data used by GpiSetBitmapBits and others }
  33. TYPE
  34.     PBITMAPINFO=^BITMAPINFO;
  35.     BITMAPINFO=RECORD
  36.                     cbFix:ULONG;
  37.                     cx:USHORT;
  38.                     cy:USHORT;
  39.                     cPlanes:USHORT;
  40.                     cBitCount:USHORT;
  41.                     argbColor:ARRAY[0..1] OF RGB;
  42.                END;
  43.  
  44.    { Constants for compression/decompression command }
  45. CONST
  46.     CBD_COMPRESSION     =1;
  47.     CBD_DECOMPRESSION   =2;
  48.     CBD_BITS            =0;
  49.  
  50.    { Flags for compression/decompression option }
  51.  
  52.     CBD_COLOR_CONVERSION=$00000001;
  53.  
  54.    { Compression scheme in the ulCompression field of the bitmapinfo structure }
  55. CONST
  56.     BCA_UNCOMP          =0;
  57.     BCA_HUFFMAN1D       =3;
  58.     BCA_RLE4            =2;
  59.     BCA_RLE8            =1;
  60.     BCA_RLE24           =4;
  61.  
  62.     BRU_METRIC          =0;
  63.  
  64.     BRA_BOTTOMUP        =0;
  65.     BRH_NOTHALFTONED    =0;
  66.     BRH_ERRORDIFFUSION  =1;
  67.     BRH_PANDA           =2;
  68.     BRH_SUPERCIRCLE     =3;
  69.  
  70.     BCE_PALETTE         =-1;
  71.     BCE_RGB             =0;
  72.  
  73. TYPE
  74.     PBITMAPINFOHEADER2=^BITMAPINFOHEADER2;
  75.     BITMAPINFOHEADER2=RECORD
  76.                             cbFix:ULONG;  { Length of structure }
  77.                             cx:ULONG;     { Bit-map width in pels }
  78.                             cy:ULONG;     { Bit-map height in pels }
  79.                             cPlanes:USHORT; { Number of bit planes }
  80.                             cBitCount:USHORT;{ Number of bits per pel within
  81.                                                a plane }
  82.                             ulCompression:ULONG;{ Compression scheme used to
  83.                                                   store the bitmap }
  84.                             cbImage:ULONG;  { Length of bit-map storage data
  85.                                               in bytes}
  86.                             cxResolution:ULONG;{x resolution of target device}
  87.                             cyResolution:ULONG;{resolution of target device}
  88.                             cclrUsed:ULONG;     {Number of color indices used}
  89.                             cclrImportant:ULONG;{ Number of important color indices }
  90.                             usUnits:USHORT;     { Units of measure }
  91.                             usReserved:USHORT;
  92.                             usRecording:USHORT; { Recording algorithm}
  93.                             usRendering:USHORT; { Halftoning algorithm}
  94.                             cSize1:ULONG;       { Size value 1}
  95.                             cSize2:ULONG;       { Size value 2}
  96.                             ulColorEncoding:ULONG;  {Color encoding}
  97.                             ulIdentifier:ULONG;  {Reserved for application use}
  98.                     END;
  99.  
  100. TYPE
  101.     PRGB2=^RGB2;
  102.     RGB2=RECORD
  103.                bBlue:BYTE;
  104.                bGreen:BYTE;
  105.                bRed:BYTE;
  106.                fcOptions:BYTE;  { Reserved, must be zero }
  107.          END;
  108.  
  109.     TRGB2Array=ARRAY[0..0] OF RGB2;
  110.  
  111. TYPE
  112.     PBITMAPINFO2=^BITMAPINFO2;
  113.     BITMAPINFO2=RECORD
  114.                       cbFix:ULONG;
  115.                       cx:ULONG;
  116.                       cy:ULONG;
  117.                       cPlanes:USHORT;
  118.                       cBitCount:USHORT;
  119.                       ulCompression:ULONG;
  120.                       cbImage:ULONG;
  121.                       cxResolution:ULONG;
  122.                       cyResolution:ULONG;
  123.                       cclrUsed:ULONG;
  124.                       cclrImportant:ULONG;
  125.                       usUnits:USHORT;
  126.                       usReserved:USHORT;
  127.                       usRecording:USHORT;
  128.                       usRendering:USHORT;
  129.                       cSize1:ULONG;
  130.                       cSize2:ULONG;
  131.                       ulColorEncoding:ULONG;
  132.                       ulIdentifier:ULONG;
  133.                       argbColor:ARRAY[0..1] OF RGB2;
  134.               END;
  135.  
  136. TYPE
  137.    PBITMAPFILEHEADER=^BITMAPFILEHEADER;
  138.    BITMAPFILEHEADER=RECORD
  139.                          usType:USHORT;
  140.                          cbSize:ULONG;
  141.                          xHotspot:SHORT;
  142.                          yHotspot:SHORT;
  143.                          offBits:ULONG;
  144.                          bmp:BITMAPINFOHEADER;
  145.                     END;
  146.  
  147. TYPE
  148.     PBITMAPARRAYFILEHEADER=^BITMAPARRAYFILEHEADER;
  149.     BITMAPARRAYFILEHEADER=RECORD
  150.                                usType:USHORT;
  151.                                cbSize:ULONG;
  152.                                offNext:ULONG;
  153.                                cxDisplay:USHORT;
  154.                                cyDisplay:USHORT;
  155.                                bfh:BITMAPFILEHEADER;
  156.                           END;
  157.  
  158. TYPE
  159.     PBITMAPFILEHEADER2=^BITMAPFILEHEADER2;
  160.     BITMAPFILEHEADER2=RECORD
  161.                             usType:USHORT;
  162.                             cbSize:ULONG;
  163.                             xHotspot:SHORT;
  164.                             yHotspot:SHORT;
  165.                             offBits:ULONG;
  166.                             bmp2:BITMAPINFOHEADER2;
  167.                       END;
  168.  
  169. TYPE
  170.    PBITMAPARRAYFILEHEADER2=^BITMAPARRAYFILEHEADER2;
  171.    BITMAPARRAYFILEHEADER2=RECORD
  172.                                usType:USHORT;
  173.                                cbSize:ULONG;
  174.                                offNext:ULONG;
  175.                                cxDisplay:USHORT;
  176.                                cyDisplay:USHORT;
  177.                                bfh2:BITMAPFILEHEADER2;
  178.                           END;
  179.  
  180. {*************************************************************************
  181.  * These are the identifying values that go in the usType field of the   *
  182.  * BITMAPFILEHEADER(2) and BITMAPARRAYFILEHEADER(2).                     *
  183.  * (BFT_ => Bit map File Type)                                           *
  184.  *************************************************************************}
  185. CONST
  186.     BFT_ICON           =$4349;   { 'IC' }
  187.     BFT_BMAP           =$4d42;   { 'BM' }
  188.     BFT_POINTER        =$5450;   { 'PT' }
  189.     BFT_COLORICON      =$4943;   { 'CI' }
  190.     BFT_COLORPOINTER   =$5043;   { 'CP' }
  191.  
  192.     BFT_BITMAPARRAY    =$4142;   { 'BA' }
  193.  
  194. { type of picture to print }
  195. CONST
  196.      PIP_MF       =1;
  197.      PIP_PIF      =2;
  198.  
  199. { type of conversion required }
  200.      PIC_PIFTOMET =0;
  201.      PIC_SSTOFONT =2;
  202.  
  203. IMPORTS
  204.  
  205. FUNCTION PicPrint(ahab:HAB;VAR pszFilename:PSZ;lType:LONG;VAR pszParams:PSZ):BOOL;
  206.                   APIENTRY;                   PMPIC index 11;
  207. FUNCTION PicIchg(ahab:HAB;VAR pszFilename1,pszFilename2:PSZ;lType:LONG):BOOL;
  208.                   APIENTRY;                   PMPIC index 12;
  209.  
  210. END; {IMPORTS}
  211.  
  212. IMPLEMENTATION
  213.  
  214.  
  215. BEGIN
  216. END.
  217.