Blame libtiff/tiffiop.h

Packit 7838c8
/* $Id: tiffiop.h,v 1.95 2017-09-07 14:02:52 erouault Exp $ */
Packit 7838c8
Packit 7838c8
/*
Packit 7838c8
 * Copyright (c) 1988-1997 Sam Leffler
Packit 7838c8
 * Copyright (c) 1991-1997 Silicon Graphics, Inc.
Packit 7838c8
 *
Packit 7838c8
 * Permission to use, copy, modify, distribute, and sell this software and 
Packit 7838c8
 * its documentation for any purpose is hereby granted without fee, provided
Packit 7838c8
 * that (i) the above copyright notices and this permission notice appear in
Packit 7838c8
 * all copies of the software and related documentation, and (ii) the names of
Packit 7838c8
 * Sam Leffler and Silicon Graphics may not be used in any advertising or
Packit 7838c8
 * publicity relating to the software without the specific, prior written
Packit 7838c8
 * permission of Sam Leffler and Silicon Graphics.
Packit 7838c8
 * 
Packit 7838c8
 * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
Packit 7838c8
 * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
Packit 7838c8
 * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
Packit 7838c8
 * 
Packit 7838c8
 * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
Packit 7838c8
 * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
Packit 7838c8
 * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
Packit 7838c8
 * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
Packit 7838c8
 * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
Packit 7838c8
 * OF THIS SOFTWARE.
Packit 7838c8
 */
Packit 7838c8
Packit 7838c8
#ifndef _TIFFIOP_
Packit 7838c8
#define	_TIFFIOP_
Packit 7838c8
/*
Packit 7838c8
 * ``Library-private'' definitions.
Packit 7838c8
 */
Packit 7838c8
Packit 7838c8
#include "tif_config.h"
Packit 7838c8
Packit 7838c8
#ifdef HAVE_FCNTL_H
Packit 7838c8
# include <fcntl.h>
Packit 7838c8
#endif
Packit 7838c8
Packit 7838c8
#ifdef HAVE_SYS_TYPES_H
Packit 7838c8
# include <sys/types.h>
Packit 7838c8
#endif
Packit 7838c8
Packit 7838c8
#ifdef HAVE_STRING_H
Packit 7838c8
# include <string.h>
Packit 7838c8
#endif
Packit 7838c8
Packit 7838c8
#ifdef HAVE_ASSERT_H
Packit 7838c8
# include <assert.h>
Packit 7838c8
#else
Packit 7838c8
# define assert(x) 
Packit 7838c8
#endif
Packit 7838c8
Packit 7838c8
#ifdef HAVE_SEARCH_H
Packit 7838c8
# include <search.h>
Packit 7838c8
#else
Packit 7838c8
extern void *lfind(const void *, const void *, size_t *, size_t,
Packit 7838c8
		   int (*)(const void *, const void *));
Packit 7838c8
#endif
Packit 7838c8
Packit 7838c8
#if !defined(HAVE_SNPRINTF) && !defined(HAVE__SNPRINTF)
Packit 7838c8
#undef snprintf
Packit 7838c8
#define snprintf _TIFF_snprintf_f
Packit 7838c8
extern int snprintf(char* str, size_t size, const char* format, ...);
Packit 7838c8
#endif
Packit 7838c8
Packit 7838c8
#include "tiffio.h"
Packit 7838c8
Packit 7838c8
#include "tif_dir.h"
Packit 7838c8
Packit 7838c8
#ifndef STRIP_SIZE_DEFAULT
Packit 7838c8
# define STRIP_SIZE_DEFAULT 8192
Packit 7838c8
#endif
Packit 7838c8
Packit 7838c8
#define    streq(a,b)      (strcmp(a,b) == 0)
Packit 7838c8
Packit 7838c8
#ifndef TRUE
Packit 7838c8
#define	TRUE	1
Packit 7838c8
#define	FALSE	0
Packit 7838c8
#endif
Packit 7838c8
Packit 7838c8
typedef struct client_info {
Packit 7838c8
    struct client_info *next;
Packit 7838c8
    void *data;
Packit 7838c8
    char *name;
Packit 7838c8
} TIFFClientInfoLink;
Packit 7838c8
Packit 7838c8
/*
Packit 7838c8
 * Typedefs for ``method pointers'' used internally.
Packit 7838c8
 * these are deprecated and provided only for backwards compatibility.
Packit 7838c8
 */
