home *** CD-ROM | disk | FTP | other *** search
-
- #include <stdio.h>
- #include <ctype.h>
- #include <math.h>
- #ifdef vms
- #define pclose(file) (FILE *) exit(1)
- #define popen(command,mode) (FILE *) exit(1)
- #else
- #include <malloc.h>
- #include <memory.h>
-
- extern long
- strtol(),
- time();
- #endif
- /*
- Define declarations for the Display program.
- */
- #ifndef False
- #define False 0
- #endif
- #define Intensity(color) \
- (((color).red*77+(color).green*150+(color).blue*29) >> 8)
- #define Max(x,y) (((x) > (y)) ? (x) : (y))
- #define MaxColormapSize 4096
- #define MaxImageSize (4096*4096)
- #define MaxRgb 255
- #define MaxRunlength 255
- #define Min(x,y) (((x) < (y)) ? (x) : (y))
- #ifndef True
- #define True 1
- #endif
- /*
- Image Id's
- */
- #define UnknownId 0
- #define ImageMagickId 1
- /*
- Image classes:
- */
- #define UnknownClass 0
- #define DirectClass 1
- #define PseudoClass 2
- /*
- Image compression algorithms:
- */
- #define UnknownCompression 0
- #define NoCompression 1
- #define RunlengthEncodedCompression 2
- #define QEncodedCompression 3
-
- /*
- Typedef declarations for the Display program.
- */
- typedef struct _ColorPacket
- {
- unsigned char
- red,
- green,
- blue;
-
- unsigned short
- index;
- } ColorPacket;
-
- typedef struct _RunlengthPacket
- {
- unsigned char
- red,
- green,
- blue,
- length;
-
- unsigned short
- index;
- } RunlengthPacket;
-
- typedef struct _Image
- {
- FILE
- *file;
-
- char
- filename[256];
-
- unsigned int
- id,
- class,
- colors,
- packets,
- compression,
- columns,
- rows,
- scene,
- channel;
-
- char
- *comments;
-
- ColorPacket
- *colormap;
-
- RunlengthPacket
- *pixels;
-
- unsigned int
- runlength;
- } Image;
- /*
- Variable declarations.
- */
- char
- *application_name;
-