home *** CD-ROM | disk | FTP | other *** search
/ Graphics 16,000 / graphics-16000.iso / msdos / fractal / fdesi313 / fdes13s / fdesgif.h < prev    next >
Text File  |  1990-01-22  |  2KB  |  80 lines

  1. /* GIF.H
  2. **
  3. ** Header file for public domain GIF encoding and decoding routines
  4. ** by Bert Tyler and Lee Daniel Crocker.
  5. */
  6.  
  7. /* The following typedefs must be changed to reflect the unsigned and
  8. ** signed 8, 16, and 32-bit integer types of whichever compiler you are
  9. ** using.  Those below will work on most 8086 compilers.
  10. */
  11. #define M_I86 1
  12. #define MSDOS 1
  13.  
  14. typedef unsigned char   U8;
  15. typedef signed char     S8;
  16. typedef unsigned short  U16;
  17. typedef signed short    S16;
  18. typedef unsigned long   U32;
  19. typedef signed long     S32;
  20.  
  21. /**************************************
  22. ** The definitions below must be changed to reflect the byte ordering of
  23. ** target processor.  8086, 6502, VAX, and similar machines will use the
  24. ** first set; 6800, 68000, and others use the second set.
  25. */
  26.  
  27. #ifdef M_I86    /* Microsoft C for 8086 defines this */
  28. #   define LOBYTE(w)    (*((U8*)&(w)))
  29. #   define HIBYTE(w)    (*((U8*)&(w)+1))
  30. #   define LOWORD(d)    (*((U16*)&(d)))
  31. #   define HIWORD(d)    (*((U16*)&(d)+1))
  32. #   define PUT16(c,w)   (*((U16*)&(c))=(w))
  33. #   define GET16(c,w)   ((w)=*((U16*)&(c)))
  34. #else   /* For Macintosh, Amiga, ATARI, and others */
  35. #   define LOBYTE(w)    (*((U8*)&(w)+1))
  36. #   define HIBYTE(w)    (*((U8*)&(w)))
  37. #   define LOWORD(d)    (*((U16*)&(d)+1))
  38. #   define HIWORD(d)    (*((U16*)&(d)))
  39. #   define PUT16(c,w)   (c)=LOBYTE(w),*((char*)(&(c)+1))=HIBYTE(w)
  40. #   define GET16(c,w)   LOBYTE(w)=(c),HIBYTE(w)=*((char*)(&(c)+1))
  41. #endif
  42.  
  43. /**************************************
  44. ** NOTE: get_pixel() can be defined as a macro for extra speed if needed,
  45. ** or declared external here and defined in some module of the program.
  46. ** This function will be called to retrieve values of points in GIF storage
  47. ** order; i.e., in strict left-to-right, top-down order for non-interlaced
  48. ** images and left-to-right, interlaced for interlaced ones.
  49. */
  50.  
  51. #if 1       /* Let's not define a macro this time */
  52.  
  53. #define get_pixel(x,y) getpixel(x,y)
  54.  
  55. #else
  56.  
  57. int get_pixel(int, int);
  58.  
  59. #endif
  60.  
  61. /**************************************
  62. ** Fix MSDOS Text mode file open "feature".
  63. */
  64.  
  65. #ifdef MSDOS
  66. #   define READMODE "rb"
  67. #   define WRITEMODE "wb"
  68. #else
  69. #   define READMODE "r"
  70. #   define WRITEMODE "w"
  71. #endif
  72.  
  73. /**************************************
  74. ** GIF encoder interface routines:
  75. */
  76.  
  77. int create_gif(int, int, int, U8 *, int, char *);
  78. int put_image(int, int, int, int, int, int, U8 *);
  79. int close_gif(void);
  80.