Packit 7838c8
typedef unsigned char tidataval_t;    /* internal image data value type */
Packit 7838c8
typedef tidataval_t* tidata_t;        /* reference to internal image data */
Packit 7838c8
Packit 7838c8
typedef void (*TIFFVoidMethod)(TIFF*);
Packit 7838c8
typedef int (*TIFFBoolMethod)(TIFF*);
Packit 7838c8
typedef int (*TIFFPreMethod)(TIFF*, uint16);
Packit 7838c8
typedef int (*TIFFCodeMethod)(TIFF* tif, uint8* buf, tmsize_t size, uint16 sample);
Packit 7838c8
typedef int (*TIFFSeekMethod)(TIFF*, uint32);
Packit 7838c8
typedef void (*TIFFPostMethod)(TIFF* tif, uint8* buf, tmsize_t size);
Packit 7838c8
typedef uint32 (*TIFFStripMethod)(TIFF*, uint32);
Packit 7838c8
typedef void (*TIFFTileMethod)(TIFF*, uint32*, uint32*);
Packit 7838c8
Packit 7838c8
struct tiff {
Packit 7838c8
	char*                tif_name;         /* name of open file */
Packit 7838c8
	int                  tif_fd;           /* open file descriptor */
Packit 7838c8
	int                  tif_mode;         /* open mode (O_*) */
Packit 7838c8
	uint32               tif_flags;
Packit 7838c8
	#define TIFF_FILLORDER   0x00003U /* natural bit fill order for machine */
Packit 7838c8
	#define TIFF_DIRTYHEADER 0x00004U /* header must be written on close */
Packit 7838c8
	#define TIFF_DIRTYDIRECT 0x00008U /* current directory must be written */
Packit 7838c8
	#define TIFF_BUFFERSETUP 0x00010U /* data buffers setup */
Packit 7838c8
	#define TIFF_CODERSETUP  0x00020U /* encoder/decoder setup done */
Packit 7838c8
	#define TIFF_BEENWRITING 0x00040U /* written 1+ scanlines to file */
Packit 7838c8
	#define TIFF_SWAB        0x00080U /* byte swap file information */
Packit 7838c8
	#define TIFF_NOBITREV    0x00100U /* inhibit bit reversal logic */
Packit 7838c8
	#define TIFF_MYBUFFER    0x00200U /* my raw data buffer; free on close */
Packit 7838c8
	#define TIFF_ISTILED     0x00400U /* file is tile, not strip- based */
Packit 7838c8
	#define TIFF_MAPPED      0x00800U /* file is mapped into memory */
Packit 7838c8
	#define TIFF_POSTENCODE  0x01000U /* need call to postencode routine */
Packit 7838c8
	#define TIFF_INSUBIFD    0x02000U /* currently writing a subifd */
Packit 7838c8
	#define TIFF_UPSAMPLED   0x04000U /* library is doing data up-sampling */
Packit 7838c8
	#define TIFF_STRIPCHOP   0x08000U /* enable strip chopping support */
Packit 7838c8
	#define TIFF_HEADERONLY  0x10000U /* read header only, do not process the first directory */
Packit 7838c8
	#define TIFF_NOREADRAW   0x20000U /* skip reading of raw uncompressed image data */
Packit 7838c8
	#define TIFF_INCUSTOMIFD 0x40000U /* currently writing a custom IFD */
Packit 7838c8
	#define TIFF_BIGTIFF     0x80000U /* read/write bigtiff */
Packit 7838c8
        #define TIFF_BUF4WRITE  0x100000U /* rawcc bytes are for writing */
Packit 7838c8
        #define TIFF_DIRTYSTRIP 0x200000U /* stripoffsets/stripbytecount dirty*/
Packit 7838c8
        #define TIFF_PERSAMPLE  0x400000U /* get/set per sample tags as arrays */
Packit 7838c8
        #define TIFF_BUFFERMMAP 0x800000U /* read buffer (tif_rawdata) points into mmap() memory */
Packit 7838c8
	uint64               tif_diroff;       /* file offset of current directory */
Packit 7838c8
	uint64               tif_nextdiroff;   /* file offset of following directory */
Packit 7838c8
	uint64*              tif_dirlist;      /* list of offsets to already seen directories to prevent IFD looping */
Packit 7838c8
	uint16               tif_dirlistsize;  /* number of entries in offset list */
Packit 7838c8
	uint16               tif_dirnumber;    /* number of already seen directories */
Packit 7838c8
	TIFFDirectory        tif_dir;          /* internal rep of current directory */
Packit 7838c8
	TIFFDirectory        tif_customdir;    /* custom IFDs are separated from the main ones */
Packit 7838c8
	union {
Packit 7838c8
		TIFFHeaderCommon common;
Packit 7838c8
		TIFFHeaderClassic classic;
Packit 7838c8
		TIFFHeaderBig big;
Packit 7838c8
	} tif_header;
Packit 7838c8
	uint16               tif_header_size;  /* file's header block and its length */
Packit 7838c8
	uint32               tif_row;          /* current scanline */
Packit 7838c8
	uint16               tif_curdir;       /* current directory (index) */
Packit 7838c8
	uint32               tif_curstrip;     /* current strip for read/write */
Packit 7838c8
	uint64               tif_curoff;       /* current offset for read/write */
Packit 7838c8
	uint64               tif_dataoff;      /* current offset for writing dir */
Packit 7838c8
	/* SubIFD support */
Packit 7838c8
	uint16               tif_nsubifd;      /* remaining subifds to write */
Packit 7838c8
	uint64               tif_subifdoff;    /* offset for patching SubIFD link */
Packit 7838c8
	/* tiling support */
Packit 7838c8
	uint32               tif_col;          /* current column (offset by row too) */
Packit 7838c8
	uint32               tif_curtile;      /* current tile for read/write */
Packit 7838c8
	tmsize_t             tif_tilesize;     /* # of bytes in a tile */
Packit 7838c8
	/* compression scheme hooks */
Packit 7838c8
	int                  tif_decodestatus;
Packit 7838c8
	TIFFBoolMethod       tif_fixuptags;    /* called in TIFFReadDirectory */
Packit 7838c8
	TIFFBoolMethod       tif_setupdecode;  /* called once before predecode */
Packit 7838c8
	TIFFPreMethod        tif_predecode;    /* pre- row/strip/tile decoding */
Packit 7838c8
	TIFFBoolMethod       tif_setupencode;  /* called once before preencode */
Packit 7838c8
	int                  tif_encodestatus;
Packit 7838c8
	TIFFPreMethod        tif_preencode;    /* pre- row/strip/tile encoding */
Packit 7838c8
	TIFFBoolMethod       tif_postencode;   /* post- row/strip/tile encoding */
Packit 7838c8
	TIFFCodeMethod       tif_decoderow;    /* scanline decoding routine */
Packit 7838c8
	TIFFCodeMethod       tif_encoderow;    /* scanline encoding routine */
Packit 7838c8
	TIFFCodeMethod       tif_decodestrip;  /* strip decoding routine */
Packit 7838c8
	TIFFCodeMethod       tif_encodestrip;  /* strip encoding routine */
Packit 7838c8
	TIFFCodeMethod       tif_decodetile;   /* tile decoding routine */
Packit 7838c8
	TIFFCodeMethod       tif_encodetile;   /* tile encoding routine */
Packit 7838c8
	TIFFVoidMethod       tif_close;        /* cleanup-on-close routine */
Packit 7838c8
	TIFFSeekMethod       tif_seek;         /* position within a strip routine */
Packit 7838c8
	TIFFVoidMethod       tif_cleanup;      /* cleanup state routine */
Packit 7838c8
	TIFFStripMethod      tif_defstripsize; /* calculate/constrain strip size */
Packit 7838c8
	TIFFTileMethod       tif_deftilesize;  /* calculate/constrain tile size */
Packit 7838c8
	uint8*               tif_data;         /* compression scheme private data */
Packit 7838c8
	/* input/output buffering */
Packit 7838c8
	tmsize_t             tif_scanlinesize; /* # of bytes in a scanline */
Packit 7838c8
	tmsize_t             tif_scanlineskew; /* scanline skew for reading strips */
Packit 7838c8
	uint8*               tif_rawdata;      /* raw data buffer */
Packit 7838c8
	tmsize_t             tif_rawdatasize;  /* # of bytes in raw data buffer */
Packit 7838c8
        tmsize_t             tif_rawdataoff;   /* rawdata offset within strip */
Packit 7838c8
        tmsize_t             tif_rawdataloaded;/* amount of data in rawdata */
Packit 7838c8
	uint8*               tif_rawcp;        /* current spot in raw buffer */
Packit 7838c8
	tmsize_t             tif_rawcc;        /* bytes unread from raw buffer */
Packit 7838c8
	/* memory-mapped file support */
Packit 7838c8
	uint8*               tif_base;         /* base of mapped file */
Packit 7838c8
	tmsize_t             tif_size;         /* size of mapped file region (bytes, thus tmsize_t) */
Packit 7838c8
	TIFFMapFileProc      tif_mapproc;      /* map file method */
Packit 7838c8
	TIFFUnmapFileProc    tif_unmapproc;    /* unmap file method */
Packit 7838c8
	/* input/output callback methods */
Packit 7838c8
	thandle_t            tif_clientdata;   /* callback parameter */
Packit 7838c8
	TIFFReadWriteProc    tif_readproc;     /* read method */
Packit 7838c8
	TIFFReadWriteProc    tif_writeproc;    /* write method */
Packit 7838c8
	TIFFSeekProc         tif_seekproc;     /* lseek method */
Packit 7838c8
	TIFFCloseProc        tif_closeproc;    /* close method */
Packit 7838c8
	TIFFSizeProc         tif_sizeproc;     /* filesize method */
Packit 7838c8
	/* post-decoding support */
Packit 7838c8
	TIFFPostMethod       tif_postdecode;   /* post decoding routine */
Packit 7838c8
	/* tag support */
Packit 7838c8
	TIFFField**          tif_fields;       /* sorted table of registered tags */
Packit 7838c8
	size_t               tif_nfields;      /* # entries in registered tag table */
Packit 7838c8
	const TIFFField*     tif_foundfield;   /* cached pointer to already found tag */
Packit 7838c8
	TIFFTagMethods       tif_tagmethods;   /* tag get/set/print routines */
Packit 7838c8
	TIFFClientInfoLink*  tif_clientinfo;   /* extra client information. */
Packit 7838c8
	/* Backward compatibility stuff. We need these two fields for
Packit 7838c8
	 * setting up an old tag extension scheme. */
Packit 7838c8
	TIFFFieldArray*      tif_fieldscompat;
Packit 7838c8
	size_t               tif_nfieldscompat;
Packit 7838c8
};
Packit 7838c8
Packit 7838c8
#define isPseudoTag(t) (t > 0xffff)            /* is tag value normal or pseudo */
Packit 7838c8
Packit 7838c8
#define isTiled(tif) (((tif)->tif_flags & TIFF_ISTILED) != 0)
Packit 7838c8
#define isMapped(tif) (((tif)->tif_flags & TIFF_MAPPED) != 0)
Packit 7838c8
#define isFillOrder(tif, o) (((tif)->tif_flags & (o)) != 0)
Packit 7838c8
#define isUpSampled(tif) (((tif)->tif_flags & TIFF_UPSAMPLED) != 0)
Packit 7838c8
#define TIFFReadFile(tif, buf, size) \
Packit 7838c8
	((*(tif)->tif_readproc)((tif)->tif_clientdata,(buf),(size)))
