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