home *** CD-ROM | disk | FTP | other *** search
/ Big Green CD 8 / BGCD_8_Dev.iso / NEXTSTEP / Graphics / ToyViewer-2.6a / src / gif.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-01-28  |  1.7 KB  |  55 lines

  1. /*
  2.     gif.h
  3.  
  4.     gifheader.c, gifbmap.c, and gif.h are based on "giftoppm"
  5.     of David Koblas.
  6.     They are modified by T. Ogihara. (1996)
  7. */
  8.  
  9. /* +-------------------------------------------------------------------+ */
  10. /* | Copyright 1990, David Koblas.                                     | */
  11. /* |   Permission to use, copy, modify, and distribute this software   | */
  12. /* |   and its documentation for any purpose and without fee is hereby | */
  13. /* |   granted, provided that the above copyright notice appear in all | */
  14. /* |   copies and that both that copyright notice and this permission  | */
  15. /* |   notice appear in supporting documentation.  This software is    | */
  16. /* |   provided "as is" without express or implied warranty.           | */
  17. /* +-------------------------------------------------------------------+ */
  18.  
  19. #include  <stdio.h>
  20. #include  <libc.h>
  21. #include  <objc/objc.h>
  22. #include  "common.h"
  23.  
  24. #define INTERLACE        0x40
  25. #define LOCALCOLORMAP        0x80
  26. #define TRANSPARENCY        0x01
  27. #define BitSet(byte, bit)    (((byte) & (bit)) == (bit))
  28. #define    ReadOK(file,buffer,len)    (fread(buffer, len, 1, file) != 0)
  29.  
  30. typedef struct {
  31.     int        width;
  32.     int        height;
  33.     int        colors;
  34.     int        bits;        /* bits per sample */
  35.     int        transp;        /* Transparency Index */
  36.     unsigned short    Resolution;
  37.     unsigned short    Background;
  38.     unsigned short    AspectRatio;
  39.     BOOL        colormap;
  40.     BOOL        interlace;
  41.     BOOL        isgray;
  42.     char        ver[4];
  43.     paltype        palette[256];
  44.     unsigned char    *memo;
  45. } gifHeader;
  46.  
  47. gifHeader *loadGifHeader(FILE *fd, int *errcode);
  48. void freeGifHeader(gifHeader *gh);
  49. commonInfo *gifInfo(gifHeader *);
  50.  
  51. int gifGetImage(FILE *, gifHeader *, unsigned char **);
  52. int GetDataBlock(FILE *, unsigned char *);
  53. int initGifLZW(FILE *);
  54. int LWZReadByte(FILE *);
  55.