Packit 7838c8
#define TIFFWriteFile(tif, buf, size) \
Packit 7838c8
	((*(tif)->tif_writeproc)((tif)->tif_clientdata,(buf),(size)))
Packit 7838c8
#define TIFFSeekFile(tif, off, whence) \
Packit 7838c8
	((*(tif)->tif_seekproc)((tif)->tif_clientdata,(off),(whence)))
Packit 7838c8
#define TIFFCloseFile(tif) \
Packit 7838c8
	((*(tif)->tif_closeproc)((tif)->tif_clientdata))
Packit 7838c8
#define TIFFGetFileSize(tif) \
Packit 7838c8
	((*(tif)->tif_sizeproc)((tif)->tif_clientdata))
Packit 7838c8
#define TIFFMapFileContents(tif, paddr, psize) \
Packit 7838c8
	((*(tif)->tif_mapproc)((tif)->tif_clientdata,(paddr),(psize)))
Packit 7838c8
#define TIFFUnmapFileContents(tif, addr, size) \
Packit 7838c8
	((*(tif)->tif_unmapproc)((tif)->tif_clientdata,(addr),(size)))
Packit 7838c8
Packit 7838c8
/*
Packit 7838c8
 * Default Read/Seek/Write definitions.
Packit 7838c8
 */
