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