home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / cset21v5.zip / TOOLKT21 / CPLUS / OS2H / PMBITMAP.H < prev    next >
C/C++ Source or Header  |  1993-05-03  |  9KB  |  251 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.    #pragma info( none )
  38.    #ifndef __CHKHDR__
  39.       #pragma info( none )
  40.    #endif
  41.    #pragma info( restore )
  42. #ifdef __cplusplus
  43.       extern "C" {
  44. #endif
  45. /* XLATON */
  46.  
  47. /* XLATOFF */
  48. #ifndef PMBITMAP_INCLUDED
  49.    /* XLATON */
  50.    #define PMBITMAP_INCLUDED
  51.  
  52.    /* XLATOFF */
  53.    #pragma pack(1)          /* pack on wordboundary */
  54.    /* XLATON */
  55.  
  56.    /* bitmap parameterization used by GpiCreateBitmap and others */
  57.    typedef struct _BITMAPINFOHEADER         /* bmp */
  58.    {
  59.       ULONG  cbFix;
  60.       USHORT cx;
  61.       USHORT cy;
  62.       USHORT cPlanes;
  63.       USHORT cBitCount;
  64.    } BITMAPINFOHEADER;
  65.    typedef BITMAPINFOHEADER *PBITMAPINFOHEADER;
  66.  
  67.    /* RGB data for _BITMAPINFO struct */
  68.    typedef struct _RGB              /* rgb */
  69.    {
  70.       BYTE bBlue;
  71.       BYTE bGreen;
  72.       BYTE bRed;
  73.    } RGB;
  74.  
  75.    /* bitmap data used by GpiSetBitmapBits and others */
  76.    typedef struct _BITMAPINFO       /* bmi */
  77.    {
  78.       ULONG  cbFix;
  79.       USHORT cx;
  80.       USHORT cy;
  81.       USHORT cPlanes;
  82.       USHORT cBitCount;
  83.       RGB    argbColor[1];
  84.    } BITMAPINFO;
  85.    typedef BITMAPINFO *PBITMAPINFO;
  86.  
  87.    /* Constants for compression/decompression command */
  88.  
  89.    #define CBD_COMPRESSION     1L
  90.    #define CBD_DECOMPRESSION   2L
  91.    #define CBD_BITS            0L
  92.  
  93.    /* Flags for compression/decompression option */
  94.  
  95.    #define CBD_COLOR_CONVERSION    0x00000001L
  96.  
  97.    /* Compression scheme in the ulCompression field of the bitmapinfo structure */
  98.  
  99.    #define BCA_UNCOMP          0L
  100.    #define BCA_HUFFMAN1D       3L
  101.    #define BCA_RLE4            2L
  102.    #define BCA_RLE8            1L
  103.    #define BCA_RLE24           4L
  104.  
  105.    #define BRU_METRIC          0L
  106.  
  107.    #define BRA_BOTTOMUP        0L
  108.  
  109.    #define BRH_NOTHALFTONED    0L
  110.    #define BRH_ERRORDIFFUSION  1L
  111.    #define BRH_PANDA           2L
  112.    #define BRH_SUPERCIRCLE     3L
  113.  
  114.    #define BCE_PALETTE         (-1L)
  115.    #define BCE_RGB             0L
  116.  
  117.    typedef struct _BITMAPINFOHEADER2        /* bmp2  */
  118.    {
  119.       ULONG  cbFix;            /* Length of structure                    */
  120.       ULONG  cx;               /* Bit-map width in pels                  */
  121.       ULONG  cy;               /* Bit-map height in pels                 */
  122.       USHORT cPlanes;          /* Number of bit planes                   */
  123.       USHORT cBitCount;        /* Number of bits per pel within a plane  */
  124.       ULONG  ulCompression;    /* Compression scheme used to store the bitmap */
  125.       ULONG  cbImage;          /* Length of bit-map storage data in bytes*/
  126.       ULONG  cxResolution;     /* x resolution of target device          */
  127.       ULONG  cyResolution;     /* y resolution of target device          */
  128.       ULONG  cclrUsed;         /* Number of color indices used           */
  129.       ULONG  cclrImportant;    /* Number of important color indices      */
  130.       USHORT usUnits;          /* Units of measure                       */
  131.       USHORT usReserved;       /* Reserved                               */
  132.       USHORT usRecording;      /* Recording algorithm                    */
  133.       USHORT usRendering;      /* Halftoning algorithm                   */
  134.       ULONG  cSize1;           /* Size value 1                           */
  135.       ULONG  cSize2;           /* Size value 2                           */
  136.       ULONG  ulColorEncoding;  /* Color encoding                         */
  137.       ULONG  ulIdentifier;     /* Reserved for application use           */
  138.    } BITMAPINFOHEADER2;
  139.    typedef BITMAPINFOHEADER2 *PBITMAPINFOHEADER2;
  140.  
  141.    typedef struct _RGB2         /* rgb2 */
  142.    {
  143.       BYTE bBlue;              /* Blue component of the color definition */
  144.       BYTE bGreen;             /* Green component of the color definition*/
  145.       BYTE bRed;               /* Red component of the color definition  */
  146.       BYTE fcOptions;          /* Reserved, must be zero                 */
  147.    } RGB2;
  148.    typedef RGB2 *PRGB2;
  149.  
  150.    typedef struct _BITMAPINFO2      /* bmi2 */
  151.    {
  152.       ULONG  cbFix;            /* Length of fixed portion of structure   */
  153.       ULONG  cx;               /* Bit-map width in pels                  */
  154.       ULONG  cy;               /* Bit-map height in pels                 */
  155.       USHORT cPlanes;          /* Number of bit planes                   */
  156.       USHORT cBitCount;        /* Number of bits per pel within a plane  */
  157.       ULONG  ulCompression;    /* Compression scheme used to store the bitmap */
  158.       ULONG  cbImage;          /* Length of bit-map storage data in bytes*/
  159.       ULONG  cxResolution;     /* x resolution of target device          */
  160.       ULONG  cyResolution;     /* y resolution of target device          */
  161.       ULONG  cclrUsed;         /* Number of color indices used           */
  162.       ULONG  cclrImportant;    /* Number of important color indices      */
  163.       USHORT usUnits;          /* Units of measure                       */
  164.       USHORT usReserved;       /* Reserved                               */
  165.       USHORT usRecording;      /* Recording algorithm                    */
  166.       USHORT usRendering;      /* Halftoning algorithm                   */
  167.       ULONG  cSize1;           /* Size value 1                           */
  168.       ULONG  cSize2;           /* Size value 2                           */
  169.       ULONG  ulColorEncoding;  /* Color encoding                         */
  170.       ULONG  ulIdentifier;     /* Reserved for application use           */
  171.       RGB2   argbColor[1];     /* Color definition record                */
  172.    } BITMAPINFO2;
  173.    typedef BITMAPINFO2 *PBITMAPINFO2;
  174.  
  175.    typedef struct _BITMAPFILEHEADER    /* bfh */
  176.    {
  177.       USHORT    usType;
  178.       ULONG     cbSize;
  179.       SHORT     xHotspot;
  180.       SHORT     yHotspot;
  181.       ULONG     offBits;
  182.       BITMAPINFOHEADER bmp;
  183.    } BITMAPFILEHEADER;
  184.    typedef BITMAPFILEHEADER *PBITMAPFILEHEADER;
  185.  
  186.    typedef struct _BITMAPARRAYFILEHEADER       /* bafh */
  187.    {
  188.       USHORT    usType;
  189.       ULONG     cbSize;
  190.       ULONG     offNext;
  191.       USHORT    cxDisplay;
  192.       USHORT    cyDisplay;
  193.       BITMAPFILEHEADER bfh;
  194.    } BITMAPARRAYFILEHEADER;
  195.    typedef BITMAPARRAYFILEHEADER *PBITMAPARRAYFILEHEADER;
  196.  
  197.    typedef struct _BITMAPFILEHEADER2    /* bfh2 */
  198.    {
  199.       USHORT    usType;
  200.       ULONG     cbSize;
  201.       SHORT     xHotspot;
  202.       SHORT     yHotspot;
  203.       ULONG     offBits;
  204.       BITMAPINFOHEADER2 bmp2;
  205.    } BITMAPFILEHEADER2;
  206.    typedef BITMAPFILEHEADER2 *PBITMAPFILEHEADER2;
  207.  
  208.    typedef struct _BITMAPARRAYFILEHEADER2    /* bafh2 */
  209.    {
  210.       USHORT    usType;
  211.       ULONG     cbSize;
  212.       ULONG     offNext;
  213.       USHORT    cxDisplay;
  214.       USHORT    cyDisplay;
  215.       BITMAPFILEHEADER2 bfh2;
  216.    } BITMAPARRAYFILEHEADER2;
  217.    typedef BITMAPARRAYFILEHEADER2 *PBITMAPARRAYFILEHEADER2;
  218.  
  219.    /*************************************************************************
  220.    * These are the identifying values that go in the usType field of the
  221.    * BITMAPFILEHEADER(2) and BITMAPARRAYFILEHEADER(2).
  222.    * (BFT_ => Bit map File Type)
  223.    *************************************************************************/
  224.    #define BFT_ICON           0x4349   /* 'IC' */
  225.    #define BFT_BMAP           0x4d42   /* 'BM' */
  226.    #define BFT_POINTER        0x5450   /* 'PT' */
  227.    #define BFT_COLORICON      0x4943   /* 'CI' */
  228.    #define BFT_COLORPOINTER   0x5043   /* 'CP' */
  229.    #define BFT_BITMAPARRAY    0x4142   /* 'BA' */
  230.  
  231.    /* XLATOFF */
  232.    #pragma pack()         /* reset to default packing */
  233.    /* XLATON */
  234.  
  235.    /* XLATOFF */
  236. #endif /* PMBITMAP_INCLUDED */
  237. /* XLATON */
  238.  
  239. /* XLATOFF */
  240. #ifdef __cplusplus
  241.         }
  242. #endif
  243.    #pragma info( none )
  244.    #ifndef __CHKHDR__
  245.       #pragma info( restore )
  246.    #endif
  247.    #pragma info( restore )
  248. /* XLATON */
  249.  
  250. /**************************** end of file **********************************/
  251.