Packit 7838c8
#ifndef ReadOK
Packit 7838c8
#define ReadOK(tif, buf, size) \
Packit 7838c8
	(TIFFReadFile((tif),(buf),(size))==(size))
Packit 7838c8
#endif
Packit 7838c8
#ifndef SeekOK
Packit 7838c8
#define SeekOK(tif, off) _TIFFSeekOK(tif, off)
Packit 7838c8
#endif
Packit 7838c8
#ifndef WriteOK
Packit 7838c8
#define WriteOK(tif, buf, size) \
Packit 7838c8
	(TIFFWriteFile((tif),(buf),(size))==(size))
Packit 7838c8
#endif
Packit 7838c8
Packit 7838c8
/* NB: the uint32 casts are to silence certain ANSI-C compilers */
Packit 7838c8
#define TIFFhowmany_32(x, y) (((uint32)x < (0xffffffff - (uint32)(y-1))) ? \
Packit 7838c8
			   ((((uint32)(x))+(((uint32)(y))-1))/((uint32)(y))) : \
Packit 7838c8
			   0U)
Packit 7838c8
/* Variant of TIFFhowmany_32() that doesn't return 0 if x close to MAXUINT. */
Packit 7838c8
/* Caution: TIFFhowmany_32_maxuint_compat(x,y)*y might overflow */
Packit 7838c8
#define TIFFhowmany_32_maxuint_compat(x, y) \
Packit 7838c8
			   (((uint32)(x) / (uint32)(y)) + ((((uint32)(x) % (uint32)(y)) != 0) ? 1 : 0))
