|
Packit |
994f1a |
/* $Id: tiffio.h,v 1.56.2.4 2010-06-08 18:50:43 bfriesen Exp $ */
|
|
Packit |
994f1a |
|
|
Packit |
994f1a |
/*
|
|
Packit |
994f1a |
* Copyright (c) 1988-1997 Sam Leffler
|
|
Packit |
994f1a |
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
|
|
Packit |
994f1a |
*
|
|
Packit |
994f1a |
* Permission to use, copy, modify, distribute, and sell this software and
|
|
Packit |
994f1a |
* its documentation for any purpose is hereby granted without fee, provided
|
|
Packit |
994f1a |
* that (i) the above copyright notices and this permission notice appear in
|
|
Packit |
994f1a |
* all copies of the software and related documentation, and (ii) the names of
|
|
Packit |
994f1a |
* Sam Leffler and Silicon Graphics may not be used in any advertising or
|
|
Packit |
994f1a |
* publicity relating to the software without the specific, prior written
|
|
Packit |
994f1a |
* permission of Sam Leffler and Silicon Graphics.
|
|
Packit |
994f1a |
*
|
|
Packit |
994f1a |
* THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
|
|
Packit |
994f1a |
* EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
|
|
Packit |
994f1a |
* WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
|
|
Packit |
994f1a |
*
|
|
Packit |
994f1a |
* IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
|
|
Packit |
994f1a |
* ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
|
|
Packit |
994f1a |
* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
|
Packit |
994f1a |
* WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
|
|
Packit |
994f1a |
* LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
|
Packit |
994f1a |
* OF THIS SOFTWARE.
|
|
Packit |
994f1a |
*/
|
|
Packit |
994f1a |
|
|
Packit |
994f1a |
#ifndef _TIFFIO_
|
|
Packit |
994f1a |
#define _TIFFIO_
|
|
Packit |
994f1a |
|
|
Packit |
994f1a |
/*
|
|
Packit |
994f1a |
* TIFF I/O Library Definitions.
|
|
Packit |
994f1a |
*/
|
|
Packit |
994f1a |
#include "tiff.h"
|
|
Packit |
994f1a |
#include "tiffvers.h"
|
|
Packit |
994f1a |
|
|
Packit |
994f1a |
/*
|
|
Packit |
994f1a |
* TIFF is defined as an incomplete type to hide the
|
|
Packit |
994f1a |
* library's internal data structures from clients.
|
|
Packit |
994f1a |
*/
|
|
Packit |
994f1a |
typedef struct tiff TIFF;
|
|
Packit |
994f1a |
|
|
Packit |
994f1a |
/*
|
|
Packit |
994f1a |
* The following typedefs define the intrinsic size of
|
|
Packit |
994f1a |
* data types used in the *exported* interfaces. These
|
|
Packit |
994f1a |
* definitions depend on the proper definition of types
|
|
Packit |
994f1a |
* in tiff.h. Note also that the varargs interface used
|
|
Packit |
994f1a |
* to pass tag types and values uses the types defined in
|
|
Packit |
994f1a |
* tiff.h directly.
|
|
Packit |
994f1a |
*
|
|
Packit |
994f1a |
* NB: ttag_t is unsigned int and not unsigned short because
|
|
Packit |
994f1a |
* ANSI C requires that the type before the ellipsis be a
|
|
Packit |
994f1a |
* promoted type (i.e. one of int, unsigned int, pointer,
|
|
Packit |
994f1a |
* or double) and because we defined pseudo-tags that are
|
|
Packit |
994f1a |
* outside the range of legal Aldus-assigned tags.
|
|
Packit |
994f1a |
* NB: tsize_t is int32 and not uint32 because some functions
|
|
Packit |
994f1a |
* return -1.
|
|
Packit |
994f1a |
* NB: toff_t is not off_t for many reasons; TIFFs max out at
|
|
Packit |
994f1a |
* 32-bit file offsets being the most important, and to ensure
|
|
Packit |
994f1a |
* that it is unsigned, rather than signed.
|
|
Packit |
994f1a |
*/
|
|
Packit |
994f1a |
typedef uint32 ttag_t; /* directory tag */
|
|
Packit |
994f1a |
typedef uint16 tdir_t; /* directory index */
|
|
Packit |
994f1a |
typedef uint16 tsample_t; /* sample number */
|
|
Packit |
994f1a |
typedef uint32 tstrile_t; /* strip or tile number */
|
|
Packit |
994f1a |
typedef tstrile_t tstrip_t; /* strip number */
|
|
Packit |
994f1a |
typedef tstrile_t ttile_t; /* tile number */
|
|
Packit |
994f1a |
typedef int32 tsize_t; /* i/o size in bytes */
|
|
Packit |
994f1a |
typedef void* tdata_t; /* image data ref */
|
|
Packit |
994f1a |
typedef uint32 toff_t; /* file offset */
|
|
Packit |
994f1a |
|
|
Packit |
994f1a |
#if !defined(__WIN32__) && (defined(_WIN32) || defined(WIN32))
|
|
Packit |
994f1a |
#define __WIN32__
|
|
Packit |
994f1a |
#endif
|
|
Packit |
994f1a |
|
|
Packit |
994f1a |
/*
|
|
Packit |
994f1a |
* On windows you should define USE_WIN32_FILEIO if you are using tif_win32.c
|
|
Packit |
994f1a |
* or AVOID_WIN32_FILEIO if you are using something else (like tif_unix.c).
|
|
Packit |
994f1a |
*
|
|
Packit |
994f1a |
* By default tif_unix.c is assumed.
|
|
Packit |
994f1a |
*/
|
|
Packit |
994f1a |
|
|
Packit |
994f1a |
#if defined(_WINDOWS) || defined(__WIN32__) || defined(_Windows)
|
|
Packit |
994f1a |
# if !defined(__CYGWIN) && !defined(AVOID_WIN32_FILEIO) && !defined(USE_WIN32_FILEIO)
|
|
Packit |
994f1a |
# define AVOID_WIN32_FILEIO
|
|
Packit |
994f1a |
# endif
|
|
Packit |
994f1a |
#endif
|
|
Packit |
994f1a |
|
|
Packit |
994f1a |
#if defined(USE_WIN32_FILEIO)
|
|
Packit |
994f1a |
# define VC_EXTRALEAN
|
|
Packit |
994f1a |
# include <windows.h>
|
|
Packit |
994f1a |
# ifdef __WIN32__
|
|
Packit |
994f1a |
DECLARE_HANDLE(thandle_t); /* Win32 file handle */
|
|
Packit |
994f1a |
# else
|
|
Packit |
994f1a |
typedef HFILE thandle_t; /* client data handle */
|
|
Packit |
994f1a |
# endif /* __WIN32__ */
|
|
Packit |
994f1a |
#else
|
|
Packit |
994f1a |
typedef void* thandle_t; /* client data handle */
|
|
Packit |
994f1a |
#endif /* USE_WIN32_FILEIO */
|
|
Packit |
994f1a |
|
|
Packit |
994f1a |
/*
|
|
Packit |
994f1a |
* Flags to pass to TIFFPrintDirectory to control
|
|
Packit |
994f1a |
* printing of data structures that are potentially
|
|
Packit |
994f1a |
* very large. Bit-or these flags to enable printing
|
|
Packit |
994f1a |
* multiple items.
|
|
Packit |
994f1a |
*/
|
|
Packit |
994f1a |
#define TIFFPRINT_NONE 0x0 /* no extra info */
|
|
Packit |
994f1a |
#define TIFFPRINT_STRIPS 0x1 /* strips/tiles info */
|
|
Packit |
994f1a |
#define TIFFPRINT_CURVES 0x2 /* color/gray response curves */
|
|
Packit |
994f1a |
#define TIFFPRINT_COLORMAP 0x4 /* colormap */
|
|
Packit |
994f1a |
#define TIFFPRINT_JPEGQTABLES 0x100 /* JPEG Q matrices */
|
|
Packit |
994f1a |
#define TIFFPRINT_JPEGACTABLES 0x200 /* JPEG AC tables */
|
|
Packit |
994f1a |
#define TIFFPRINT_JPEGDCTABLES 0x200 /* JPEG DC tables */
|
|
Packit |
994f1a |
|
|
Packit |
994f1a |
/*
|
|
Packit |
994f1a |
* Colour conversion stuff
|
|
Packit |
994f1a |
*/
|
|
Packit |
994f1a |
|
|
Packit |
994f1a |
/* reference white */
|
|
Packit |
994f1a |
#define D65_X0 (95.0470F)
|
|
Packit |
994f1a |
#define D65_Y0 (100.0F)
|
|
Packit |
994f1a |
#define D65_Z0 (108.8827F)
|
|
Packit |
994f1a |
|
|
Packit |
994f1a |
#define D50_X0 (96.4250F)
|
|
Packit |
994f1a |
#define D50_Y0 (100.0F)
|
|
Packit |
994f1a |
#define D50_Z0 (82.4680F)
|
|
Packit |
994f1a |
|
|
Packit |
994f1a |
/* Structure for holding information about a display device. */
|
|
Packit |
994f1a |
|
|
Packit |
994f1a |
typedef unsigned char TIFFRGBValue; /* 8-bit samples */
|
|
Packit |
994f1a |
|
|
Packit |
994f1a |
typedef struct {
|
|
Packit |
994f1a |
float d_mat[3][3]; /* XYZ -> luminance matrix */
|
|
Packit |
994f1a |
float d_YCR; /* Light o/p for reference white */
|
|
Packit |
994f1a |
float d_YCG;
|
|
Packit |
994f1a |
float d_YCB;
|
|
Packit |
994f1a |
uint32 d_Vrwr; /* Pixel values for ref. white */
|
|
Packit |
994f1a |
uint32 d_Vrwg;
|
|
Packit |
994f1a |
uint32 d_Vrwb;
|
|
Packit |
994f1a |
float d_Y0R; /* Residual light for black pixel */
|
|
Packit |
994f1a |
float d_Y0G;
|
|
Packit |
994f1a |
float d_Y0B;
|
|
Packit |
994f1a |
float d_gammaR; /* Gamma values for the three guns */
|
|
Packit |
994f1a |
float d_gammaG;
|
|
Packit |
994f1a |
float d_gammaB;
|
|
Packit |
994f1a |
} TIFFDisplay;
|
|
Packit |
994f1a |
|
|
Packit |
994f1a |
typedef struct { /* YCbCr->RGB support */
|
|
Packit |
994f1a |
TIFFRGBValue* clamptab; /* range clamping table */
|
|
Packit |
994f1a |
int* Cr_r_tab;
|
|
Packit |
994f1a |
int* Cb_b_tab;
|
|
Packit |
994f1a |
int32* Cr_g_tab;
|
|
Packit |
994f1a |
int32* Cb_g_tab;
|
|
Packit |
994f1a |
int32* Y_tab;
|
|
Packit |
994f1a |
} TIFFYCbCrToRGB;
|
|
Packit |
994f1a |
|
|
Packit |
994f1a |
typedef struct { /* CIE Lab 1976->RGB support */
|
|
Packit |
994f1a |
int range; /* Size of conversion table */
|
|
Packit |
994f1a |
#define CIELABTORGB_TABLE_RANGE 1500
|
|
Packit |
994f1a |
float rstep, gstep, bstep;
|
|
Packit |
994f1a |
float X0, Y0, Z0; /* Reference white point */
|
|
Packit |
994f1a |
TIFFDisplay display;
|
|
Packit |
994f1a |
float Yr2r[CIELABTORGB_TABLE_RANGE + 1]; /* Conversion of Yr to r */
|
|
Packit |
994f1a |
float Yg2g[CIELABTORGB_TABLE_RANGE + 1]; /* Conversion of Yg to g */
|
|
Packit |
994f1a |
float Yb2b[CIELABTORGB_TABLE_RANGE + 1]; /* Conversion of Yb to b */
|
|
Packit |
994f1a |
} TIFFCIELabToRGB;
|
|
Packit |
994f1a |
|
|
Packit |
994f1a |
/*
|
|
Packit |
994f1a |
* RGBA-style image support.
|
|
Packit |
994f1a |
*/
|
|
Packit |
994f1a |
typedef struct _TIFFRGBAImage TIFFRGBAImage;
|
|
Packit |
994f1a |
/*
|
|
Packit |
994f1a |
* The image reading and conversion routines invoke
|
|
Packit |
994f1a |
* ``put routines'' to copy/image/whatever tiles of
|
|
Packit |
994f1a |
* raw image data. A default set of routines are
|
|
Packit |
994f1a |
* provided to convert/copy raw image data to 8-bit
|
|
Packit |
994f1a |
* packed ABGR format rasters. Applications can supply
|
|
Packit |
994f1a |
* alternate routines that unpack the data into a
|
|
Packit |
994f1a |
* different format or, for example, unpack the data
|
|
Packit |
994f1a |
* and draw the unpacked raster on the display.
|
|
Packit |
994f1a |
*/
|
|
Packit |
994f1a |
typedef void (*tileContigRoutine)
|
|
Packit |
994f1a |
(TIFFRGBAImage*, uint32*, uint32, uint32, uint32, uint32, int32, int32,
|
|
Packit |
994f1a |
unsigned char*);
|
|
Packit |
994f1a |
typedef void (*tileSeparateRoutine)
|
|
Packit |
994f1a |
(TIFFRGBAImage*, uint32*, uint32, uint32, uint32, uint32, int32, int32,
|
|
Packit |
994f1a |
unsigned char*, unsigned char*, unsigned char*, unsigned char*);
|
|
Packit |
994f1a |
/*
|
|
Packit |
994f1a |
* RGBA-reader state.
|
|
Packit |
994f1a |
*/
|
|
Packit |
994f1a |
struct _TIFFRGBAImage {
|
|
Packit |
994f1a |
TIFF* tif; /* image handle */
|
|
Packit |
994f1a |
int stoponerr; /* stop on read error */
|
|
Packit |
994f1a |
int isContig; /* data is packed/separate */
|
|
Packit |
994f1a |
int alpha; /* type of alpha data present */
|
|
Packit |
994f1a |
uint32 width; /* image width */
|
|
Packit |
994f1a |
uint32 height; /* image height */
|
|
Packit |
994f1a |
uint16 bitspersample; /* image bits/sample */
|
|
Packit |
994f1a |
uint16 samplesperpixel; /* image samples/pixel */
|
|
Packit |
994f1a |
uint16 orientation; /* image orientation */
|
|
Packit |
994f1a |
uint16 req_orientation; /* requested orientation */
|
|
Packit |
994f1a |
uint16 photometric; /* image photometric interp */
|
|
Packit |
994f1a |
uint16* redcmap; /* colormap pallete */
|
|
Packit |
994f1a |
uint16* greencmap;
|
|
Packit |
994f1a |
uint16* bluecmap;
|
|
Packit |
994f1a |
/* get image data routine */
|
|
Packit |
994f1a |
int (*get)(TIFFRGBAImage*, uint32*, uint32, uint32);
|
|
Packit |
994f1a |
/* put decoded strip/tile */
|
|
Packit |
994f1a |
union {
|
|
Packit |
994f1a |
void (*any)(TIFFRGBAImage*);
|
|
Packit |
994f1a |
tileContigRoutine contig;
|
|
Packit |
994f1a |
tileSeparateRoutine separate;
|
|
Packit |
994f1a |
} put;
|
|
Packit |
994f1a |
TIFFRGBValue* Map; /* sample mapping array */
|
|
Packit |
994f1a |
uint32** BWmap; /* black&white map */
|
|
Packit |
994f1a |
uint32** PALmap; /* palette image map */
|
|
Packit |
994f1a |
TIFFYCbCrToRGB* ycbcr; /* YCbCr conversion state */
|
|
Packit |
994f1a |
TIFFCIELabToRGB* cielab; /* CIE L*a*b conversion state */
|
|
Packit |
994f1a |
|
|
Packit |
994f1a |
int row_offset;
|
|
Packit |
994f1a |
int col_offset;
|
|
Packit |
994f1a |
};
|
|
Packit |
994f1a |
|
|
Packit |
994f1a |
/*
|
|
Packit |
994f1a |
* Macros for extracting components from the
|
|
Packit |
994f1a |
* packed ABGR form returned by TIFFReadRGBAImage.
|
|
Packit |
994f1a |
*/
|
|
Packit |
994f1a |
#define TIFFGetR(abgr) ((abgr) & 0xff)
|
|
Packit |
994f1a |
#define TIFFGetG(abgr) (((abgr) >> 8) & 0xff)
|
|
Packit |
994f1a |
#define TIFFGetB(abgr) (((abgr) >> 16) & 0xff)
|
|
Packit |
994f1a |
#define TIFFGetA(abgr) (((abgr) >> 24) & 0xff)
|
|
Packit |
994f1a |
|
|
Packit |
994f1a |
/*
|
|
Packit |
994f1a |
* A CODEC is a software package that implements decoding,
|
|
Packit |
994f1a |
* encoding, or decoding+encoding of a compression algorithm.
|
|
Packit |
994f1a |
* The library provides a collection of builtin codecs.
|
|
Packit |
994f1a |
* More codecs may be registered through calls to the library
|
|
Packit |
994f1a |
* and/or the builtin implementations may be overridden.
|
|
Packit |
994f1a |
*/
|
|
Packit |
994f1a |
typedef int (*TIFFInitMethod)(TIFF*, int);
|
|
Packit |
994f1a |
typedef struct {
|
|
Packit |
994f1a |
char* name;
|
|
Packit |
994f1a |
uint16 scheme;
|
|
Packit |
994f1a |
TIFFInitMethod init;
|
|
Packit |
994f1a |
} TIFFCodec;
|
|
Packit |
994f1a |
|
|
Packit |
994f1a |
#include <stdio.h>
|
|
Packit |
994f1a |
#include <stdarg.h>
|
|
Packit |
994f1a |
|
|
Packit |
994f1a |
/* share internal LogLuv conversion routines? */
|
|
Packit |
994f1a |
#ifndef LOGLUV_PUBLIC
|
|
Packit |
994f1a |
#define LOGLUV_PUBLIC 1
|
|
Packit |
994f1a |
#endif
|
|
Packit |
994f1a |
|
|
Packit |
994f1a |
#if !defined(__GNUC__) && !defined(__attribute__)
|
|
Packit |
994f1a |
# define __attribute__(x) /*nothing*/
|
|
Packit |
994f1a |
#endif
|
|
Packit |
994f1a |
|
|
Packit |
994f1a |
#if defined(c_plusplus) || defined(__cplusplus)
|
|
Packit |
994f1a |
extern "C" {
|
|
Packit |
994f1a |
#endif
|
|
Packit |
994f1a |
typedef void (*TIFFErrorHandler)(const char*, const char*, va_list);
|
|
Packit |
994f1a |
typedef void (*TIFFErrorHandlerExt)(thandle_t, const char*, const char*, va_list);
|
|
Packit |
994f1a |
typedef tsize_t (*TIFFReadWriteProc)(thandle_t, tdata_t, tsize_t);
|
|
Packit |
994f1a |
typedef toff_t (*TIFFSeekProc)(thandle_t, toff_t, int);
|
|
Packit |
994f1a |
typedef int (*TIFFCloseProc)(thandle_t);
|
|
Packit |
994f1a |
typedef toff_t (*TIFFSizeProc)(thandle_t);
|
|
Packit |
994f1a |
typedef int (*TIFFMapFileProc)(thandle_t, tdata_t*, toff_t*);
|
|
Packit |
994f1a |
typedef void (*TIFFUnmapFileProc)(thandle_t, tdata_t, toff_t);
|
|
Packit |
994f1a |
typedef void (*TIFFExtendProc)(TIFF*);
|
|
Packit |
994f1a |
|
|
Packit |
994f1a |
extern const char* TIFFGetVersion(void);
|
|
Packit |
994f1a |
|
|
Packit |
994f1a |
extern const TIFFCodec* TIFFFindCODEC(uint16);
|
|
Packit |
994f1a |
extern TIFFCodec* TIFFRegisterCODEC(uint16, const char*, TIFFInitMethod);
|
|
Packit |
994f1a |
extern void TIFFUnRegisterCODEC(TIFFCodec*);
|
|
Packit |
994f1a |
extern int TIFFIsCODECConfigured(uint16);
|
|
Packit |
994f1a |
extern TIFFCodec* TIFFGetConfiguredCODECs(void);
|
|
Packit |
994f1a |
|
|
Packit |
994f1a |
/*
|
|
Packit |
994f1a |
* Auxiliary functions.
|
|
Packit |
994f1a |
*/
|
|
Packit |
994f1a |
|
|
Packit |
994f1a |
extern tdata_t _TIFFmalloc(tsize_t);
|
|
Packit Service |
6151d9 |
extern tdata_t _TIFFcalloc(tsize_t, tsize_t);
|
|
Packit |
994f1a |
extern tdata_t _TIFFrealloc(tdata_t, tsize_t);
|
|
Packit |
994f1a |
extern void _TIFFmemset(tdata_t, int, tsize_t);
|
|
Packit |
994f1a |
extern void _TIFFmemcpy(tdata_t, const tdata_t, tsize_t);
|
|
Packit |
994f1a |
extern int _TIFFmemcmp(const tdata_t, const tdata_t, tsize_t);
|
|
Packit |
994f1a |
extern void _TIFFfree(tdata_t);
|
|
Packit |
994f1a |
|
|
Packit |
994f1a |
/*
|
|
Packit |
994f1a |
** Stuff, related to tag handling and creating custom tags.
|
|
Packit |
994f1a |
*/
|
|
Packit |
994f1a |
extern int TIFFGetTagListCount( TIFF * );
|
|
Packit |
994f1a |
extern ttag_t TIFFGetTagListEntry( TIFF *, int tag_index );
|
|
Packit |
994f1a |
|
|
Packit |
994f1a |
#define TIFF_ANY TIFF_NOTYPE /* for field descriptor searching */
|
|
Packit |
994f1a |
#define TIFF_VARIABLE -1 /* marker for variable length tags */
|
|
Packit |
994f1a |
#define TIFF_SPP -2 /* marker for SamplesPerPixel tags */
|
|
Packit |
994f1a |
#define TIFF_VARIABLE2 -3 /* marker for uint32 var-length tags */
|
|
Packit |
994f1a |
|
|
Packit |
994f1a |
#define FIELD_CUSTOM 65
|
|
Packit |
994f1a |
|
|
Packit |
994f1a |
typedef struct {
|
|
Packit |
994f1a |
ttag_t field_tag; /* field's tag */
|
|
Packit |
994f1a |
short field_readcount; /* read count/TIFF_VARIABLE/TIFF_SPP */
|
|
Packit |
994f1a |
short field_writecount; /* write count/TIFF_VARIABLE */
|
|
Packit |
994f1a |
TIFFDataType field_type; /* type of associated data */
|
|
Packit |
994f1a |
unsigned short field_bit; /* bit in fieldsset bit vector */
|
|
Packit |
994f1a |
unsigned char field_oktochange; /* if true, can change while writing */
|
|
Packit |
994f1a |
unsigned char field_passcount; /* if true, pass dir count on set */
|
|
Packit |
994f1a |
char *field_name; /* ASCII name */
|
|
Packit |
994f1a |
} TIFFFieldInfo;
|
|
Packit |
994f1a |
|
|
Packit |
994f1a |
typedef struct _TIFFTagValue {
|
|
Packit |
994f1a |
const TIFFFieldInfo *info;
|
|
Packit |
994f1a |
int count;
|
|
Packit |
994f1a |
void *value;
|
|
Packit |
994f1a |
} TIFFTagValue;
|
|
Packit |
994f1a |
|
|
Packit |
994f1a |
extern void TIFFMergeFieldInfo(TIFF*, const TIFFFieldInfo[], int);
|
|
Packit |
994f1a |
extern const TIFFFieldInfo* TIFFFindFieldInfo(TIFF*, ttag_t, TIFFDataType);
|
|
Packit |
994f1a |
extern const TIFFFieldInfo* TIFFFindFieldInfoByName(TIFF* , const char *,
|
|
Packit |
994f1a |
TIFFDataType);
|
|
Packit |
994f1a |
extern const TIFFFieldInfo* TIFFFieldWithTag(TIFF*, ttag_t);
|
|
Packit |
994f1a |
extern const TIFFFieldInfo* TIFFFieldWithName(TIFF*, const char *);
|
|
Packit |
994f1a |
|
|
Packit |
994f1a |
typedef int (*TIFFVSetMethod)(TIFF*, ttag_t, va_list);
|
|
Packit |
994f1a |
typedef int (*TIFFVGetMethod)(TIFF*, ttag_t, va_list);
|
|
Packit |
994f1a |
typedef void (*TIFFPrintMethod)(TIFF*, FILE*, long);
|
|
Packit |
994f1a |
|
|
Packit |
994f1a |
typedef struct {
|
|
Packit |
994f1a |
TIFFVSetMethod vsetfield; /* tag set routine */
|
|
Packit |
994f1a |
TIFFVGetMethod vgetfield; /* tag get routine */
|
|
Packit |
994f1a |
TIFFPrintMethod printdir; /* directory print routine */
|
|
Packit |
994f1a |
} TIFFTagMethods;
|
|
Packit |
994f1a |
|
|
Packit |
994f1a |
extern TIFFTagMethods *TIFFAccessTagMethods( TIFF * );
|
|
Packit |
994f1a |
extern void *TIFFGetClientInfo( TIFF *, const char * );
|
|
Packit |
994f1a |
extern void TIFFSetClientInfo( TIFF *, void *, const char * );
|
|
Packit |
994f1a |
|
|
Packit |
994f1a |
extern void TIFFCleanup(TIFF*);
|
|
Packit |
994f1a |
extern void TIFFClose(TIFF*);
|
|
Packit |
994f1a |
extern int TIFFFlush(TIFF*);
|
|
Packit |
994f1a |
extern int TIFFFlushData(TIFF*);
|
|
Packit |
994f1a |
extern int TIFFGetField(TIFF*, ttag_t, ...);
|
|
Packit |
994f1a |
extern int TIFFVGetField(TIFF*, ttag_t, va_list);
|
|
Packit |
994f1a |
extern int TIFFGetFieldDefaulted(TIFF*, ttag_t, ...);
|
|
Packit |
994f1a |
extern int TIFFVGetFieldDefaulted(TIFF*, ttag_t, va_list);
|
|
Packit |
994f1a |
extern int TIFFReadDirectory(TIFF*);
|
|
Packit |
994f1a |
extern int TIFFReadCustomDirectory(TIFF*, toff_t, const TIFFFieldInfo[],
|
|
Packit |
994f1a |
size_t);
|
|
Packit |
994f1a |
extern int TIFFReadEXIFDirectory(TIFF*, toff_t);
|
|
Packit |
994f1a |
extern tsize_t TIFFScanlineSize(TIFF*);
|
|
Packit |
994f1a |
extern tsize_t TIFFOldScanlineSize(TIFF*);
|
|
Packit |
994f1a |
extern tsize_t TIFFNewScanlineSize(TIFF*);
|
|
Packit |
994f1a |
extern tsize_t TIFFRasterScanlineSize(TIFF*);
|
|
Packit |
994f1a |
extern tsize_t TIFFStripSize(TIFF*);
|
|
Packit |
994f1a |
extern tsize_t TIFFRawStripSize(TIFF*, tstrip_t);
|
|
Packit |
994f1a |
extern tsize_t TIFFVStripSize(TIFF*, uint32);
|
|
Packit |
994f1a |
extern tsize_t TIFFTileRowSize(TIFF*);
|
|
Packit |
994f1a |
extern tsize_t TIFFTileSize(TIFF*);
|
|
Packit |
994f1a |
extern tsize_t TIFFVTileSize(TIFF*, uint32);
|
|
Packit |
994f1a |
extern uint32 TIFFDefaultStripSize(TIFF*, uint32);
|
|
Packit |
994f1a |
extern void TIFFDefaultTileSize(TIFF*, uint32*, uint32*);
|
|
Packit |
994f1a |
extern int TIFFFileno(TIFF*);
|
|
Packit |
994f1a |
extern int TIFFSetFileno(TIFF*, int);
|
|
Packit |
994f1a |
extern thandle_t TIFFClientdata(TIFF*);
|
|
Packit |
994f1a |
extern thandle_t TIFFSetClientdata(TIFF*, thandle_t);
|
|
Packit |
994f1a |
extern int TIFFGetMode(TIFF*);
|
|
Packit |
994f1a |
extern int TIFFSetMode(TIFF*, int);
|
|
Packit |
994f1a |
extern int TIFFIsTiled(TIFF*);
|
|
Packit |
994f1a |
extern int TIFFIsByteSwapped(TIFF*);
|
|
Packit |
994f1a |
extern int TIFFIsUpSampled(TIFF*);
|
|
Packit |
994f1a |
extern int TIFFIsMSB2LSB(TIFF*);
|
|
Packit |
994f1a |
extern int TIFFIsBigEndian(TIFF*);
|
|
Packit |
994f1a |
extern TIFFReadWriteProc TIFFGetReadProc(TIFF*);
|
|
Packit |
994f1a |
extern TIFFReadWriteProc TIFFGetWriteProc(TIFF*);
|
|
Packit |
994f1a |
extern TIFFSeekProc TIFFGetSeekProc(TIFF*);
|
|
Packit |
994f1a |
extern TIFFCloseProc TIFFGetCloseProc(TIFF*);
|
|
Packit |
994f1a |
extern TIFFSizeProc TIFFGetSizeProc(TIFF*);
|
|
Packit |
994f1a |
extern TIFFMapFileProc TIFFGetMapFileProc(TIFF*);
|
|
Packit |
994f1a |
extern TIFFUnmapFileProc TIFFGetUnmapFileProc(TIFF*);
|
|
Packit |
994f1a |
extern uint32 TIFFCurrentRow(TIFF*);
|
|
Packit |
994f1a |
extern tdir_t TIFFCurrentDirectory(TIFF*);
|
|
Packit |
994f1a |
extern tdir_t TIFFNumberOfDirectories(TIFF*);
|
|
Packit |
994f1a |
extern uint32 TIFFCurrentDirOffset(TIFF*);
|
|
Packit |
994f1a |
extern tstrip_t TIFFCurrentStrip(TIFF*);
|
|
Packit |
994f1a |
extern ttile_t TIFFCurrentTile(TIFF*);
|
|
Packit |
994f1a |
extern int TIFFReadBufferSetup(TIFF*, tdata_t, tsize_t);
|
|
Packit |
994f1a |
extern int TIFFWriteBufferSetup(TIFF*, tdata_t, tsize_t);
|
|
Packit |
994f1a |
extern int TIFFSetupStrips(TIFF *);
|
|
Packit |
994f1a |
extern int TIFFWriteCheck(TIFF*, int, const char *);
|
|
Packit |
994f1a |
extern void TIFFFreeDirectory(TIFF*);
|
|
Packit |
994f1a |
extern int TIFFCreateDirectory(TIFF*);
|
|
Packit |
994f1a |
extern int TIFFLastDirectory(TIFF*);
|
|
Packit |
994f1a |
extern int TIFFSetDirectory(TIFF*, tdir_t);
|
|
Packit |
994f1a |
extern int TIFFSetSubDirectory(TIFF*, uint32);
|
|
Packit |
994f1a |
extern int TIFFUnlinkDirectory(TIFF*, tdir_t);
|
|
Packit |
994f1a |
extern int TIFFSetField(TIFF*, ttag_t, ...);
|
|
Packit |
994f1a |
extern int TIFFVSetField(TIFF*, ttag_t, va_list);
|
|
Packit |
994f1a |
extern int TIFFWriteDirectory(TIFF *);
|
|
Packit |
994f1a |
extern int TIFFCheckpointDirectory(TIFF *);
|
|
Packit |
994f1a |
extern int TIFFRewriteDirectory(TIFF *);
|
|
Packit |
994f1a |
extern int TIFFReassignTagToIgnore(enum TIFFIgnoreSense, int);
|
|
Packit |
994f1a |
|
|
Packit |
994f1a |
#if defined(c_plusplus) || defined(__cplusplus)
|
|
Packit |
994f1a |
extern void TIFFPrintDirectory(TIFF*, FILE*, long = 0);
|
|
Packit |
994f1a |
extern int TIFFReadScanline(TIFF*, tdata_t, uint32, tsample_t = 0);
|
|
Packit |
994f1a |
extern int TIFFWriteScanline(TIFF*, tdata_t, uint32, tsample_t = 0);
|
|
Packit |
994f1a |
extern int TIFFReadRGBAImage(TIFF*, uint32, uint32, uint32*, int = 0);
|
|
Packit |
994f1a |
extern int TIFFReadRGBAImageOriented(TIFF*, uint32, uint32, uint32*,
|
|
Packit |
994f1a |
int = ORIENTATION_BOTLEFT, int = 0);
|
|
Packit |
994f1a |
#else
|
|
Packit |
994f1a |
extern void TIFFPrintDirectory(TIFF*, FILE*, long);
|
|
Packit |
994f1a |
extern int TIFFReadScanline(TIFF*, tdata_t, uint32, tsample_t);
|
|
Packit |
994f1a |
extern int TIFFWriteScanline(TIFF*, tdata_t, uint32, tsample_t);
|
|
Packit |
994f1a |
extern int TIFFReadRGBAImage(TIFF*, uint32, uint32, uint32*, int);
|
|
Packit |
994f1a |
extern int TIFFReadRGBAImageOriented(TIFF*, uint32, uint32, uint32*, int, int);
|
|
Packit |
994f1a |
#endif
|
|
Packit |
994f1a |
|
|
Packit |
994f1a |
extern int TIFFReadRGBAStrip(TIFF*, tstrip_t, uint32 * );
|
|
Packit |
994f1a |
extern int TIFFReadRGBATile(TIFF*, uint32, uint32, uint32 * );
|
|
Packit |
994f1a |
extern int TIFFRGBAImageOK(TIFF*, char [1024]);
|
|
Packit |
994f1a |
extern int TIFFRGBAImageBegin(TIFFRGBAImage*, TIFF*, int, char [1024]);
|
|
Packit |
994f1a |
extern int TIFFRGBAImageGet(TIFFRGBAImage*, uint32*, uint32, uint32);
|
|
Packit |
994f1a |
extern void TIFFRGBAImageEnd(TIFFRGBAImage*);
|
|
Packit |
994f1a |
extern TIFF* TIFFOpen(const char*, const char*);
|
|
Packit |
994f1a |
# ifdef __WIN32__
|
|
Packit |
994f1a |
extern TIFF* TIFFOpenW(const wchar_t*, const char*);
|
|
Packit |
994f1a |
# endif /* __WIN32__ */
|
|
Packit |
994f1a |
extern TIFF* TIFFFdOpen(int, const char*, const char*);
|
|
Packit |
994f1a |
extern TIFF* TIFFClientOpen(const char*, const char*,
|
|
Packit |
994f1a |
thandle_t,
|
|
Packit |
994f1a |
TIFFReadWriteProc, TIFFReadWriteProc,
|
|
Packit |
994f1a |
TIFFSeekProc, TIFFCloseProc,
|
|
Packit |
994f1a |
TIFFSizeProc,
|
|
Packit |
994f1a |
TIFFMapFileProc, TIFFUnmapFileProc);
|
|
Packit |
994f1a |
extern const char* TIFFFileName(TIFF*);
|
|
Packit |
994f1a |
extern const char* TIFFSetFileName(TIFF*, const char *);
|
|
Packit |
994f1a |
extern void TIFFError(const char*, const char*, ...) __attribute__((format (printf,2,3)));
|
|
Packit |
994f1a |
extern void TIFFErrorExt(thandle_t, const char*, const char*, ...) __attribute__((format (printf,3,4)));
|
|
Packit |
994f1a |
extern void TIFFWarning(const char*, const char*, ...) __attribute__((format (printf,2,3)));
|
|
Packit |
994f1a |
extern void TIFFWarningExt(thandle_t, const char*, const char*, ...) __attribute__((format (printf,3,4)));
|
|
Packit |
994f1a |
extern TIFFErrorHandler TIFFSetErrorHandler(TIFFErrorHandler);
|
|
Packit |
994f1a |
extern TIFFErrorHandlerExt TIFFSetErrorHandlerExt(TIFFErrorHandlerExt);
|
|
Packit |
994f1a |
extern TIFFErrorHandler TIFFSetWarningHandler(TIFFErrorHandler);
|
|
Packit |
994f1a |
extern TIFFErrorHandlerExt TIFFSetWarningHandlerExt(TIFFErrorHandlerExt);
|
|
Packit |
994f1a |
extern TIFFExtendProc TIFFSetTagExtender(TIFFExtendProc);
|
|
Packit |
994f1a |
extern ttile_t TIFFComputeTile(TIFF*, uint32, uint32, uint32, tsample_t);
|
|
Packit |
994f1a |
extern int TIFFCheckTile(TIFF*, uint32, uint32, uint32, tsample_t);
|
|
Packit |
994f1a |
extern ttile_t TIFFNumberOfTiles(TIFF*);
|
|
Packit |
994f1a |
extern tsize_t TIFFReadTile(TIFF*,
|
|
Packit |
994f1a |
tdata_t, uint32, uint32, uint32, tsample_t);
|
|
Packit |
994f1a |
extern tsize_t TIFFWriteTile(TIFF*,
|
|
Packit |
994f1a |
tdata_t, uint32, uint32, uint32, tsample_t);
|
|
Packit |
994f1a |
extern tstrip_t TIFFComputeStrip(TIFF*, uint32, tsample_t);
|
|
Packit |
994f1a |
extern tstrip_t TIFFNumberOfStrips(TIFF*);
|
|
Packit |
994f1a |
extern tsize_t TIFFReadEncodedStrip(TIFF*, tstrip_t, tdata_t, tsize_t);
|
|
Packit |
994f1a |
extern tsize_t TIFFReadRawStrip(TIFF*, tstrip_t, tdata_t, tsize_t);
|
|
Packit |
994f1a |
extern tsize_t TIFFReadEncodedTile(TIFF*, ttile_t, tdata_t, tsize_t);
|
|
Packit |
994f1a |
extern tsize_t TIFFReadRawTile(TIFF*, ttile_t, tdata_t, tsize_t);
|
|
Packit |
994f1a |
extern tsize_t TIFFWriteEncodedStrip(TIFF*, tstrip_t, tdata_t, tsize_t);
|
|
Packit |
994f1a |
extern tsize_t TIFFWriteRawStrip(TIFF*, tstrip_t, tdata_t, tsize_t);
|
|
Packit |
994f1a |
extern tsize_t TIFFWriteEncodedTile(TIFF*, ttile_t, tdata_t, tsize_t);
|
|
Packit |
994f1a |
extern tsize_t TIFFWriteRawTile(TIFF*, ttile_t, tdata_t, tsize_t);
|
|
Packit |
994f1a |
extern int TIFFDataWidth(TIFFDataType); /* table of tag datatype widths */
|
|
Packit |
994f1a |
extern void TIFFSetWriteOffset(TIFF*, toff_t);
|
|
Packit |
994f1a |
extern void TIFFSwabShort(uint16*);
|
|
Packit |
994f1a |
extern void TIFFSwabLong(uint32*);
|
|
Packit |
994f1a |
extern void TIFFSwabDouble(double*);
|
|
Packit |
994f1a |
extern void TIFFSwabArrayOfShort(uint16*, unsigned long);
|
|
Packit |
994f1a |
extern void TIFFSwabArrayOfTriples(uint8*, unsigned long);
|
|
Packit |
994f1a |
extern void TIFFSwabArrayOfLong(uint32*, unsigned long);
|
|
Packit |
994f1a |
extern void TIFFSwabArrayOfDouble(double*, unsigned long);
|
|
Packit |
994f1a |
extern void TIFFReverseBits(unsigned char *, unsigned long);
|
|
Packit |
994f1a |
extern const unsigned char* TIFFGetBitRevTable(int);
|
|
Packit |
994f1a |
|
|
Packit |
994f1a |
#ifdef LOGLUV_PUBLIC
|
|
Packit |
994f1a |
#define U_NEU 0.210526316
|
|
Packit |
994f1a |
#define V_NEU 0.473684211
|
|
Packit |
994f1a |
#define UVSCALE 410.
|
|
Packit |
994f1a |
extern double LogL16toY(int);
|
|
Packit |
994f1a |
extern double LogL10toY(int);
|
|
Packit |
994f1a |
extern void XYZtoRGB24(float*, uint8*);
|
|
Packit |
994f1a |
extern int uv_decode(double*, double*, int);
|
|
Packit |
994f1a |
extern void LogLuv24toXYZ(uint32, float*);
|
|
Packit |
994f1a |
extern void LogLuv32toXYZ(uint32, float*);
|
|
Packit |
994f1a |
#if defined(c_plusplus) || defined(__cplusplus)
|
|
Packit |
994f1a |
extern int LogL16fromY(double, int = SGILOGENCODE_NODITHER);
|
|
Packit |
994f1a |
extern int LogL10fromY(double, int = SGILOGENCODE_NODITHER);
|
|
Packit |
994f1a |
extern int uv_encode(double, double, int = SGILOGENCODE_NODITHER);
|
|
Packit |
994f1a |
extern uint32 LogLuv24fromXYZ(float*, int = SGILOGENCODE_NODITHER);
|
|
Packit |
994f1a |
extern uint32 LogLuv32fromXYZ(float*, int = SGILOGENCODE_NODITHER);
|
|
Packit |
994f1a |
#else
|
|
Packit |
994f1a |
extern int LogL16fromY(double, int);
|
|
Packit |
994f1a |
extern int LogL10fromY(double, int);
|
|
Packit |
994f1a |
extern int uv_encode(double, double, int);
|
|
Packit |
994f1a |
extern uint32 LogLuv24fromXYZ(float*, int);
|
|
Packit |
994f1a |
extern uint32 LogLuv32fromXYZ(float*, int);
|
|
Packit |
994f1a |
#endif
|
|
Packit |
994f1a |
#endif /* LOGLUV_PUBLIC */
|
|
Packit |
994f1a |
|
|
Packit |
994f1a |
extern int TIFFCIELabToRGBInit(TIFFCIELabToRGB*, TIFFDisplay *, float*);
|
|
Packit |
994f1a |
extern void TIFFCIELabToXYZ(TIFFCIELabToRGB *, uint32, int32, int32,
|
|
Packit |
994f1a |
float *, float *, float *);
|
|
Packit |
994f1a |
extern void TIFFXYZToRGB(TIFFCIELabToRGB *, float, float, float,
|
|
Packit |
994f1a |
uint32 *, uint32 *, uint32 *);
|
|
Packit |
994f1a |
|
|
Packit |
994f1a |
extern int TIFFYCbCrToRGBInit(TIFFYCbCrToRGB*, float*, float*);
|
|
Packit |
994f1a |
extern void TIFFYCbCrtoRGB(TIFFYCbCrToRGB *, uint32, int32, int32,
|
|
Packit |
994f1a |
uint32 *, uint32 *, uint32 *);
|
|
Packit |
994f1a |
|
|
Packit |
994f1a |
#if defined(c_plusplus) || defined(__cplusplus)
|
|
Packit |
994f1a |
}
|
|
Packit |
994f1a |
#endif
|
|
Packit |
994f1a |
|
|
Packit |
994f1a |
#endif /* _TIFFIO_ */
|
|
Packit |
994f1a |
|
|
Packit |
994f1a |
/* vim: set ts=8 sts=8 sw=8 noet: */
|
|
Packit |
994f1a |
/*
|
|
Packit |
994f1a |
* Local Variables:
|
|
Packit |
994f1a |
* mode: c
|
|
Packit |
994f1a |
* c-basic-offset: 8
|
|
Packit |
994f1a |
* fill-column: 78
|
|
Packit |
994f1a |
* End:
|
|
Packit |
994f1a |
*/
|