/* tiff_io.h */ #define II 1 #define MM 2 #define BYTE 1 #define ASCII 2 #define SHORT 3 #define LONG 4 #define RATIONAL 5 /* Header structure: */ typedef struct { short int byte_order; short int version; long int ifd_offset; } TIFF_HEADER; /* Pointer structure: */ typedef struct { short int tag; short int type; long int length; long int voff; } TIFF_POINTER; /* File information structure: */ typedef struct { long int iimm; long int subfile_flags; long int photo_interp; long int planar_config; short int bits_sample[3]; short int sample_pixel; long int rows_strip; long int strip_cnt_length; long int strip_cnt_offset; long int strip_off_length; long int strip_off_offset; } TIFF_DATA; /******************************************************************************/ /* Function prototypes. */ /******************************************************************************/ short int ii2mms ( short int input ); long int ii2mml ( long int input ); unsigned char *make_tag ( short int tag, short int type, long int lng, long int fld, unsigned char *b, char *cnt ); int read_tiff_data ( FILE *fp, long int xs, long int ys, long int pl, TIFF_DATA td, unsigned char *r, unsigned char *g, unsigned char *b ); int read_tiff_header ( FILE *fp, long int *xs, long int *ys, long int *pl, TIFF_DATA *td ); void strip_read ( FILE *fp, long int im, long int xs, long int pl, long int sco, long int scf, long int soo, long int sof, unsigned char *line, unsigned char *r, unsigned char *g, unsigned char *b, long int *lng ); void write_tiff_data ( FILE *fp, long int xs, long int ys, long int pl, unsigned char *r, unsigned char *g, unsigned char *b ); void write_tiff_header ( FILE *fp, long int xs, long int ys, long int pl );