home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ddkx86v1.zip / DDKX86 / IBMH / PMBITMAP.H < prev    next >
Text File  |  1995-04-14  |  10KB  |  259 lines

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