Packit 7838c8
#define TIFFhowmany8_32(x) (((x)&0x07)?((uint32)(x)>>3)+1:(uint32)(x)>>3)
Packit 7838c8
#define TIFFroundup_32(x, y) (TIFFhowmany_32(x,y)*(y))
Packit 7838c8
#define TIFFhowmany_64(x, y) ((((uint64)(x))+(((uint64)(y))-1))/((uint64)(y)))
Packit 7838c8
#define TIFFhowmany8_64(x) (((x)&0x07)?((uint64)(x)>>3)+1:(uint64)(x)>>3)
Packit 7838c8
#define TIFFroundup_64(x, y) (TIFFhowmany_64(x,y)*(y))
Packit 7838c8
Packit 7838c8
/* Safe multiply which returns zero if there is an integer overflow */
Packit 7838c8
#define TIFFSafeMultiply(t,v,m) ((((t)(m) != (t)0) && (((t)(((v)*(m))/(m))) == (t)(v))) ? (t)((v)*(m)) : (t)0)
Packit 7838c8
Packit 7838c8
#define TIFFmax(A,B) ((A)>(B)?(A):(B))
Packit 7838c8
#define TIFFmin(A,B) ((A)<(B)?(A):(B))
Packit 7838c8
Packit 7838c8
#define TIFFArrayCount(a) (sizeof (a) / sizeof ((a)[0]))
Packit 7838c8
Packit 7838c8
/*
Packit 7838c8
  Support for large files.
Packit 7838c8
Packit 7838c8
  Windows read/write APIs support only 'unsigned int' rather than 'size_t'.
Packit 7838c8
  Windows off_t is only 32-bit, even in 64-bit builds.
Packit 7838c8
*/
Packit 7838c8
#if defined(HAVE_FSEEKO)
Packit 7838c8
/*
Packit 7838c8
  Use fseeko() and ftello() if they are available since they use
Packit 7838c8
  'off_t' rather than 'long'.  It is wrong to use fseeko() and
Packit 7838c8
  ftello() only on systems with special LFS support since some systems
Packit 7838c8
  (e.g. FreeBSD) support a 64-bit off_t by default.
Packit 7838c8
Packit 7838c8
  For MinGW, __MSVCRT_VERSION__ must be at least 0x800 to expose these
Packit 7838c8
  interfaces. The MinGW compiler must support the requested version.  MinGW
Packit 7838c8
  does not distribute the CRT (it is supplied by Microsoft) so the correct CRT
Packit 7838c8
  must be available on the target computer in order for the program to run.
Packit 7838c8
*/
Packit 7838c8
#if defined(HAVE_FSEEKO)
Packit 7838c8
#  define fseek(stream,offset,whence)  fseeko(stream,offset,whence)
Packit 7838c8
#  define ftell(stream,offset,whence)  ftello(stream,offset,whence)
Packit 7838c8
#endif
Packit 7838c8
#endif
Packit 7838c8
#if defined(__WIN32__) && \
Packit 7838c8
        !(defined(_MSC_VER) && _MSC_VER < 1400) && \
