home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 351.lha / iff.library_v1.6 / ifflib.h < prev    next >
C/C++ Source or Header  |  1990-02-26  |  3KB  |  112 lines

  1. #ifndef IFFLIB_H
  2. #define IFFLIB_H 1
  3.  
  4. /* iff.library Copyright 1990
  5.  * Robert W. Albrecht
  6.  * 1457 Zion Way
  7.  * Ventura, CA 93003
  8.  */
  9.  
  10. /* masking */
  11. #define mskNone            0
  12. #define mskHasMask           1
  13. #define mskHasTransparentColor 2
  14. #define mskLasso           3
  15.  
  16. /* aspect */
  17. #define x320x200Aspect 10
  18. #define y320x200Aspect 11
  19. #define x320x400Aspect 20
  20. #define y320x400Aspect 11
  21. #define x640x200Aspect 5
  22. #define y640x200Aspect 11
  23. #define x640x400Aspect 10
  24. #define y640x400Aspect 11
  25.  
  26. /* compression */
  27. #define cmpNone     0
  28. #define cmpByteRun1 1
  29.  
  30. typedef struct
  31.    {
  32.    unsigned short w, h;       /* width, height */
  33.    unsigned short x, y;       /* position */
  34.    unsigned char nPlanes;     /* number of bit-planes */
  35.    unsigned char masking;     /* type of masking used */
  36.    unsigned char compression; /* type of compression used */
  37.    unsigned char pad1;
  38.    unsigned short transparentColor;
  39.    unsigned char xAspect, yAspect;     /* aspect ration */
  40.    unsigned short pageWidth, pageHeight; /* size of the screen */
  41.    unsigned long viewmodes;
  42.    } BitMapHeader;
  43.  
  44. /* error codes */
  45. #define NO_ERROR 0
  46. #define YOUR_ERROR 1
  47. #define OPEN_ERROR 2
  48. #define FILE_WAS_CLOSED 3
  49. #define SEEK_ERROR 4
  50. #define READ_ERROR 5
  51. #define MEMORY_ERROR 6
  52. #define IFFBAD_ERROR 7
  53. #define WIERD_MASKING 8
  54. #define WIERD_COMPRESSION 9
  55. #define COMPRESSION_ERROR 10
  56. #define IFF_TO_BIG 11
  57. #define WIERD_COLORTABLE 12
  58. #define WRITE_ERROR 13
  59. #define UNKNOWN_ERROR -1
  60.  
  61. /* library name */
  62. #define IFFNAME "iff.library"
  63.  
  64. /* library version */
  65. #define IFFVERSION 1L
  66.  
  67. /* memory types */
  68. #define DONTCARE ((unsigned short)0)
  69. #define CHIP ((unsigned short)1)
  70. #define FAST ((unsigned short)2)
  71.  
  72. #define ALLOC ((unsigned short)1)
  73. #define NOALLOC ((unsigned short)0)
  74.  
  75. /* set this if you want to get the
  76.  * ViewModes from the IFF picture
  77.  * using QueryIFF. */
  78. #define GETVIEWMODES -1000000L
  79.  
  80. /* functions */
  81. #ifdef AZTEC_C
  82. #if VERSION == 500
  83. /* AZTEC C 5.00 and above, (should always work) */
  84. extern void *IFFalloc(long,unsigned short);
  85. extern void IFFfree(void *);
  86. extern void RlsBitMap(struct BitMap *);
  87. extern void RlsImage(struct Image *);
  88. extern short QueryIFF(char *,BitMapHeader *);
  89. extern short GetIFF_bitmap(char *,struct BitMap **,UWORD **, UWORD *,UWORD);
  90. extern short GetIFF_image(char *,struct Image **,UWORD **, UWORD *,UWORD);
  91. /* The Put functions are only available to registered users */
  92. extern short PutIFF(char *,struct BitMap *,
  93.          struct ViewPort *,struct ColorMap *);
  94. extern short PutIFF_screen(char *,struct Screen *);
  95. extern short PutIFF_window(char *,struct Window *);
  96. #else
  97. /* AZTEC C 3.6 and below (must use 16 bit ints!) */
  98. extern void *IFFalloc(), IFFfree(), RlsImage(), RlsBitMap();
  99. extern short QueryIFF(), GetIFF_bitmap(), GetIFF_image();
  100. extern short PutIFF(), PutIFF_screen(), PutIFF_window();
  101. #endif
  102.  
  103. #else
  104. /* Some other compiler (must pass 16 bit ints on the stack)
  105.  * and not use registerized parameters).  */
  106. extern void *IFFalloc(), IFFfree(), RlsImage(), RlsBitMap();
  107. extern short QueryIFF(), GetIFF_bitmap(), GetIFF_image();
  108. extern short PutIFF(), PutIFF_screen(), PutIFF_window();
  109. #endif
  110.  
  111. #endif
  112.