home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ool_main.zip / ool / include / oolglib.h < prev    next >
Text File  |  1998-03-15  |  12KB  |  414 lines

  1. #pragma pack (1)
  2.  
  3. #ifndef __OOLGLIB__
  4. #define __OOLGLIB__
  5.  
  6. /*===========================================================================*/
  7. /* OOL ------------------- the Open Object Library ------------------- r 1.0 */
  8. /*===========================================================================*/
  9. /*                            library: OOLGLIB                               */
  10. /*                        last update: 3/98                                  */
  11. /*                      programmed by: Mathias Hasselmann                    */
  12. /*                                     mhasselm@arco.met.fu-berlin.de        */
  13. /*===========================================================================*/
  14.  
  15. #ifndef _export_
  16. #ifdef __IBMCPP__                        //required export definition _Export
  17.   #define _export_
  18. #elif defined( __WATCOMC__ )
  19.   #define _export_ __export
  20. #else
  21.   #define _export_
  22. #endif
  23. #endif
  24.  
  25. #define  SCANLINEBYTES(w, bpp) (((w * bpp + 31) >> 5) << 2)
  26. #define  PALETTESIZE(bpp) (24 == bpp ? 0 : (1 << bpp))
  27. #define  DATAOFFSET(bpp) (sizeof (BITMAPINFOHEADER2) + \
  28.             PALETTESIZE (bpp) * sizeof (RGB2))
  29.  
  30. #define  returnUL(v) return (ULONG)   BitmapFilterError ((ULONG) (v), __FILE__, __LINE__, (XBitmapFilter*) param)
  31. #define  returnMR(v) return (MRESULT) BitmapFilterError ((ULONG) (v), __FILE__, __LINE__, (XBitmapFilter*) param)
  32. #define  returnExtUL(v, v1, v2) return (ULONG)   BitmapFilterExtError ((ULONG) (v), __FILE__, __LINE__, (XBitmapFilter*) param, (ULONG) v1, (ULONG) v2)
  33. #define  returnExtMR(v, v1, v2) return (MRESULT) BitmapFilterExtError ((ULONG) (v), __FILE__, __LINE__, (XBitmapFilter*) param, (ULONG) v1, (ULONG) v2)
  34.  
  35. #define  BFE_OK                      0x00000000
  36. #define  BFE_OOLGLIB                 0x10000000
  37. #define  BFE_ZERO_FILENAME           BFE_OOLGLIB | 0x00000001
  38. #define  BFE_ZERO_PROFILE            BFE_OOLGLIB | 0x00000002
  39. #define  BFE_ZERO_PARARAMETER        BFE_OOLGLIB | 0x00000003
  40. #define  BFE_INVALID_CBFIX           BFE_OOLGLIB | 0x00000004
  41. #define  BFE_INVALID_PALETTE         BFE_OOLGLIB | 0x00000005
  42. #define  BFE_INVALID_DITHERING       BFE_OOLGLIB | 0x00000006
  43. #define  BFE_INVALID_INVERSION       BFE_OOLGLIB | 0x00000007
  44. #define  BFE_INVALID_BITMAP_VERSION  BFE_OOLGLIB | 0x00000008
  45. #define  BFE_INVALID_COLOR_INDEX     BFE_OOLGLIB | 0x00000009
  46. #define  BFE_INVALID_SHADE           BFE_OOLGLIB | 0x0000000a
  47. #define  BFE_INVALID_QUALITY         BFE_OOLGLIB | 0x0000000b
  48. #define  BFE_INVALID_EXTENSION       BFE_OOLGLIB | 0x0000000c
  49. #define  BFE_INVALID_DIRECTION       BFE_OOLGLIB | 0x0000000d
  50. #define  BFE_MAPPING_ERROR           BFE_OOLGLIB | 0x0000000e
  51. #define  BFE_GBM                     0x20000000
  52. #define  BFE_OS2                     0x30000000
  53. #define  BFE_MEMORY                  0x40000000
  54.  
  55. #define  BFT_Bitmap                    0
  56. #define  BFT_GEM                       1
  57. #define  BFT_GIF                       2
  58. #define  BFT_Greymap                   3
  59. #define  BFT_IAX                       4
  60. #define  BFT_ILBM                      5
  61. #define  BFT_JPEG                      6
  62. #define  BFT_KIPS                      7
  63. #define  BFT_PCX                       8
  64. #define  BFT_Pixmap                    9
  65. #define  BFT_Portrait                 10
  66. #define  BFT_PSeg                     11
  67. #define  BFT_Sprite                   12
  68. #define  BFT_Targa                    13
  69. #define  BFT_TIFF                     14
  70. #define  BFT_XBitmap                  15
  71. #define  BFT_YUV12C                   16
  72. #define  BFT_COUNT                    17
  73.  
  74. #define  BFF_PROCESS_1BPP              1
  75. #define  BFF_PROCESS_4BPP              2
  76. #define  BFF_PROCESS_8BPP              4
  77. #define  BFF_PROCESS_24BPP             8
  78. #define  BFF_PROCESS_16BPP            16
  79. #define  BFF_PROCESS_32BPP            32
  80. #define  BFF_PROCESS_ALL              63
  81.  
  82. #define  BFP_BPP_DONT_TOUCH            0
  83. #define  BFP_BPP_MONOCHROME            1
  84. #define  BFP_BPP_EGA                   4
  85. #define  BFP_BPP_VGA                   8
  86. #define  BFP_BPP_HIGHCOLOR            16
  87. #define  BFP_BPP_TRUECOLOR            24
  88. #define  BFP_BPP_DIRECTCOLOR          32
  89.  
  90. #define  BFP_DITHERING_NONE            1
  91. #define  BFP_DITHERING_ERRORDIFFUSION  2
  92. #define  BFP_DITHERING_SMALL_HALFTONE  4
  93. #define  BFP_DITHERING_LARGE_HALFTONE  8
  94. #define  BFP_DITHERING_OPTIMIZED      16
  95. #define  BFP_DITHERING_MEDIANCUT      32
  96. #define  BFP_DITHERING_COUNT           6
  97.  
  98. #define  BFP_PALETTE_DEFAULT           1
  99. #define  BFP_PALETTE_GREYSCALE         2
  100. #define  BFP_PALETTE_1BIT_2_COLORS     4
  101. #define  BFP_PALETTE_4BIT_8_COLORS     8
  102. #define  BFP_PALETTE_4BIT_16_COLORS   16
  103. #define  BFP_PALETTE_8BIT_666         32
  104. #define  BFP_PALETTE_8BIT_784         64
  105. #define  BFP_PALETTE_16BIT_555       128
  106. #define  BFP_PALETTE_16BIT_565       256
  107. #define  BFP_PALETTE_TRUECOLORS      512
  108. #define  BFP_PALETTE_REDSCALE       1024
  109. #define  BFP_PALETTE_GREENSCALE     2048
  110. #define  BFP_PALETTE_BLUESCALE      4096
  111. #define  BFP_PALETTE_COUNT            12
  112.  
  113. #define  BFP_BITMAP_OS2_11            11
  114. #define  BFP_BITMAP_OS2_20            20
  115. #define  BFP_BITMAP_WINDOWS           BFP_BITMAP_OS2_20
  116.  
  117. #define  BFP_BITMAP_INVERSE_NOTHING    0
  118. #define  BFP_BITMAP_INVERSE_PALETTE    1
  119. #define  BFP_BITMAP_INVERSE_BITMAP     2
  120. #define  BFP_BITMAP_FORCE_DARKFG       3
  121. #define  BFP_BITMAP_FORCE_LIGHTFG      4
  122.  
  123. #define  BFP_GIF_TRANSCOLOR_NONE         -2
  124. #define  BFP_GIF_TRANSCOLOR_EDGE         -1
  125.  
  126. #define  BFP_GREYMAP_GREY_SHADE       'k'
  127. #define  BFP_GREYMAP_RED_SHADE        'r'
  128. #define  BFP_GREYMAP_GREEN_SHADE      'g'
  129. #define  BFP_GREYMAP_BLUE_SHADE       'b'
  130.  
  131. #define  BFP_IAX_GREY_SHADE           'k'
  132. #define  BFP_IAX_RED_SHADE            'r'
  133. #define  BFP_IAX_GREEN_SHADE          'g'
  134. #define  BFP_IAX_BLUE_SHADE           'b'
  135.  
  136. #define  BFP_KIPS_PAL_EXTENSION        0
  137. #define  BFP_KIPS_KPL_EXTENSION        1
  138.  
  139. #define  BFP_TARGA_START_AT_BOTTOM        1
  140. #define  BFP_TARGA_START_AT_TOP           2
  141.  
  142. #define  BFP_TIFF_KEEP_SPACES         ' '
  143. #define  BFP_TIFF_ARTIST               0
  144. #define  BFP_TIFF_SOFTWARE             1
  145. /* #define  BFP_TIFF_MAKE                 2 */
  146. #define  BFP_TIFF_MODEL                2
  147. #define  BFP_TIFF_HOST                 3
  148. #define  BFP_TIFF_DOCNAME              4
  149. #define  BFP_TIFF_PAGENAME             5
  150. #define  BFP_TIFF_DESCRIPTION          6
  151. #define  BFP_TIFF_TAGCOUNT             7
  152.  
  153. #define  BFP_ILBM_TRANSCOLOR_NONE     -2
  154. #define  BFP_ILBM_TRANSCOLOR_EDGE      -1
  155.  
  156. typedef struct _XBitmapFilterProfile {
  157.    ULONG   cbFix;
  158.    
  159.    int     gbmFileType  [BFT_COUNT];
  160.    PSZ     pszExtension [BFT_COUNT + 1];
  161.    PSZ     pszName      [BFT_COUNT + 1];
  162.    UCHAR   readingModes [BFT_COUNT];
  163.    UCHAR   writingModes [BFT_COUNT];
  164.    USHORT  languageBase;
  165.    ULONG   maxFilterSize;
  166. } XBitmapFilterProfile;
  167.  
  168. #define XBitmapFilterPrefix \
  169.    ULONG   cbFix; \
  170.    HPS     hps; \
  171.    HBITMAP hbm; \
  172.    HAB     hab; \
  173.    UCHAR   cFilterID; \
  174.    UCHAR   cBitCount; \
  175.    UCHAR   cDithering; \
  176.    USHORT  cPalette; \
  177.    USHORT  cClrEntries; \
  178.    BYTE    cRedBits; \
  179.    BYTE    cGreenBits; \
  180.    BYTE    cBlueBits; \
  181.    SHORT   command; \
  182.    ULONG   errorCode; \
  183.    char*   errorFile; \
  184.    ULONG   errorLine; \
  185.    BOOL    errorExtInfo; \
  186.    ULONG   errorVal1; \
  187.    ULONG   errorVal2;
  188.  
  189.  
  190. typedef struct _XBitmapFilter {
  191.    XBitmapFilterPrefix
  192. } XBitmapFilter;
  193.  
  194. typedef struct _XBitmapFilterPageParameter {
  195.    XBitmapFilter*        fltParam;
  196.    XBitmapFilterProfile* profile;
  197.    HMODULE               hmod;
  198.    HWND                  hwndDialog;
  199.    HWND                  hwndNoteBook;
  200.    ULONG                 pageID [2];
  201.    PSZ                   filename;
  202.    BOOL                  fImport;
  203.  
  204.    BOOL                  modifyColors;
  205.    UCHAR                 bppID;
  206.    USHORT                paletteID [6];
  207.    UCHAR                 ditheringID [6];
  208.    LONG                  entryCount [6];
  209. } XBitmapFilterPageParameter;
  210.  
  211. typedef struct _XBitmapImportFilter {
  212.    XBitmapFilterPrefix
  213.  
  214.    USHORT  uIndex;
  215.    UCHAR   cInversionMode;
  216. } XBitmapImportFilter;
  217.  
  218. typedef struct _XBitmapExportFilter {
  219.    XBitmapFilterPrefix
  220.  
  221.    UCHAR   cVersion;
  222.    UCHAR   cInversionMode;
  223. } XBitmapExportFilter;
  224.  
  225. typedef struct _XGEMImportFilter {
  226.    XBitmapFilterPrefix
  227. } XGEMImportFilter;
  228.  
  229. typedef struct _XGEMExportFilter {
  230.    XBitmapFilterPrefix
  231.  
  232.    ULONG   fGreyscaled;
  233.    ULONG   fWritePalette;
  234.    USHORT  uPixelWidth;
  235.    USHORT  uPixelHeight;
  236. } XGEMExportFilter;
  237.  
  238. typedef struct _XGIFImportFilter {
  239.    XBitmapFilterPrefix
  240.                         
  241.    USHORT  uIndex;
  242.    ULONG   fIgnoreErrors;
  243. } XGIFImportFilter;
  244.  
  245. typedef struct _XGIFExportFilter {
  246.    XBitmapFilterPrefix
  247.  
  248.    ULONG   fInterlaced;
  249.    SHORT   cTransColor;
  250.    UCHAR   cBackColor;
  251.    ULONG   ulPosX;
  252.    ULONG   ulPosY;
  253.    ULONG   ulScreenWidth;
  254.    ULONG   ulScreenHeight;
  255. } XGIFExportFilter;
  256.  
  257. typedef struct _XGreymapImportFilter {
  258.    XBitmapFilterPrefix
  259.       
  260.    UCHAR   cShadingType;
  261. } XGreymapImportFilter;
  262.  
  263. typedef struct _XGreymapExportFilter {
  264.    XBitmapFilterPrefix
  265. } XGreymapExportFilter;
  266.  
  267. typedef struct _XIAXImportFilter {
  268.    XBitmapFilterPrefix
  269.       
  270.    UCHAR   cShadingType;
  271.    ULONG   ulWidth;
  272. } XIAXImportFilter;
  273.  
  274. typedef struct _XIAXExportFilter {
  275.    XBitmapFilterPrefix
  276. } XIAXExportFilter;
  277.  
  278. typedef struct _XILBMImportFilter {
  279.    XBitmapFilterPrefix
  280. } XILBMImportFilter;
  281.  
  282. typedef struct _XILBMExportFilter {
  283.    XBitmapFilterPrefix
  284.  
  285.    SHORT   cTransColor;
  286.    ULONG   fHAM6;
  287.    ULONG   ulPosX;
  288.    ULONG   ulPosY;
  289.    ULONG   ulScreenWidth;
  290.    ULONG   ulScreenHeight;
  291.    USHORT  uXAspect;
  292.    USHORT  uYAspect;
  293. } XILBMExportFilter;
  294.  
  295. typedef struct _XJPEGImportFilter {
  296.    XBitmapFilterPrefix
  297. } XJPEGImportFilter;
  298.  
  299. typedef struct _XJPEGExportFilter {
  300.    XBitmapFilterPrefix
  301.  
  302.    UCHAR   cQuality;
  303.    ULONG   fProgressive;
  304. } XJPEGExportFilter;
  305.  
  306. typedef struct _XKIPSImportFilter {
  307.    XBitmapFilterPrefix
  308.       
  309.    UCHAR   cPaletteFileExtension;
  310. } XKIPSImportFilter;
  311.  
  312. typedef struct _XKIPSExportFilter {
  313.    XBitmapFilterPrefix
  314.       
  315.    UCHAR   cPaletteFileExtension;
  316. } XKIPSExportFilter;
  317.  
  318. typedef struct _XPCXImportFilter {
  319.    XBitmapFilterPrefix
  320.                         
  321.    ULONG   fFixLines;
  322. } XPCXImportFilter;
  323.  
  324. typedef struct _XPCXExportFilter {
  325.    XBitmapFilterPrefix
  326. } XPCXExportFilter;
  327.  
  328. typedef struct _XPixmapImportFilter {
  329.    XBitmapFilterPrefix
  330. } XPixmapImportFilter;
  331.  
  332. typedef struct _XPixmapExportFilter {
  333.    XBitmapFilterPrefix
  334. } XPixmapExportFilter;
  335.  
  336. typedef struct _XPortraitImportFilter {
  337.    XBitmapFilterPrefix
  338. } XPortraitImportFilter;
  339.  
  340. typedef struct _XPortraitExportFilter {
  341.    XBitmapFilterPrefix
  342. } XPortraitExportFilter;
  343.  
  344. typedef struct _XPSegImportFilter {
  345.    XBitmapFilterPrefix
  346.          
  347.    ULONG   fFixRecords;
  348. } XPSegImportFilter;
  349.  
  350. typedef struct _XPSegExportFilter {
  351.    XBitmapFilterPrefix
  352.         
  353.    ULONG   fDoubleSized;
  354. } XPSegExportFilter;
  355.  
  356. typedef struct _XSpriteImportFilter {
  357.    XBitmapFilterPrefix
  358.                                        
  359.    USHORT  uIndex;
  360. } XSpriteImportFilter;
  361.  
  362. typedef struct _XSpriteExportFilter {
  363.    XBitmapFilterPrefix
  364. } XSpriteExportFilter;
  365.  
  366. typedef struct _XTargaImportFilter {
  367.    XBitmapFilterPrefix
  368. } XTargaImportFilter;
  369.  
  370. typedef struct _XTargaExportFilter {
  371.    XBitmapFilterPrefix
  372.  
  373.    UCHAR   cDirection;
  374. } XTargaExportFilter;
  375.  
  376. typedef struct _XTIFFImportFilter {
  377.    XBitmapFilterPrefix
  378.                                        
  379.    USHORT  uIndex;
  380. } XTIFFImportFilter;
  381.  
  382. typedef struct _XTIFFExportFilter {
  383.    XBitmapFilterPrefix
  384.          
  385.    ULONG   fLZW;
  386.    ULONG   fMonoPal;
  387. /* Use functions based on malloc/free to allocate the tags */
  388.    PSZ     pszTagValue [BFP_TIFF_TAGCOUNT];
  389. } XTIFFExportFilter;
  390.  
  391. typedef struct _XXBitmapImportFilter {
  392.    XBitmapFilterPrefix
  393. } XXBitmapImportFilter;
  394.  
  395. typedef struct _XXBitmapExportFilter {
  396.    XBitmapFilterPrefix
  397. } XXBitmapExportFilter;
  398.  
  399. typedef struct _XYUV12CImportFilter {
  400.    XBitmapFilterPrefix
  401. } XYUV12CImportFilter;
  402.  
  403. typedef struct _XYUV12CExportFilter {
  404.    XBitmapFilterPrefix
  405.  
  406.    ULONG   ulPosX;
  407.    ULONG   ulPosY;
  408. } XYUV12CExportFilter;
  409.  
  410. #endif
  411.  
  412. #pragma pack (4)
  413.  
  414.