Packit 7838c8
        !(defined(__MSVCRT_VERSION__) && __MSVCRT_VERSION__ < 0x800)
Packit 7838c8
typedef unsigned int TIFFIOSize_t;
Packit 7838c8
#define _TIFF_lseek_f(fildes,offset,whence)  _lseeki64(fildes,/* __int64 */ offset,whence)
Packit 7838c8
/* #define _TIFF_tell_f(fildes) /\* __int64 *\/ _telli64(fildes) */
Packit 7838c8
#define _TIFF_fseek_f(stream,offset,whence) _fseeki64(stream,/* __int64 */ offset,whence)
Packit 7838c8
#define _TIFF_fstat_f(fildes,stat_buff) _fstati64(fildes,/* struct _stati64 */ stat_buff)
Packit 7838c8
/* #define _TIFF_ftell_f(stream) /\* __int64 *\/ _ftelli64(stream) */
Packit 7838c8
/* #define _TIFF_stat_f(path,stat_buff) _stati64(path,/\* struct _stati64 *\/ stat_buff) */
Packit 7838c8
#define _TIFF_stat_s struct _stati64
Packit 7838c8
#define _TIFF_off_t __int64
Packit 7838c8
#else
Packit 7838c8
typedef size_t TIFFIOSize_t;
Packit 7838c8
#define _TIFF_lseek_f(fildes,offset,whence) lseek(fildes,offset,whence)
Packit 7838c8
/* #define _TIFF_tell_f(fildes) (_TIFF_lseek_f(fildes,0,SEEK_CUR)) */
Packit 7838c8
#define _TIFF_fseek_f(stream,offset,whence) fseek(stream,offset,whence)
Packit 7838c8
#define _TIFF_fstat_f(fildes,stat_buff) fstat(fildes,stat_buff)
Packit 7838c8
/* #define _TIFF_ftell_f(stream) ftell(stream) */
Packit 7838c8
/* #define _TIFF_stat_f(path,stat_buff) stat(path,stat_buff) */
Packit 7838c8
#define _TIFF_stat_s struct stat
Packit 7838c8
#define _TIFF_off_t off_t
Packit 7838c8
#endif
Packit 7838c8
Packit 7838c8
#if __clang_major__ >= 4 || (__clang_major__ == 3 && __clang_minor__ >= 8)
Packit 7838c8
#define TIFF_NOSANITIZE_UNSIGNED_INT_OVERFLOW __attribute__((no_sanitize("unsigned-integer-overflow")))
Packit 7838c8
#else
Packit 7838c8
#define TIFF_NOSANITIZE_UNSIGNED_INT_OVERFLOW
Packit 7838c8
#endif
Packit 7838c8
Packit 7838c8
Packit 7838c8
#if defined(__cplusplus)
Packit 7838c8
extern "C" {
Packit 7838c8
#endif
Packit 7838c8
extern int _TIFFgetMode(const char* mode, const char* module);
Packit 7838c8
extern int _TIFFNoRowEncode(TIFF* tif, uint8* pp, tmsize_t cc, uint16 s);
Packit 7838c8
extern int _TIFFNoStripEncode(TIFF* tif, uint8* pp, tmsize_t cc, uint16 s);
Packit 7838c8
extern int _TIFFNoTileEncode(TIFF*, uint8* pp, tmsize_t cc, uint16 s);
Packit 7838c8
extern int _TIFFNoRowDecode(TIFF* tif, uint8* pp, tmsize_t cc, uint16 s);
Packit 7838c8
extern int _TIFFNoStripDecode(TIFF* tif, uint8* pp, tmsize_t cc, uint16 s);
Packit 7838c8
extern int _TIFFNoTileDecode(TIFF*, uint8* pp, tmsize_t cc, uint16 s);
Packit 7838c8
extern void _TIFFNoPostDecode(TIFF* tif, uint8* buf, tmsize_t cc);
Packit 7838c8
extern int _TIFFNoPreCode(TIFF* tif, uint16 s);
Packit 7838c8
extern int _TIFFNoSeek(TIFF* tif, uint32 off);
Packit 7838c8
extern void _TIFFSwab16BitData(TIFF* tif, uint8* buf, tmsize_t cc);
Packit 7838c8
extern void _TIFFSwab24BitData(TIFF* tif, uint8* buf, tmsize_t cc);
Packit 7838c8
extern void _TIFFSwab32BitData(TIFF* tif, uint8* buf, tmsize_t cc);
Packit 7838c8
extern void _TIFFSwab64BitData(TIFF* tif, uint8* buf, tmsize_t cc);
Packit 7838c8
extern int TIFFFlushData1(TIFF* tif);
Packit 7838c8
extern int TIFFDefaultDirectory(TIFF* tif);
Packit 7838c8
extern void _TIFFSetDefaultCompressionState(TIFF* tif);
Packit 7838c8
extern int _TIFFRewriteField(TIFF *, uint16, TIFFDataType, tmsize_t, void *);
Packit 7838c8
extern int TIFFSetCompressionScheme(TIFF* tif, int scheme);
Packit 7838c8
extern int TIFFSetDefaultCompressionState(TIFF* tif);
Packit 7838c8
extern uint32 _TIFFDefaultStripSize(TIFF* tif, uint32 s);
Packit 7838c8
extern void _TIFFDefaultTileSize(TIFF* tif, uint32* tw, uint32* th);
Packit 7838c8
extern int _TIFFDataSize(TIFFDataType type);
Packit 7838c8
Packit 7838c8
extern void _TIFFsetByteArray(void**, void*, uint32);
Packit 7838c8
extern void _TIFFsetString(char**, char*);
Packit 7838c8
extern void _TIFFsetShortArray(uint16**, uint16*, uint32);
Packit 7838c8
extern void _TIFFsetLongArray(uint32**, uint32*, uint32);
Packit 7838c8
extern void _TIFFsetFloatArray(float**, float*, uint32);
Packit 7838c8
extern void _TIFFsetDoubleArray(double**, double*, uint32);
Packit 7838c8
Packit 7838c8
extern void _TIFFprintAscii(FILE*, const char*);
Packit 7838c8
extern void _TIFFprintAsciiTag(FILE*, const char*, const char*);
Packit 7838c8
Packit 7838c8
extern TIFFErrorHandler _TIFFwarningHandler;
Packit 7838c8
extern TIFFErrorHandler _TIFFerrorHandler;
Packit 7838c8
extern TIFFErrorHandlerExt _TIFFwarningHandlerExt;
Packit 7838c8
extern TIFFErrorHandlerExt _TIFFerrorHandlerExt;
Packit 7838c8
Packit 7838c8
extern uint32 _TIFFMultiply32(TIFF*, uint32, uint32, const char*);
Packit 7838c8
extern uint64 _TIFFMultiply64(TIFF*, uint64, uint64, const char*);
Packit 7838c8
extern void* _TIFFCheckMalloc(TIFF*, tmsize_t, tmsize_t, const char*);
Packit 7838c8
extern void* _TIFFCheckRealloc(TIFF*, void*, tmsize_t, tmsize_t, const char*);
Packit 7838c8
Packit 7838c8
extern double _TIFFUInt64ToDouble(uint64);
Packit 7838c8
extern float _TIFFUInt64ToFloat(uint64);
Packit 7838c8
Packit 7838c8
extern tmsize_t
Packit 7838c8
_TIFFReadEncodedStripAndAllocBuffer(TIFF* tif, uint32 strip,
Packit 7838c8
                                    void **buf, tmsize_t bufsizetoalloc,
Packit 7838c8
                                    tmsize_t size_to_read);
Packit 7838c8
extern tmsize_t
Packit 7838c8
_TIFFReadEncodedTileAndAllocBuffer(TIFF* tif, uint32 tile,
Packit 7838c8
                                    void **buf, tmsize_t bufsizetoalloc,
Packit 7838c8
                                    tmsize_t size_to_read);
Packit 7838c8
extern tmsize_t
Packit 7838c8
_TIFFReadTileAndAllocBuffer(TIFF* tif,
Packit 7838c8
                            void **buf, tmsize_t bufsizetoalloc,
Packit 7838c8
                            uint32 x, uint32 y, uint32 z, uint16 s);
Packit 7838c8
extern int _TIFFSeekOK(TIFF* tif, toff_t off);
Packit 7838c8
Packit 7838c8
extern int TIFFInitDumpMode(TIFF*, int);
Packit 7838c8
#ifdef PACKBITS_SUPPORT
Packit 7838c8
extern int TIFFInitPackBits(TIFF*, int);
Packit 7838c8
#endif
Packit 7838c8
#ifdef CCITT_SUPPORT
Packit 7838c8
extern int TIFFInitCCITTRLE(TIFF*, int), TIFFInitCCITTRLEW(TIFF*, int);
Packit 7838c8
extern int TIFFInitCCITTFax3(TIFF*, int), TIFFInitCCITTFax4(TIFF*, int);
Packit 7838c8
#endif
Packit 7838c8
#ifdef THUNDER_SUPPORT
Packit 7838c8
extern int TIFFInitThunderScan(TIFF*, int);
Packit 7838c8
#endif
Packit 7838c8
#ifdef NEXT_SUPPORT
Packit 7838c8
extern int TIFFInitNeXT(TIFF*, int);
Packit 7838c8
#endif
Packit 7838c8
#ifdef LZW_SUPPORT
Packit 7838c8
extern int TIFFInitLZW(TIFF*, int);
Packit 7838c8
#endif
Packit 7838c8
#ifdef OJPEG_SUPPORT
Packit 7838c8
extern int TIFFInitOJPEG(TIFF*, int);
Packit 7838c8
#endif
Packit 7838c8
#ifdef JPEG_SUPPORT
Packit 7838c8
extern int TIFFInitJPEG(TIFF*, int);
Packit 7838c8
extern int TIFFJPEGIsFullStripRequired(TIFF*);
Packit 7838c8
#endif
Packit 7838c8
#ifdef JBIG_SUPPORT
Packit 7838c8
extern int TIFFInitJBIG(TIFF*, int);
Packit 7838c8
#endif
Packit 7838c8
#ifdef ZIP_SUPPORT
Packit 7838c8
extern int TIFFInitZIP(TIFF*, int);
Packit 7838c8
#endif
Packit 7838c8
#ifdef PIXARLOG_SUPPORT
Packit 7838c8
extern int TIFFInitPixarLog(TIFF*, int);
Packit 7838c8
#endif
Packit 7838c8
#ifdef LOGLUV_SUPPORT
Packit 7838c8
extern int TIFFInitSGILog(TIFF*, int);
Packit 7838c8
#endif
Packit 7838c8
#ifdef LZMA_SUPPORT
Packit 7838c8
extern int TIFFInitLZMA(TIFF*, int);
Packit 7838c8
#endif
Packit 7838c8
#ifdef VMS
Packit 7838c8
extern const TIFFCodec _TIFFBuiltinCODECS[];
Packit 7838c8
#else
Packit 7838c8
extern TIFFCodec _TIFFBuiltinCODECS[];
Packit 7838c8
#endif
Packit 7838c8
Packit 7838c8
#if defined(__cplusplus)
Packit 7838c8
}
Packit 7838c8
#endif
Packit 7838c8
#endif /* _TIFFIOP_ */
Packit 7838c8
Packit 7838c8
/* vim: set ts=8 sts=8 sw=8 noet: */
Packit 7838c8
/*
Packit 7838c8
 * Local Variables:
Packit 7838c8
 * mode: c
Packit 7838c8
 * c-basic-offset: 8
Packit 7838c8
 * fill-column: 78
Packit 7838c8
 * End:
Packit 7838c8
 */