home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / cset21v5.zip / TOOLKT21 / C / OS2H / PMBITMAP.H < prev    next >
Text File  |  1993-04-22  |  9KB  |  249 lines

  1. /****************************** Module Header ******************************\
  2. *
  3. * Module Name: PMBITMAP.H
  4. *
  5. * OS/2 Presentation Manager Bit Map, Icon and Pointer type declarations.
  6. *
  7. * Copyright (c) International Business Machines Corporation 1981, 1988-1992
  8. *
  9. * ===========================================================================
  10. *
  11. * This is the file format structure for Bit Maps, Pointers and Icons
  12. * as stored in the resource file of a PM application.
  13. *
  14. * Notes on file format:
  15. *
  16. * Each BITMAPFILEHEADER entry is immediately followed by the color table
  17. * for the bit map bits it references.
  18. * Icons and Pointers contain two BITMAPFILEHEADERs for each ARRAYHEADER
  19. * item.  The first one is for the ANDXOR mask, the second is for the
  20. * COLOR mask.  All offsets are absolute based on the start of the FILE.
  21. *
  22. * For OS/2 Version 2.0 and later BITMAPFILEHEADER2 and the other '2'
  23. * versions of each structure are recommended. Use the non-2 versions
  24. * of each structure if compatibility with OS/2 Version 1.X is required.
  25. *
  26. * ===========================================================================
  27. *
  28. * Comments at the end of each typedef line give the name tags used in
  29. * the assembler include version of this file.
  30. *
  31. * The assembler include version of this file excludes lines between XLATOFF
  32. * and XLATON comments.
  33. *
  34. \***************************************************************************/
  35.  
  36. /* XLATOFF */
  37. #ifdef __IBMC__
  38.    #pragma checkout( suspend )
  39.    #ifndef __CHKHDR__
  40.       #pragma checkout( suspend )
  41.    #endif
  42.    #pragma checkout( resume )
  43. #endif
  44. /* XLATON */
  45.  
  46. /* XLATOFF */
  47. #ifndef PMBITMAP_INCLUDED
  48.    /* XLATON */
  49.    #define PMBITMAP_INCLUDED
  50.    
  51.    /* XLATOFF */
  52.    #pragma pack(1)          /* pack on wordboundary */
  53.    /* XLATON */
  54.    
  55.    /* bitmap parameterization used by GpiCreateBitmap and others */
  56.    typedef struct _BITMAPINFOHEADER         /* bmp */
  57.    {
  58.       ULONG  cbFix;
  59.       USHORT cx;
  60.       USHORT cy;
  61.       USHORT cPlanes;
  62.       USHORT cBitCount;
  63.    } BITMAPINFOHEADER;
  64.    typedef BITMAPINFOHEADER *PBITMAPINFOHEADER;
  65.    
  66.    /* RGB data for _BITMAPINFO struct */
  67.    typedef struct _RGB              /* rgb */
  68.    {
  69.       BYTE bBlue;
  70.       BYTE bGreen;
  71.       BYTE bRed;
  72.    } RGB;
  73.    
  74.    /* bitmap data used by GpiSetBitmapBits and others */
  75.    typedef struct _BITMAPINFO       /* bmi */
  76.    {
  77.       ULONG  cbFix;
  78.       USHORT cx;
  79.       USHORT cy;
  80.       USHORT cPlanes;
  81.       USHORT cBitCount;
  82.       RGB    argbColor[1];
  83.    } BITMAPINFO;
  84.    typedef BITMAPINFO *PBITMAPINFO;
  85.    
  86.    /* Constants for compression/decompression command */
  87.    
  88.    #define CBD_COMPRESSION     1L
  89.    #define CBD_DECOMPRESSION   2L
  90.    #define CBD_BITS            0L
  91.    
  92.    /* Flags for compression/decompression option */
  93.    
  94.    #define CBD_COLOR_CONVERSION    0x00000001L
  95.    
  96.    /* Compression scheme in the ulCompression field of the bitmapinfo structure */
  97.    
  98.    #define BCA_UNCOMP          0L
  99.    #define BCA_HUFFMAN1D       3L
  100.    #define BCA_RLE4            2L
  101.    #define BCA_RLE8            1L
  102.    #define BCA_RLE24           4L
  103.    
  104.    #define BRU_METRIC          0L
  105.    
  106.    #define BRA_BOTTOMUP        0L
  107.    
  108.    #define BRH_NOTHALFTONED    0L
  109.    #define BRH_ERRORDIFFUSION  1L
  110.    #define BRH_PANDA           2L
  111.    #define BRH_SUPERCIRCLE     3L
  112.    
  113.    #define BCE_PALETTE         (-1L)
  114.    #define BCE_RGB             0L
  115.    
  116.    typedef struct _BITMAPINFOHEADER2        /* bmp2  */
  117.    {
  118.       ULONG  cbFix;            /* Length of structure                    */
  119.       ULONG  cx;               /* Bit-map width in pels                  */
  120.       ULONG  cy;               /* Bit-map height in pels                 */
  121.       USHORT cPlanes;          /* Number of bit planes                   */
  122.       USHORT cBitCount;        /* Number of bits per pel within a plane  */
  123.       ULONG  ulCompression;    /* Compression scheme used to store the bitmap */
  124.       ULONG  cbImage;          /* Length of bit-map storage data in bytes*/
  125.       ULONG  cxResolution;     /* x resolution of target device          */
  126.       ULONG  cyResolution;     /* y resolution of target device          */
  127.       ULONG  cclrUsed;         /* Number of color indices used           */
  128.       ULONG  cclrImportant;    /* Number of important color indices      */
  129.       USHORT usUnits;          /* Units of measure                       */
  130.       USHORT usReserved;       /* Reserved                               */
  131.       USHORT usRecording;      /* Recording algorithm                    */
  132.       USHORT usRendering;      /* Halftoning algorithm                   */
  133.       ULONG  cSize1;           /* Size value 1                           */
  134.       ULONG  cSize2;           /* Size value 2                           */
  135.       ULONG  ulColorEncoding;  /* Color encoding                         */
  136.       ULONG  ulIdentifier;     /* Reserved for application use           */
  137.    } BITMAPINFOHEADER2;
  138.    typedef BITMAPINFOHEADER2 *PBITMAPINFOHEADER2;
  139.    
  140.    typedef struct _RGB2         /* rgb2 */
  141.    {
  142.       BYTE bBlue;              /* Blue component of the color definition */
  143.       BYTE bGreen;             /* Green component of the color definition*/
  144.       BYTE bRed;               /* Red component of the color definition  */
  145.       BYTE fcOptions;          /* Reserved, must be zero                 */
  146.    } RGB2;
  147.    typedef RGB2 *PRGB2;
  148.    
  149.    typedef struct _BITMAPINFO2      /* bmi2 */
  150.    {
  151.       ULONG  cbFix;            /* Length of fixed portion of structure   */
  152.       ULONG  cx;               /* Bit-map width in pels                  */
  153.       ULONG  cy;               /* Bit-map height in pels                 */
  154.       USHORT cPlanes;          /* Number of bit planes                   */
  155.       USHORT cBitCount;        /* Number of bits per pel within a plane  */
  156.       ULONG  ulCompression;    /* Compression scheme used to store the bitmap */
  157.       ULONG  cbImage;          /* Length of bit-map storage data in bytes*/
  158.       ULONG  cxResolution;     /* x resolution of target device          */
  159.       ULONG  cyResolution;     /* y resolution of target device          */
  160.       ULONG  cclrUsed;         /* Number of color indices used           */
  161.       ULONG  cclrImportant;    /* Number of important color indices      */
  162.       USHORT usUnits;          /* Units of measure                       */
  163.       USHORT usReserved;       /* Reserved                               */
  164.       USHORT usRecording;      /* Recording algorithm                    */
  165.       USHORT usRendering;      /* Halftoning algorithm                   */
  166.       ULONG  cSize1;           /* Size value 1                           */
  167.       ULONG  cSize2;           /* Size value 2                           */
  168.       ULONG  ulColorEncoding;  /* Color encoding                         */
  169.       ULONG  ulIdentifier;     /* Reserved for application use           */
  170.       RGB2   argbColor[1];     /* Color definition record                */
  171.    } BITMAPINFO2;
  172.    typedef BITMAPINFO2 *PBITMAPINFO2;
  173.    
  174.    typedef struct _BITMAPFILEHEADER    /* bfh */
  175.    {
  176.       USHORT    usType;
  177.       ULONG     cbSize;
  178.       SHORT     xHotspot;
  179.       SHORT     yHotspot;
  180.       ULONG     offBits;
  181.       BITMAPINFOHEADER bmp;
  182.    } BITMAPFILEHEADER;
  183.    typedef BITMAPFILEHEADER *PBITMAPFILEHEADER;
  184.    
  185.    typedef struct _BITMAPARRAYFILEHEADER       /* bafh */
  186.    {
  187.       USHORT    usType;
  188.       ULONG     cbSize;
  189.       ULONG     offNext;
  190.       USHORT    cxDisplay;
  191.       USHORT    cyDisplay;
  192.       BITMAPFILEHEADER bfh;
  193.    } BITMAPARRAYFILEHEADER;
  194.    typedef BITMAPARRAYFILEHEADER *PBITMAPARRAYFILEHEADER;
  195.    
  196.    typedef struct _BITMAPFILEHEADER2    /* bfh2 */
  197.    {
  198.       USHORT    usType;
  199.       ULONG     cbSize;
  200.       SHORT     xHotspot;
  201.       SHORT     yHotspot;
  202.       ULONG     offBits;
  203.       BITMAPINFOHEADER2 bmp2;
  204.    } BITMAPFILEHEADER2;
  205.    typedef BITMAPFILEHEADER2 *PBITMAPFILEHEADER2;
  206.    
  207.    typedef struct _BITMAPARRAYFILEHEADER2    /* bafh2 */
  208.    {
  209.       USHORT    usType;
  210.       ULONG     cbSize;
  211.       ULONG     offNext;
  212.       USHORT    cxDisplay;
  213.       USHORT    cyDisplay;
  214.       BITMAPFILEHEADER2 bfh2;
  215.    } BITMAPARRAYFILEHEADER2;
  216.    typedef BITMAPARRAYFILEHEADER2 *PBITMAPARRAYFILEHEADER2;
  217.    
  218.    /*************************************************************************
  219.    * These are the identifying values that go in the usType field of the
  220.    * BITMAPFILEHEADER(2) and BITMAPARRAYFILEHEADER(2).
  221.    * (BFT_ => Bit map File Type)
  222.    *************************************************************************/
  223.    #define BFT_ICON           0x4349   /* 'IC' */
  224.    #define BFT_BMAP           0x4d42   /* 'BM' */
  225.    #define BFT_POINTER        0x5450   /* 'PT' */
  226.    #define BFT_COLORICON      0x4943   /* 'CI' */
  227.    #define BFT_COLORPOINTER   0x5043   /* 'CP' */
  228.    #define BFT_BITMAPARRAY    0x4142   /* 'BA' */
  229.    
  230.    /* XLATOFF */
  231.    #pragma pack()         /* reset to default packing */
  232.    /* XLATON */
  233.    
  234.    /* XLATOFF */
  235. #endif /* PMBITMAP_INCLUDED */
  236. /* XLATON */
  237.  
  238. /* XLATOFF */
  239. #ifdef __IBMC__
  240.    #pragma checkout( suspend )
  241.    #ifndef __CHKHDR__
  242.       #pragma checkout( resume )
  243.    #endif
  244.    #pragma checkout( resume )
  245. #endif
  246. /* XLATON */
  247.  
  248. /**************************** end of file **********************************/
  249.