38 #define DATATYPE_VOID 0 39 #define DATATYPE_INT 1 40 #define DATATYPE_UINT 2 41 #define DATATYPE_IEEEFP 3 44 setByteArray(
void** vpp,
void* vp,
size_t nmemb,
size_t elem_size)
49 tsize_t bytes = nmemb * elem_size;
50 if (elem_size && bytes / elem_size == nmemb)
57 { setByteArray(vpp, vp, n, 1); }
59 { setByteArray((
void**) cpp, (
void*) cp, strlen(cp)+1, 1); }
61 { setByteArray((
void**) cpp, (
void*) cp, n, 1); }
63 { setByteArray((
void**) wpp, (
void*) wp, n,
sizeof (
uint16)); }
65 { setByteArray((
void**) lpp, (
void*) lp, n,
sizeof (
uint32)); }
67 { setByteArray((
void**) fpp, (
void*) fp, n,
sizeof (
float)); }
69 { setByteArray((
void**) dpp, (
void*) dp, n,
sizeof (
double)); }
84 if (*v > 0 && va ==
NULL)
86 for (i = 0; i < *
v; i++)
95 checkInkNamesString(
TIFF* tif,
uint32 slen,
const char*
s)
101 const char* ep = s+slen;
104 for (; *cp !=
'\0'; cp++)
113 "%s: Invalid InkNames value; expecting %d names, found %d",
121 _TIFFVSetField(
TIFF* tif,
ttag_t tag, va_list ap)
123 static const char module[] =
"_TIFFVSetField";
163 v = va_arg(ap,
uint32) & 0xffff;
200 "Bad value %lu for \"%s\" tag ignored",
273 if (!setExtraSamples(td, ap, &v))
289 "Nonstandard tile width %d, convert file", v32);
300 "Nonstandard tile length %d, convert file", v32);
318 default:
goto badvalue;
362 for (i = 0; i <
v; i++)
368 s = va_arg(ap,
char*);
369 v = checkInkNamesString(tif, v, s);
379 int tv_size, iCustom;
392 "%s: Invalid %stag \"%s\" (not supported by codec)",
425 if (!new_customValues) {
427 "%s: Failed to allocate space for list of custom values",
448 "%s: Bad field type %d for \"%s\"",
487 tv->
count * tv_size);
501 for (i = 0; i < tv->
count; i++, val += tv_size) {
537 int32 v = va_arg(ap, int32);
545 float v = (float)va_arg(ap,
double);
551 double v = va_arg(ap,
double);
612 "%s: Cannot modify tag \"%s\" while writing",
647 return OkToChangeTag(tif, tag) ?
652 _TIFFVGetField(
TIFF* tif,
ttag_t tag, va_list ap)
819 "%s: Invalid %stag \"%s\" (not supported by codec)",
841 *va_arg(ap,
void **) = tv->
value;
853 *va_arg(ap,
void **) = tv->
value;
864 *va_arg(ap,
uint8*) =
879 *va_arg(ap,
int16*) =
890 *va_arg(ap, int32*) =
897 *va_arg(ap,
float*) =
902 *va_arg(ap,
double*) =
950 #define CleanupField(member) { \ 952 _TIFFfree(td->member); \ 1001 _TIFFextender = extender;
1033 size_t tiffFieldInfoCount;
1065 (*_TIFFextender)(tif);
1090 static const char module[] =
"TIFFAdvanceDirectory";
1120 if (!
SeekOK(tif, *nextdir) ||
1154 while (nextdir != 0 && TIFFAdvanceDirectory(tif, &nextdir,
NULL))
1170 for (n = dirn; n > 0 && nextdir != 0; n--)
1171 if (!TIFFAdvanceDirectory(tif, &nextdir,
NULL))
1231 static const char module[] =
"TIFFUnlinkDirectory";
1238 "Can not unlink directory in read-only file");
1248 for (n = dirn-1; n > 0; n--) {
1253 if (!TIFFAdvanceDirectory(tif, &nextdir, &off))
1260 if (!TIFFAdvanceDirectory(tif, &nextdir,
NULL))
1312 static int tagcount = 0 ;
1321 for ( j = 0 ; j < tagcount ; ++j )
1323 if ( TIFFignoretags [j] == TIFFtagID )
1326 TIFFignoretags [tagcount++] = TIFFtagID ;
1332 for ( i = 0 ; i < tagcount ; ++
i )
1334 if ( TIFFignoretags [i] == TIFFtagID )
#define TIFFTAG_SUBFILETYPE
TIFFTagMethods tif_tagmethods
void _TIFFsetString(char **cpp, char *cp)
void _TIFFsetLongArray(uint32 **lpp, uint32 *lp, uint32 n)
for(n=1;n< outline->n_points;n++)
int TIFFReadDirectory(TIFF *tif)
#define TIFFClrFieldBit(tif, field)
#define TIFFTAG_BITSPERSAMPLE
void TIFFWarningExt(thandle_t fd, const char *module, const char *fmt,...)
#define TIFFTAG_ROWSPERSTRIP
int TIFFLastDirectory(TIFF *tif)
#define TIFFTAG_STRIPBYTECOUNTS
#define THRESHHOLD_BILEVEL
#define TIFFTAG_EXTRASAMPLES
#define WriteOK(tif, buf, size)
#define TIFFTAG_ORIENTATION
#define TIFFSeekFile(tif, off, whence)
#define TIFFTAG_IMAGEWIDTH
#define TIFFTAG_YRESOLUTION
#define TIFFTAG_MINSAMPLEVALUE
uint32 TIFFCurrentDirOffset(TIFF *tif)
#define TIFFTAG_FILLORDER
#define FILLORDER_LSB2MSB
uint16 * td_transferfunction[3]
TIFFTagValue * td_customValues
#define TIFFTAG_STRIPOFFSETS
#define TIFFTAG_THRESHHOLDING
void _TIFFSwab32BitData(TIFF *tif, tidata_t buf, tsize_t cc)
#define TIFFTAG_YCBCRSUBSAMPLING
#define TIFFTAG_YPOSITION
#define TIFFTAG_SMINSAMPLEVALUE
#define TIFFTAG_PLANARCONFIG
#define ORIENTATION_TOPLEFT
typedef void(APIENTRY *GLDEBUGPROCARB)(GLenum source
const TIFFFieldInfo * _TIFFGetFieldInfo(size_t *)
#define FIELD_YCBCRSUBSAMPLING
#define TIFFTAG_TILEBYTECOUNTS
unsigned long td_fieldsset[FIELD_SETLONGS]
void _TIFFmemcpy(tdata_t d, const tdata_t s, tsize_t c)
#define TIFFSetFieldBit(tif, field)
#define TIFFTAG_YCBCRPOSITIONING
const TIFFFieldInfo * info
#define TIFFTAG_TILEWIDTH
uint16 td_ycbcrsubsampling[2]
#define YCBCRPOSITION_CENTERED
void _TIFFsetFloatArray(float **fpp, float *fp, uint32 n)
#define TIFFTAG_TILELENGTH
unsigned char field_passcount
#define TIFFTAG_IMAGELENGTH
#define TIFFTAG_TILEOFFSETS
#define TIFFTAG_SAMPLESPERPIXEL
int TIFFVSetField(TIFF *tif, ttag_t tag, va_list ap)
#define SAMPLEFORMAT_VOID
int TIFFSetDirectory(TIFF *tif, tdir_t dirn)
#define CleanupField(member)
void TIFFFreeDirectory(TIFF *tif)
int td_stripbytecountsorted
#define SAMPLEFORMAT_COMPLEXIEEEFP
#define SAMPLEFORMAT_UINT
void TIFFSwabShort(uint16 *wp)
void _TIFFsetNString(char **cpp, char *cp, uint32 n)
#define RESUNIT_CENTIMETER
#define SAMPLEFORMAT_IEEEFP
TIFFPostMethod tif_postdecode
#define TIFFTAG_XPOSITION
#define TIFFTAG_HALFTONEHINTS
void * _TIFFrealloc(tdata_t p, tsize_t s)
uint16 td_halftonehints[2]
void TIFFErrorExt(thandle_t fd, const char *module, const char *fmt,...)
#define TIFFTAG_PHOTOMETRIC
#define EXTRASAMPLE_UNASSALPHA
#define TIFFFieldSet(tif, field)
#define TIFFTAG_PAGENUMBER
int TIFFReassignTagToIgnore(enum TIFFIgnoreSense task, int TIFFtagID)
void _TIFFsetByteArray(void **vpp, void *vp, uint32 n)
#define FIELD_COMPRESSION
void(* TIFFExtendProc)(TIFF *)
double td_smaxsamplevalue
#define TIFFTAG_TRANSFERFUNCTION
#define TIFFTAG_COMPRESSION
#define PLANARCONFIG_SEPARATE
TIFFVoidMethod tif_cleanup
void _TIFFmemset(tdata_t p, int v, tsize_t c)
#define TIFFTAG_SMAXSAMPLEVALUE
void _TIFFNoPostDecode(TIFF *tif, tidata_t buf, tsize_t cc)
uint16 td_samplesperpixel
#define FIELD_YCBCRPOSITIONING
void _TIFFSwab24BitData(TIFF *tif, tidata_t buf, tsize_t cc)
int _TIFFDataSize(TIFFDataType type)
int TIFFUnlinkDirectory(TIFF *tif, tdir_t dirn)
int TIFFVGetField(TIFF *tif, ttag_t tag, va_list ap)
const TIFFFieldInfo * _TIFFFieldWithTag(TIFF *tif, ttag_t tag)
double td_sminsamplevalue
void _TIFFSwab16BitData(TIFF *tif, tidata_t buf, tsize_t cc)
#define TIFFTAG_TILEDEPTH
#define TIFFTAG_IMAGEDEPTH
#define TIFFTAG_RESOLUTIONUNIT
void TIFFSwabLong(uint32 *lp)
uint16 td_ycbcrpositioning
#define TIFFTAG_XRESOLUTION
void _TIFFSwab64BitData(TIFF *tif, tidata_t buf, tsize_t cc)
#define FIELD_TILEDIMENSIONS
int TIFFSetCompressionScheme(TIFF *tif, int scheme)
const TIFFFieldInfo * tif_foundfield
int TIFFSetField(TIFF *tif, ttag_t tag,...)
unsigned char field_oktochange
TIFFExtendProc TIFFSetTagExtender(TIFFExtendProc extender)
#define SAMPLEFORMAT_COMPLEXINT
const TIFFFieldInfo * _TIFFFindFieldInfo(TIFF *tif, ttag_t tag, TIFFDataType dt)
void * _TIFFmalloc(tsize_t s)
int TIFFDefaultDirectory(TIFF *tif)
void _TIFFsetShortArray(uint16 **wpp, uint16 *wp, uint32 n)
#define ReadOK(file, buffer, len)
int TIFFGetField(TIFF *tif, ttag_t tag,...)
void _TIFFfree(tdata_t p)
tdir_t TIFFNumberOfDirectories(TIFF *tif)
int TIFFCreateDirectory(TIFF *tif)
#define TIFFTAG_SAMPLEFORMAT
#define EXTRASAMPLE_ASSOCALPHA
int TIFFSetSubDirectory(TIFF *tif, uint32 diroff)
void _TIFFsetDoubleArray(double **dpp, double *dp, uint32 n)
#define ORIENTATION_LEFTBOT
#define FILLORDER_MSB2LSB
#define TIFFTAG_MAXSAMPLEVALUE
#define PLANARCONFIG_CONTIG
void _TIFFSetupFieldInfo(TIFF *, const TIFFFieldInfo[], size_t)
uint32 * td_stripbytecount