home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 1 / crawlyvol1.bin / program / grfx_snd / tifflib / source / tiffio.h < prev    next >
C/C++ Source or Header  |  1993-01-17  |  23KB  |  503 lines

  1. #ifndef __TIFFIO_H__
  2. #define __TIFFIO_H__
  3. /*
  4.  * Copyright (c) 1988, 1990 by Sam Leffler.
  5.  * All rights reserved.
  6.  *
  7.  * This file is provided for unrestricted use provided that this legend is included on all tape media and as a part of the
  8.  * software program in whole or part.  Users may copy, modify or distribute this file at will.
  9.  *
  10.  * Tag Image File Format (TIFF)
  11.  *
  12.  * Based on Rev 5.0 from:
  13.  *    Developer's Desk          Window Marketing Group
  14.  *    Aldus Corporation         Microsoft Corporation
  15.  *    411 First Ave. South      16011 NE 36th Way
  16.  *    Suite 200                 Box 97017
  17.  *    Seattle, WA  98104        Redmond, WA  98073-9717
  18.  *    206-622-5500              206-882-8080
  19.  *
  20.  * TIFF I/O Library Definitions.
  21.  */
  22.  
  23. /****************************************************************************
  24.  * @(#)TIFF/tiffcompat.h 1.09, Copyright (c) Sam Leffler, Dieter Linde, Nov 15 1990
  25.  */
  26. #include <stdio.h>
  27. #include <string.h>
  28. #include <tos.h>
  29.  
  30. #define    NEXT_SUPPORT
  31. #define    PICIO_SUPPORT
  32. #define    SGI_SUPPORT
  33. #define    THUNDER_SUPPORT
  34.  
  35. #define L_SET      SEEK_SET
  36. #define L_INCR  SEEK_CUR
  37. #define L_XTND  SEEK_END
  38.  
  39. #define bzero(dst, len)            memset(dst, 0, len)
  40. #define bcopy(src, dst, len)       memcpy(dst, src, len)
  41. #define bcmp(src, dst, len)     memcmp(dst, src, len)
  42.  
  43. typedef unsigned char    u_char;
  44. typedef unsigned short     u_short;
  45. typedef unsigned int     u_int;
  46. typedef unsigned long     u_long;
  47.  
  48. /*
  49.  * Return an open file descriptor or -1.
  50.  */
  51. /*#define TIFFOpenFile(name, mode, prot)    Fopen(name, mode, prot)*/
  52. #define TIFFOpenFile(name, mode, prot)  open(name, mode, prot)
  53.  
  54. #ifndef L_SET
  55. #define L_SET      0
  56. #define L_INCR  1
  57. #define L_XTND  2
  58. #endif
  59. /*
  60. #define ReadOK(fd, buf, size)   (Fread(fd, (long)size, (char *)buf) == (long)size)
  61. #define SeekOK(fd, off)     (Fseek((long)off, fd, L_SET) == (long)off)
  62. #define WriteOK(fd, buf, size)  (Fwrite(fd, (long)size, (char *)buf) == (long)size)
  63. */
  64. #ifndef ReadOK
  65. #define ReadOK(fd, buf, size)   (read(fd, (char *)buf, (size_t)size) == (size_t)size)
  66. #endif
  67. #ifndef SeekOK
  68. #define SeekOK(fd, off)     (lseek(fd, (long)off, L_SET) == (long)off)
  69. #endif
  70. #ifndef WriteOK
  71. #define WriteOK(fd, buf, size)  (write(fd, (char *)buf, (size_t)size) == (size_t)size)
  72. #endif
  73.  
  74. /*
  75.  * dblparam_t is the type that a double precision floating point value will have on the parameter
  76.  * stack (when coerced by the compiler).
  77.  */
  78. #ifdef applec
  79. typedef extended    dblparam_t;
  80. #else
  81. typedef double        dblparam_t;
  82. #endif
  83.  
  84. /****************************************************************************
  85.  * @(#)TIFF/tiff.h 1.19, Copyright (c) Sam Leffler, Dieter Linde, Oct 8 1990
  86.  */
  87. #define TIFF_VERSION        42
  88. #define TIFF_BIGENDIAN          0x4d4d
  89. #define TIFF_LITTLEENDIAN       0x4949
  90.  
  91. typedef struct {
  92.         u_short    tiff_magic;     /* magic number (defines byte order) */
  93.         u_short tiff_version;   /* TIFF version number */
  94.         u_long  tiff_diroff;    /* byte offset to first directory */
  95. } TIFFHeader;
  96.  
  97. /*
  98.  * TIFF Image File Directories are comprised of a table of field descriptors of the form shown
  99.  * below.  The table is sorted in ascending order by tag.  The values associated with each entry
  100.  * are disjoint and may appear anywhere in the file (so long as they are placed on a word boundary).
  101.  *
  102.  * If the value is 4 bytes or less, then it is placed in the offset field to save space.  If the value
  103.  * is less than 4 bytes, it is left-justified in the offset field.
  104.  */
  105. typedef struct {
  106.         u_short    tdir_tag;       /* see below */
  107.         u_short tdir_type;      /* data type; see below */
  108.         u_long  tdir_count;     /* number of items; length in spec */
  109.         u_long  tdir_offset;       /* byte offset to field data */
  110. } TIFFDirEntry;
  111.  
  112. typedef enum {
  113.         TIFF_BYTE = 1,          /* 8-bit unsigned integer */
  114.         TIFF_ASCII = 2,         /* 8-bit bytes w/ last byte null */
  115.         TIFF_SHORT = 3,         /* 16-bit unsigned integer */
  116.         TIFF_LONG = 4,          /* 32-bit unsigned integer */
  117.         TIFF_RATIONAL = 5       /* 64-bit fractional (numerator+denominator) */
  118. } TIFFDataType;
  119.  
  120. /*
  121.  * TIFF Tag Definitions.
  122.  *
  123.  * Those marked with a + are obsoleted by revision 5.0
  124.  */
  125. #define TIFFTAG_SUBFILETYPE             254     /* subfile data descriptor */
  126. #define     FILETYPE_REDUCEDIMAGE       0x1     /* reduced resolution version */
  127. #define     FILETYPE_PAGE               0x2     /* one page of many */
  128. #define     FILETYPE_MASK               0x4     /* transparency mask */
  129. #define TIFFTAG_OSUBFILETYPE            255     /* +kind of data in subfile */
  130. #define     OFILETYPE_IMAGE             1       /* full resolution image data */
  131. #define     OFILETYPE_REDUCEDIMAGE      2       /* reduced size image data */
  132. #define     OFILETYPE_PAGE              3       /* one page of many */
  133. #define TIFFTAG_IMAGEWIDTH              256     /* image width in pixels */
  134. #define TIFFTAG_IMAGELENGTH             257     /* image height in pixels */
  135. #define TIFFTAG_BITSPERSAMPLE           258     /* bits per channel (sample) */
  136. #define TIFFTAG_COMPRESSION             259     /* data compression technique */
  137. #define     COMPRESSION_NONE            1       /* dump mode */
  138. #define     COMPRESSION_CCITTRLE        2       /* CCITT modified Huffman RLE */
  139. #define     COMPRESSION_CCITTFAX3       3       /* CCITT Group 3 fax encoding */
  140. #define     COMPRESSION_CCITTFAX4       4       /* CCITT Group 4 fax encoding */
  141. #define     COMPRESSION_LZW             5       /* Lempel-Ziv & Welch */
  142. #define     COMPRESSION_NEXT            32766U    /* NeXT 2-bit RLE */
  143. #define     COMPRESSION_CCITTRLEW       32771U  /* #1 w/ word alignment */
  144. #define     COMPRESSION_PACKBITS        32773U  /* Macintosh RLE */
  145. #define     COMPRESSION_THUNDERSCAN     32809U  /* ThunderScan RLE */
  146. #define     COMPRESSION_PICIO           32900U  /* old Pixar picio RLE */
  147. #define     COMPRESSION_SGIRLE          32901U  /* Silicon Graphics RLE */
  148. #define TIFFTAG_PHOTOMETRIC             262     /* photometric interpretation */
  149. #define     PHOTOMETRIC_MINISWHITE      0       /* min value is white */
  150. #define     PHOTOMETRIC_MINISBLACK      1       /* min value is black */
  151. #define     PHOTOMETRIC_RGB             2       /* RGB color model */
  152. #define     PHOTOMETRIC_PALETTE         3       /* color map indexed */
  153. #define     PHOTOMETRIC_MASK            4       /* holdout mask */
  154. #define     PHOTOMETRIC_DEPTH           32768U  /* z-depth data */
  155. #define TIFFTAG_THRESHHOLDING           263     /* +thresholding used on data */
  156. #define     THRESHHOLD_BILEVEL          1       /* b&w art scan */
  157. #define     THRESHHOLD_HALFTONE         2       /* or dithered scan */
  158. #define     THRESHHOLD_ERRORDIFFUSE     3       /* usually floyd-steinberg */
  159. #define TIFFTAG_CELLWIDTH               264     /* +dithering matrix width */
  160. #define TIFFTAG_CELLLENGTH              265     /* +dithering matrix height */
  161. #define TIFFTAG_FILLORDER               266     /* +data order within a byte */
  162. #define     FILLORDER_MSB2LSB           1       /* most significant -> least */
  163. #define     FILLORDER_LSB2MSB           2       /* least significant -> most */
  164. #define TIFFTAG_DOCUMENTNAME            269     /* name of doc. image is from */
  165. #define TIFFTAG_IMAGEDESCRIPTION        270     /* info about image */
  166. #define TIFFTAG_MAKE                    271     /* scanner manufacturer name */
  167. #define TIFFTAG_MODEL                   272     /* scanner model name/number */
  168. #define TIFFTAG_STRIPOFFSETS            273     /* offsets to data strips */
  169. #define TIFFTAG_ORIENTATION             274     /* +image orientation */
  170. #define     ORIENTATION_TOPLEFT         1       /* row 0 top, col 0 lhs */
  171. #define     ORIENTATION_TOPRIGHT        2       /* row 0 top, col 0 rhs */
  172. #define     ORIENTATION_BOTRIGHT        3       /* row 0 bottom, col 0 rhs */
  173. #define     ORIENTATION_BOTLEFT         4       /* row 0 bottom, col 0 lhs */
  174. #define     ORIENTATION_LEFTTOP         5       /* row 0 lhs, col 0 top */
  175. #define     ORIENTATION_RIGHTTOP        6       /* row 0 rhs, col 0 top */
  176. #define     ORIENTATION_RIGHTBOT        7       /* row 0 rhs, col 0 bottom */
  177. #define     ORIENTATION_LEFTBOT         8       /* row 0 lhs, col 0 bottom */
  178. #define TIFFTAG_SAMPLESPERPIXEL         277     /* samples per pixel */
  179. #define TIFFTAG_ROWSPERSTRIP            278     /* rows per strip of data */
  180. #define TIFFTAG_STRIPBYTECOUNTS         279     /* bytes counts for strips */
  181. #define TIFFTAG_MINSAMPLEVALUE          280     /* +minimum sample value */
  182. #define TIFFTAG_MAXSAMPLEVALUE          281     /* maximum sample value */
  183. #define TIFFTAG_XRESOLUTION             282     /* pixels/resolution in x */
  184. #define TIFFTAG_YRESOLUTION             283     /* pixels/resolution in y */
  185. #define TIFFTAG_PLANARCONFIG            284     /* storage organization */
  186. #define     PLANARCONFIG_CONTIG         1       /* single image plane */
  187. #define     PLANARCONFIG_SEPARATE       2       /* separate planes of data */
  188. #define TIFFTAG_PAGENAME                285     /* page name image is from */
  189. #define TIFFTAG_XPOSITION               286     /* x page offset of image lhs */
  190. #define TIFFTAG_YPOSITION               287     /* y page offset of image lhs */
  191. #define TIFFTAG_FREEOFFSETS             288     /* +byte offset to free block */
  192. #define TIFFTAG_FREEBYTECOUNTS          289     /* +sizes of free blocks */
  193. #define TIFFTAG_GRAYRESPONSEUNIT        290     /* gray scale curve accuracy */
  194. #define     GRAYRESPONSEUNIT_10S        1       /* tenths of a unit */
  195. #define     GRAYRESPONSEUNIT_100S       2       /* hundredths of a unit */
  196. #define     GRAYRESPONSEUNIT_1000S      3       /* thousandths of a unit */
  197. #define     GRAYRESPONSEUNIT_10000S     4       /* ten-thousandths of a unit */
  198. #define     GRAYRESPONSEUNIT_100000S    5       /* hundred-thousandths */
  199. #define TIFFTAG_GRAYRESPONSECURVE       291     /* gray scale response curve */
  200. #define TIFFTAG_GROUP3OPTIONS           292     /* 32 flag bits */
  201. #define     GROUP3OPT_2DENCODING        0x1     /* 2-dimensional coding */
  202. #define     GROUP3OPT_UNCOMPRESSED      0x2     /* data not compressed */
  203. #define     GROUP3OPT_FILLBITS          0x4     /* fill to byte boundary */
  204. #define TIFFTAG_GROUP4OPTIONS           293     /* 32 flag bits */
  205. #define     GROUP4OPT_UNCOMPRESSED      0x2     /* data not compressed */
  206. #define TIFFTAG_RESOLUTIONUNIT          296     /* units of resolutions */
  207. #define     RESUNIT_NONE                1       /* no meaningful units */
  208. #define     RESUNIT_INCH                2       /* english */
  209. #define     RESUNIT_CENTIMETER          3       /* metric */
  210. #define TIFFTAG_PAGENUMBER              297     /* page numbers of multi-page */
  211. #define TIFFTAG_COLORRESPONSEUNIT       300     /* color scale curve accuracy */
  212. #define     COLORRESPONSEUNIT_10S       1       /* tenths of a unit */
  213. #define     COLORRESPONSEUNIT_100S      2       /* hundredths of a unit */
  214. #define     COLORRESPONSEUNIT_1000S     3       /* thousandths of a unit */
  215. #define     COLORRESPONSEUNIT_10000S    4       /* ten-thousandths of a unit */
  216. #define     COLORRESPONSEUNIT_100000S   5       /* hundred-thousandths */
  217. #define TIFFTAG_COLORRESPONSECURVE      301     /* RGB response curve */
  218. #define TIFFTAG_SOFTWARE                305     /* name & release */
  219. #define TIFFTAG_DATETIME                306     /* creation date and time */
  220. #define TIFFTAG_ARTIST                  315     /* creator of image */
  221. #define TIFFTAG_HOSTCOMPUTER            316     /* machine where created */
  222. #define TIFFTAG_PREDICTOR               317     /* prediction scheme w/ LZW */
  223. #define TIFFTAG_WHITEPOINT              318     /* image white point */
  224. #define TIFFTAG_PRIMARYCHROMATICITIES   319     /* primary chromaticities */
  225. #define TIFFTAG_COLORMAP                320     /* RGB map for pallette image */
  226. #define TIFFTAG_BADFAXLINES             326     /* lines w/ wrong pixel count */
  227. #define TIFFTAG_CLEANFAXDATA            327     /* regenerated line info */
  228. #define      CLEANFAXDATA_CLEAN         0       /* no errors detected */
  229. #define      CLEANFAXDATA_REGENERATED   1       /* receiver regenerated lines */
  230. #define      CLEANFAXDATA_UNCLEAN       2       /* uncorrected errors exist */
  231. #define TIFFTAG_CONSECUTIVEBADFAXLINES  328     /* max consecutive bad lines */
  232. /*** tags 32995-32999 are private tags registered to SGI ***/
  233. #define TIFFTAG_MATTEING                32995U    /* alpha channel is present */
  234.  
  235. /****************************************************************************
  236.  * @(#)TIFF/tiffio.h 1.29, Copyright (c) Sam Leffler, Dieter Linde, Nov 15 1990
  237.  */
  238.  
  239. /*
  240.  * Internal format of a TIFF directory entry.
  241.  */
  242. typedef struct {
  243.            u_short    td_subfiletype;
  244.         u_short td_imagewidth, td_imagelength;
  245.         u_short td_bitspersample;
  246.         u_short td_compression;
  247.         u_short td_photometric;
  248.         u_short td_threshholding;
  249.         u_short td_fillorder;
  250.         u_short td_orientation;
  251.         u_short td_samplesperpixel;
  252.         u_short td_predictor;
  253.         u_long  td_rowsperstrip;
  254.         u_long  td_minsamplevalue, td_maxsamplevalue;    /* maybe float? */
  255.         float   td_xresolution, td_yresolution;
  256.         u_short td_resolutionunit;
  257.         u_short td_planarconfig;
  258.         float   td_xposition, td_yposition;
  259.         u_long  td_group3options;
  260.         u_long  td_group4options;
  261.         u_short td_pagenumber[2];
  262.         u_short td_grayresponseunit;
  263.         u_short td_colorresponseunit;
  264.         u_short td_matteing;
  265.         u_short td_cleanfaxdata;
  266.         u_short td_badfaxrun;
  267.         u_long  td_badfaxlines;
  268.         u_short *td_grayresponsecurve;    /* u_short for now (maybe float?) */
  269.         u_short *td_redresponsecurve;   /* u_short for now (maybe float?) */
  270.         u_short *td_greenresponsecurve; /* u_short for now (maybe float?) */
  271.         u_short *td_blueresponsecurve;  /* u_short for now (maybe float?) */
  272.         u_short *td_redcolormap;
  273.         u_short *td_greencolormap;
  274.         u_short *td_bluecolormap;
  275.  
  276. #ifdef     notdef
  277.     /* not yet used/supported */
  278.         float   td_whitepoint[2];
  279.         float   td_primarychromaticities[6];
  280. #endif
  281.  
  282.         char    *td_documentname;
  283.         char    *td_artist;
  284.         char    *td_datetime;
  285.         char    *td_hostcomputer;
  286.         char    *td_imagedescription;
  287.         char    *td_make;
  288.         char    *td_model;
  289.         char    *td_software;
  290.         char    *td_pagename;
  291.         u_long  td_fieldsset[2];           /* bit vector of fields that are set */
  292.         u_long  td_stripsperimage;
  293.         u_long  td_nstrips;             /* size of offset & bytecount arrays */
  294.         u_long  *td_stripoffset;
  295.         u_long  *td_stripbytecount;
  296. } TIFFDirectory;
  297.  
  298. /*
  299.  * Field flags used to indicate fields that have been set in a directory, and to reference fields
  300.  * when manipulating a directory.
  301.  */
  302. /*** multi-entry fields ***/
  303. #define FIELD_IMAGEDIMENSIONS           0
  304. #define FIELD_CELLDIMENSIONS            1               /* XXX */
  305. #define FIELD_RESOLUTION                2
  306. #define FIELD_POSITION                  3
  307. /*** single-entry fields ***/
  308. #define FIELD_SUBFILETYPE               4
  309. #define FIELD_BITSPERSAMPLE             5
  310. #define FIELD_COMPRESSION               6
  311. #define FIELD_PHOTOMETRIC               7
  312. #define FIELD_THRESHHOLDING             8
  313. #define FIELD_FILLORDER                 9               /* XXX */
  314. #define FIELD_DOCUMENTNAME              10
  315. #define FIELD_IMAGEDESCRIPTION          11
  316. #define FIELD_MAKE                      12
  317. #define FIELD_MODEL                     13
  318. #define FIELD_ORIENTATION               14
  319. #define FIELD_SAMPLESPERPIXEL           15
  320. #define FIELD_ROWSPERSTRIP              16
  321. #define FIELD_MINSAMPLEVALUE            17
  322. #define FIELD_MAXSAMPLEVALUE            18
  323. #define FIELD_PLANARCONFIG              19
  324. #define FIELD_PAGENAME                  20
  325. #define FIELD_GRAYRESPONSEUNIT          21
  326. #define FIELD_GRAYRESPONSECURVE         22
  327. #define FIELD_GROUP3OPTIONS             23
  328. #define FIELD_GROUP4OPTIONS             24
  329. #define FIELD_RESOLUTIONUNIT            25
  330. #define FIELD_PAGENUMBER                26
  331. #define FIELD_COLORRESPONSEUNIT         27
  332. #define FIELD_COLORRESPONSECURVE        28
  333. #define FIELD_STRIPBYTECOUNTS           29
  334. #define FIELD_STRIPOFFSETS              31
  335. #define FIELD_COLORMAP                  32
  336. #define FIELD_PREDICTOR                 33
  337. #define FIELD_ARTIST                    34
  338. #define FIELD_DATETIME                  35
  339. #define FIELD_HOSTCOMPUTER              36
  340. #define FIELD_SOFTWARE                  37
  341. #define FIELD_MATTEING                  38
  342. #define FIELD_BADFAXLINES               39
  343. #define FIELD_CLEANFAXDATA              40
  344. #define FIELD_BADFAXRUN                 41
  345. #define FIELD_LAST                      FIELD_BADFAXRUN
  346.  
  347. #define TIFFFieldSet(tif, field)    ((tif)->tif_dir.td_fieldsset[field / 32] & (1UL << (field & 0x1f)))
  348. #define TIFFSetFieldBit(tif, field)    ((tif)->tif_dir.td_fieldsset[field / 32] |= (1UL << (field & 0x1f)))
  349.  
  350. typedef struct tiff_t {
  351.         char        *tif_name;                              /* name of open file */
  352.         short       tif_fd;                                 /* open file descriptor */
  353.         short       tif_mode;                               /* open mode (O_*) */
  354.         char        tif_fillorder;                          /* natural bit fill order for machine */
  355.         char        tif_options;                            /* compression-specific options */
  356.         short       tif_flags;
  357. #define TIFF_DIRTYHEADER        0x1                         /* header must be written on close */
  358. #define TIFF_DIRTYDIRECT        0x2                         /* current directory must be written */
  359. #define TIFF_BUFFERSETUP        0x4                         /* data buffers setup */
  360. #define TIFF_BEENWRITING        0x8                         /* written 1+ scanlines to file */
  361. #define TIFF_SWAB               0x10                        /* byte swap file information */
  362. #define TIFF_NOBITREV           0x20                        /* inhibit bit reversal logic */
  363.         long        tif_diroff;                             /* file offset of current directory */
  364.         long        tif_nextdiroff;                         /* file offset of following directory */
  365.         TIFFDirectory     tif_dir;                              /* internal rep of current directory */
  366.         TIFFHeader     tif_header;                              /* file's header block */
  367.         int         tif_typeshift[6];                       /* data type shift counts */
  368.         long        tif_typemask[6];                        /* data type masks */
  369.         long        tif_row;                                /* current scanline */
  370.         int         tif_curstrip;                           /* current strip for read/write */
  371.         long        tif_curoff;                             /* current offset for read/write */
  372. /*** compression scheme hooks ***/
  373.         int         (*tif_stripdecode)(struct tiff_t *);             /* strip decoding routine (pre) */
  374.         int         (*tif_decoderow)(struct tiff_t *, u_char *, int);    /* scanline decoding routine */
  375.         int         (*tif_stripencode)(struct tiff_t *);               /* strip encoding routine (pre) */
  376.         int         (*tif_encoderow)(struct tiff_t *, u_char *, int);    /* scanline encoding routine */
  377.         int         (*tif_encodestrip)(struct tiff_t *);            /* strip encoding routine (post) */
  378.         void        (*tif_close)(struct tiff_t *);                /* cleanup-on-close routine */
  379.         int         (*tif_seek)(struct tiff_t *, long);            /* position within a strip routine */
  380.         void         (*tif_cleanup)(struct tiff_t *);            /* routine called to cleanup state */
  381.         u_char        *tif_data;                              /* compression scheme private data */
  382. /*** input/output buffering ***/
  383.         int         tif_scanlinesize;                       /* # of bytes in a scanline */
  384.         u_char        *tif_rawdata;                           /* raw data buffer */
  385.         long        tif_rawdatasize;                        /* # of bytes in raw data buffer */
  386.         u_char        *tif_rawcp;                             /* current spot in raw buffer */
  387.         long        tif_rawcc;                              /* bytes unread from raw buffer */
  388. } TIFF;
  389.  
  390. /* 
  391.  * Generic option bit names.
  392.  */
  393. #define TIFF_OPT0       0x1
  394. #define TIFF_OPT1       0x2
  395. #define TIFF_OPT2       0x4
  396. #define TIFF_OPT3       0x8
  397. #define TIFF_OPT4       0x10
  398. #define TIFF_OPT5       0x20
  399. #define TIFF_OPT6       0x40
  400. #define TIFF_OPT7       0x80
  401.  
  402. extern     u_char    TIFFBitRevTable[256];
  403. extern     u_char    TIFFNoBitRevTable[256];
  404.  
  405. /*
  406.  * Prototypes.
  407.  */
  408. /*** tif_error ***/
  409. void     TIFFError(char *, char *, ...);
  410.  
  411. /*** tif_warning ***/
  412. void    TIFFWarning(char *, char *, ...);
  413.  
  414. /*** tif_swab ***/
  415. void    TIFFSwabShort(u_short *);
  416. void    TIFFSwabLong(u_long *);
  417. void    TIFFSwabArrayOfShort(u_short *, int);
  418. void    TIFFSwabArrayOfLong(u_long *, int);
  419. void    TIFFReverseBits(u_char *, long);
  420.  
  421. /*** tif_compat ***/
  422. long    TIFFGetFileSize(int);
  423.  
  424. /*** tif_flush ***/
  425. int    TIFFFlush(TIFF *);
  426.  
  427. /*** tif_open ***/
  428. TIFF     *TIFFFdOpen(int, char *, char *);
  429. TIFF     *TIFFOpen(char *, char *);
  430. int    TIFFScanlineSize(TIFF *);
  431.  
  432. /*** tif_read ***/
  433. long    TIFFReadRawStrip(TIFF *, u_int, void *, u_long);
  434. int    TIFFReadScanline(TIFF *, void *, u_int, u_int);
  435. int    TIFFReadEncodedStrip(TIFF *, u_int, void *, u_int);
  436.  
  437. /*** tif_write ***/
  438. int    TIFFFlushData1(TIFF *);
  439. int    TIFFFlushData(TIFF *);
  440. int    TIFFWriteScanline(TIFF *, void *, u_int, u_int);
  441. int    TIFFWriteEncodedStrip(TIFF *, u_int, void *, u_int);
  442. int    TIFFWriteRawStrip(TIFF *, u_int, void *, u_int);
  443.  
  444. /*** tif_close ***/
  445. void    TIFFClose(TIFF *);
  446.  
  447. /*** tif_print ***/
  448. void    TIFFPrintDirectory(TIFF *, FILE *, int, int, int);
  449.  
  450. /*** tif_dir ***/
  451. int    TIFFSetField(TIFF *, u_short, ...);
  452. int    TIFFDefaultDirectory(TIFF *);
  453. int    TIFFReadDirectory(TIFF *);
  454. void    TIFFFreeDirectory(TIFF *);
  455. int    TIFFGetField(TIFF *, u_short, ...);
  456. int    TIFFWriteDirectory(TIFF *);
  457. int    TIFFSetDirectory(TIFF *, int);
  458.  
  459. /*** tif_ccittrle.c ***/
  460. int     TIFFInitCCITTRLE(TIFF *);
  461. int    TIFFInitCCITTRLEW(TIFF *);
  462.  
  463. /*** tif_dumpmode ***/
  464. int     TIFFInitDumpMode(TIFF *);
  465.  
  466. /*** tif_fax3 ***/
  467. void    TIFFModeCCITTFax3(TIFF *, int);
  468. int    TIFFInitCCITTFax3(TIFF *);
  469.  
  470. /*** tif_fax4 ***/
  471. int    TIFFInitCCITTFax4(TIFF *);
  472.  
  473. /*** tif_lzw ***/
  474. int    TIFFInitLZW(TIFF *);
  475.  
  476. /*** tif_packbits ***/
  477. int    TIFFInitPackBits(TIFF *);
  478.  
  479. /*** tif_next ***/
  480. #ifdef     NEXT_SUPPORT
  481. int    TIFFInitNeXT(TIFF *);
  482. #endif    /* NEXT_SUPPORT */
  483.  
  484. /*** tif_picio ***/
  485. #ifdef     PICIO_SUPPORT
  486. int    TIFFInitPicio(TIFF *);
  487. #endif    /* PICIO_SUPPORT */
  488.  
  489. /*** tif_sgi ***/
  490. #ifdef     SGI_SUPPORT
  491. int     TIFFInitSGI(TIFF *);
  492. #endif    /* SGI_SUPPORT */
  493.  
  494. /*** tif_thunder ***/
  495. #ifdef     THUNDER_SUPPORT
  496. int     TIFFInitThunderScan(TIFF *);
  497. #endif    /* THUNDER_SUPPORT */
  498.  
  499. /*** tif_compress ***/
  500. int    TIFFSetCompressionScheme(TIFF *, u_short);
  501.  
  502. #endif    __TIFFIO_H__
  503.