/*
    TIFF format definition
*/

#define ID_VERSION 0x2A4949 

/* field type */
#define ByteType 1
#define AsciiType 2
#define ShortType 3
#define LongType 4
#define RationalType 5

/* tags */
#define GeneralDescription 0xFF
#define ImageWidth 0x100
#define ImageLength 0x101
#define BitsPerSample 0x102
#define Compression 0x103
#define PhotometricInterpretation 0x106
#define FillOrder 0x10A
#define StripOffset 0x111
#define Orientation 0x112
#define SamplesPerPixel 0x115
#define MinSampleValue 0x118
#define MaxSampleValue 0x119
#define XResolution 0x11A
#define YResolution 0x11B
#define PlanarConfigration 0x11c
#define ColorResponseUnit 0x12C
#define ColorResponseCurves 0x12D


/* structure of IFD field */
typedef struct {
	short tag ;
	short type ;
	long  count ;
	long  value ;
} IFD_E ;

typedef IFD (IFD_E *) ;

/*  for towns */
#define TIFF_16 1
#define TIFF_32K 2
#define TIFF_256 3

/* tiff library error code */
#define TIF_ERR_FR 1 /* file read error */
#define TIF_ERR_FW 2 /* file write error */
#define TIF_ERR_ID 3 /* file ID error */
#define TIF_ERR_MEM 4 /* memory allocate error */

#ifndef TIFF
/* global variables */
extern short tiff_IFDsize ;
extern long tiff_width ;
extern long tiff_length  ;
extern long tiff_bpp ;
extern long tiff_fill ;
extern long tiff_maxv  ;
extern long tiff_iofs ;
extern long tiff_xrofs ;
extern long tiff_yrofs ;
extern long tiff_err ;
#endif
