35#define TIFFCvtNativeToIEEEFloat(tif, n, fp)
36#define TIFFCvtNativeToIEEEDouble(tif, n, dp)
270 static const char module[] =
"TIFFDeferStrileArrayWriting";
318 static const char module[] =
"TIFFRewriteDirectory";
347 "tif->tif_diroff exceeds 32 bit range allowed for "
360 if (!
SeekOK(tif, nextdir) || !
ReadOK(tif, &dircount, 2))
363 "Error fetching directory count");
369 if (!
ReadOK(tif, &nextnextdir, 4))
385 "Error writing directory link");
393 nextdir = nextnextdir;
423 if (!
SeekOK(tif, nextdir) || !
ReadOK(tif, &dircount64, 8))
426 "Error fetching directory count");
431 if (dircount64 > 0xFFFF)
434 "Sanity check on tag count failed, likely "
440 if (!
ReadOK(tif, &nextnextdir, 8))
456 "Error writing directory link");
464 nextdir = nextnextdir;
491 static const char module[] =
"TIFFWriteDirectorySec";
515 "Error post-encoding before directory write");
532 "Error flushing data before directory write");
553 "Creating TIFF with legacy Deflate codec identifier, "
554 "COMPRESSION_ADOBE_DEFLATE is more widely supported");
942 "Cannot write tag %" PRIu32 " (%s)",
1047 tif,
"TIFFLib: _TIFFWriteDirectorySec()",
1048 "Rational2Double: .set_get_field_type is "
1082 tif,
"TIFFLib: _TIFFWriteDirectorySec()",
1083 "Rational2Double: .set_get_field_type is "
1181 if (pdiroff !=
NULL)
1184 dirsize = 2 + ndir * 12 + 4;
1186 dirsize = 8 + ndir * 20 + 8;
1212 for (na = 0, nb =
dir;; na++, nb++)
1247 for (
m = 0;
m < ndir;
m++)
1283 for (
m = 0;
m < ndir;
m++)
1310 "IO error writing directory at seek to offset");
1342 "tif_curdircount is TIFF_NON_EXISTENT_DIR_NUMBER, "
1343 "not expected !! Line %d",
1376 "Starting directory %u at offset 0x%" PRIx64 " (%" PRIu64
1377 ") might cause an IFD loop",
1424 if (
val > 0x7FFFFFFF)
1426 if (
val < -0x7FFFFFFF - 1 ||
val !=
val)
1427 return -0x7FFFFFFF - 1;
1463 static const char module[] =
"TIFFWriteDirectoryTagSampleformatArray";
1595 static const char module[] =
"TIFFWriteDirectoryTagShortPerSample";
1660 static const char module[] =
"TIFFWriteDirectoryTagLong8Array";
1691 for (
q =
p, ma =
value, mb = 0; mb <
count; ma++, mb++,
q++)
1693 if (*ma > 0xFFFFFFFF)
1696 "Attempt to write unsigned long value %" PRIu64
1697 " larger than 0xFFFFFFFF for tag %d in Classic TIFF "
1698 "file. TIFF file writing aborted",
1721 static const char module[] =
"TIFFWriteDirectoryTagSlong8Array";
1751 for (
q =
p, ma =
value, mb = 0; mb <
count; ma++, mb++,
q++)
1753 if (*ma > (2147483647))
1756 "Attempt to write signed long value %" PRIi64
1757 " larger than 0x7FFFFFFF (2147483647) for tag %d in "
1758 "Classic TIFF file. TIFF writing to file aborted",
1763 else if (*ma < (-2147483647 - 1))
1766 "Attempt to write signed long value %" PRIi64
1767 " smaller than 0x80000000 (-2147483648) for tag %d "
1768 "in Classic TIFF file. TIFF writing to file aborted",
1854 if (
value <= 0xFFFF)
1867 return strile_size > uncompressed_threshold;
1881 return strile_size >= uncompressed_threshold / 10;
1907 static const char module[] =
"TIFFWriteDirectoryTagLongLong8Array";
1927 int write_aslong8 = 1;
1974 for (
q =
p, ma =
value, mb = 0; mb <
count; ma++, mb++,
q++)
1976 if (*ma > 0xFFFFFFFF)
1979 "Attempt to write value larger than 0xFFFFFFFF "
2004 for (
q =
p, ma =
value, mb = 0; mb <
count; ma++, mb++,
q++)
2010 "Attempt to write value larger than 0xFFFF in "
2036 static const char module[] =
"TIFFWriteDirectoryTagIfdIfd8Array";
2060 for (
q =
p, ma =
value, mb = 0; mb <
count; ma++, mb++,
q++)
2062 if (*ma > 0xFFFFFFFF)
2065 "Attempt to write value larger than 0xFFFFFFFF in "
2066 "Classic TIFF file.");
2102 static const char module[] =
"TIFFWriteDirectoryTagColormap";
2131 static const char module[] =
"TIFFWriteDirectoryTagTransferfunction";
2145 for (
int i = 0;
i <
n;
i++)
2150 "Too few TransferFunctions provided. Tag "
2151 "not written to file");
2200 static const char module[] =
"TIFFWriteDirectoryTagSubifd";
2226 if (*
pa > 0xFFFFFFFFUL)
2271 assert(
sizeof(
char) == 1);
2446 TIFFErrorExtR(tif,
"TIFFWriteDirectoryTagCheckedLong8Array",
2447 "LONG8 not allowed for ClassicTIFF");
2470 TIFFErrorExtR(tif,
"TIFFWriteDirectoryTagCheckedSlong8Array",
2471 "SLONG8 not allowed for ClassicTIFF");
2489 static const char module[] =
"TIFFWriteDirectoryTagCheckedRational";
2528 static const char module[] =
"TIFFWriteDirectoryTagCheckedRationalArray";
2546 for (na =
value, nb =
m, nc = 0; nc <
count; na++, nb += 2, nc++)
2564 static const char module[] =
"TIFFWriteDirectoryTagCheckedSrationalArray";
2582 for (na =
value, nb =
m, nc = 0; nc <
count; na++, nb += 2, nc++)
2600 static const char module[] =
2601 "TIFFWriteDirectoryTagCheckedRationalDoubleArray";
2619 for (na =
value, nb =
m, nc = 0; nc <
count; na++, nb += 2, nc++)
2635 static const char module[] =
2636 "TIFFWriteDirectoryTagCheckedSrationalDoubleArray";
2654 for (na =
value, nb =
m, nc = 0; nc <
count; na++, nb += 2, nc++)
2688 int blnUseSmallRange,
uint64_t *ullNum,
2694 uint64_t numSum[3] = {0, 1, 0}, denomSum[3] = {1, 0, 0};
2700 unsigned long maxDenom;
2709 if (blnUseSmallRange)
2711 nMax = (
uint64_t)((2147483647 - 1) / 2);
2715 nMax = ((9223372036854775807 - 1) / 2);
2725 if (blnUseSignedRange)
2727 maxDenom = 2147483647UL;
2728 returnLimit = maxDenom;
2732 maxDenom = 0xFFFFFFFFUL;
2733 returnLimit = maxDenom;
2756#define MAX_ITERATIONS 64
2765 val = bigNum / bigDenom;
2771 bigDenom = aux % bigDenom;
2775 if (denomSum[1] *
val + denomSum[0] >= maxDenom)
2777 aux = (maxDenom - denomSum[0]) / denomSum[1];
2778 if (aux * 2 >=
val || denomSum[1] >= maxDenom)
2786 numSum[2] = aux * numSum[1] + numSum[0];
2787 numSum[0] = numSum[1];
2788 numSum[1] = numSum[2];
2791 denomSum[2] = aux * denomSum[1] + denomSum[0];
2792 denomSum[0] = denomSum[1];
2793 denomSum[1] = denomSum[2];
2798 while (numSum[1] > returnLimit || denomSum[1] > returnLimit)
2800 numSum[1] = numSum[1] / 2;
2801 denomSum[1] = denomSum[1] / 2;
2805 *ullNum = numSum[1];
2806 *ullDenom = denomSum[1];
2818 double dblDiff, dblDiff2;
2819 uint64_t ullNum, ullDenom, ullNum2, ullDenom2;
2827 " Negative Value for Unsigned Rational given.");
2832 if (
value > 0xFFFFFFFFUL)
2846 if (
value < 1.0 / (
double)0xFFFFFFFFUL)
2849 *denom = 0xFFFFFFFFU;
2860 if (ullNum > 0xFFFFFFFFUL || ullDenom > 0xFFFFFFFFUL ||
2861 ullNum2 > 0xFFFFFFFFUL || ullDenom2 > 0xFFFFFFFFUL)
2864 " Num or Denom exceeds ULONG: val=%14.6f, num=%12" PRIu64
2866 ", denom2=%12" PRIu64 "",
2867 value, ullNum, ullDenom, ullNum2, ullDenom2);
2872 dblDiff =
fabs(
value - ((
double)ullNum / (
double)ullDenom));
2873 dblDiff2 =
fabs(
value - ((
double)ullNum2 / (
double)ullDenom2));
2874 if (dblDiff < dblDiff2)
2895 double dblDiff, dblDiff2;
2896 uint64_t ullNum, ullDenom, ullNum2, ullDenom2;
2907 if (
value > 0x7FFFFFFFL)
2921 if (
value < 1.0 / (
double)0x7FFFFFFFL)
2924 *denom = 0x7FFFFFFFL;
2936 if (ullNum > 0x7FFFFFFFL || ullDenom > 0x7FFFFFFFL ||
2937 ullNum2 > 0x7FFFFFFFL || ullDenom2 > 0x7FFFFFFFL)
2940 " Num or Denom exceeds LONG: val=%14.6f, num=%12" PRIu64
2942 ", denom2=%12" PRIu64 "",
2943 neg *
value, ullNum, ullDenom, ullNum2, ullDenom2);
2948 dblDiff =
fabs(
value - ((
double)ullNum / (
double)ullDenom));
2949 dblDiff2 =
fabs(
value - ((
double)ullNum2 / (
double)ullDenom2));
2950 if (dblDiff < dblDiff2)
2968 assert(
sizeof(
float) == 4);
2987 assert(
sizeof(
double) == 8);
3041 static const char module[] =
"TIFFWriteDirectoryTagData";
3054 for (
n = *ndir;
n >
m;
n--)
3058 dir[
m].tdir_type = datatype;
3060 dir[
m].tdir_offset.toff_long8 = 0;
3063 if (
data && datalength)
3072 nb = na + datalength;
3075 if ((nb < na) || (nb < datalength))
3085 if (datalength >= 0x80000000UL)
3088 "libtiff does not allow writing more than 2147483647 "
3110 dir[
m].tdir_offset.toff_long8 = na;
3124 static const char module[] =
"TIFFLinkDirectory";
3143 "Error writing SubIFD directory link");
3167 "Error writing SubIFD directory link");
3234 if (!
SeekOK(tif, nextdir) || !
ReadOK(tif, &dircount, 2))
3242 if (!
ReadOK(tif, &nextnextdir, 4))
3249 if (nextnextdir == 0)
3260 nextdir = nextnextdir;
3312 if (!
SeekOK(tif, nextdir) || !
ReadOK(tif, &dircount64, 8))
3319 if (dircount64 > 0xFFFF)
3322 "Sanity check on tag count failed, "
3323 "likely corrupt TIFF");
3328 if (!
ReadOK(tif, &nextnextdir, 8))
3335 if (nextnextdir == 0)
3346 nextdir = nextnextdir;
3380 static const char module[] =
"TIFFResetField";
3389 int value_in_entry = 0;
3405 "Memory mapped files not currently supported for "
3414 "Attempt to reset field on directory not already on disk.");
3462 while (dircount > 0)
3464 if (!
ReadOK(tif, direntry_raw, dirsize))
3475 if (entry_tag ==
tag)
3478 read_offset += dirsize;
3481 if (entry_tag !=
tag)
3502 entry_count =
value;
3507 entry_offset =
value;
3523 if (entry_offset == 0 && entry_count == 0 && entry_type == 0)
3532 int write_aslong8 = 1;
3547 int write_aslong4 = 1;
3580 datatype = in_datatype;
3587 datatype = entry_type;
3590 datatype = entry_type;
3593 datatype = entry_type;
3595 datatype = in_datatype;
3607 if (datatype == in_datatype)
3620 "Value exceeds 32bit range of output type.");
3638 "Value exceeds 32bit range of output type.");
3655 "Value exceeds 16bit range of output type.");
3683 entry_offset = read_offset + 8;
3691 entry_offset = read_offset + 12;
3721 if (!
SeekOK(tif, entry_offset))
3725 "%s: Seek error accessing TIFF directory",
3743 if (!value_in_entry)
3760 entry_offset =
value;
3764 memcpy(&entry_offset, buf_to_write,
3775 entry_type = datatype;
3809 if (!
SeekOK(tif, read_offset))
3816 if (!
WriteOK(tif, direntry_raw, dirsize))
_In_ fcb _In_ chunk _In_ uint64_t _In_ uint64_t _In_ bool _In_opt_ void _In_opt_ PIRP _In_ LIST_ENTRY _In_ uint8_t compression
double fMax(double a, double b)
_ACRTIMP double __cdecl fabs(double)
_ACRTIMP double __cdecl floor(double)
_ACRTIMP size_t __cdecl strlen(const char *)
GLuint GLuint GLsizei count
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLdouble GLdouble GLdouble GLdouble q
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
#define memcpy(s1, s2, n)
static const char mbstate_t *static wchar_t const char mbstate_t *static const wchar_t int *static double
union TIFFDirEntry::@3701 tdir_offset
uint16_t td_pagenumber[2]
uint64_t td_dirdatasize_read
uint16_t td_threshholding
uint16_t td_minsamplevalue
double * td_sminsamplevalue
uint16_t td_bitspersample
TIFFDirEntry td_stripoffset_entry
uint16_t * td_transferfunction[3]
uint16_t td_maxsamplevalue
uint16_t td_resolutionunit
TIFFTagValue * td_customValues
double * td_smaxsamplevalue
uint64_t * td_stripbytecount_p
unsigned char td_iswrittentofile
uint64_t * td_stripoffset_p
uint16_t * td_colormap[3]
uint16_t td_ycbcrsubsampling[2]
uint64_t td_dirdatasize_write
unsigned char td_deferstrilearraywriting
uint16_t td_samplesperpixel
TIFFDirEntry td_stripbytecount_entry
uint16_t td_ycbcrpositioning
uint16_t td_halftonehints[2]
unsigned char field_passcount
TIFFSetGetFieldType set_get_field_type
tmsize_t tif_rawdataloaded
TIFFBoolMethod tif_postencode
TIFFHeaderUnion tif_header
int TIFFGetFieldDefaulted(TIFF *tif, uint32_t tag,...)
void * _TIFFCheckMalloc(TIFF *tif, tmsize_t nmemb, tmsize_t elem_size, const char *what)
float _TIFFClampDoubleToFloat(double val)
tdir_t TIFFNumberOfDirectories(TIFF *tif)
void TIFFFreeDirectory(TIFF *tif)
int TIFFCreateDirectory(TIFF *tif)
int TIFFGetField(TIFF *tif, uint32_t tag,...)
#define FIELD_SUBFILETYPE
#define FIELD_STRIPOFFSETS
#define FIELD_TRANSFERFUNCTION
#define FIELD_HALFTONEHINTS
#define FIELD_ORIENTATION
#define FIELD_MINSAMPLEVALUE
#define FIELD_SMAXSAMPLEVALUE
#define FIELD_IMAGEDIMENSIONS
#define FIELD_YCBCRSUBSAMPLING
#define FIELD_EXTRASAMPLES
#define FIELD_SMINSAMPLEVALUE
#define TIFFFieldSet(tif, field)
#define FIELD_MAXSAMPLEVALUE
#define FIELD_NUMBEROFINKS
#define FIELD_TILEDIMENSIONS
#define FIELD_ROWSPERSTRIP
#define FIELD_COMPRESSION
#define FIELD_STRIPBYTECOUNTS
#define FIELD_YCBCRPOSITIONING
#define FIELD_REFBLACKWHITE
#define FIELD_SAMPLEFORMAT
#define FIELD_BITSPERSAMPLE
#define FIELD_RESOLUTIONUNIT
#define FIELD_PLANARCONFIG
#define FIELD_SAMPLESPERPIXEL
#define FIELD_PHOTOMETRIC
#define FIELD_THRESHHOLDING
int TIFFDataWidth(TIFFDataType type)
uint32_t TIFFFieldTag(const TIFFField *fip)
const TIFFField * TIFFFindField(TIFF *tif, uint32_t tag, TIFFDataType dt)
int TIFFFieldSetGetSize(const TIFFField *fip)
int _TIFFRemoveEntryFromDirectoryListByOffset(TIFF *tif, uint64_t diroff)
int _TIFFCheckDirNumberAndOffset(TIFF *tif, tdir_t dirn, uint64_t diroff)
int _TIFFGetDirNumberFromOffset(TIFF *tif, uint64_t diroff, tdir_t *dirn)
int _TIFFFillStriles(TIFF *tif)
static int TIFFWriteDirectoryTagShortLong(TIFF *tif, uint32_t *ndir, TIFFDirEntry *dir, uint16_t tag, uint32_t value)
int TIFFCheckpointDirectory(TIFF *tif)
static int TIFFWriteDirectoryTagCheckedSlongArray(TIFF *tif, uint32_t *ndir, TIFFDirEntry *dir, uint16_t tag, uint32_t count, int32_t *value)
static int TIFFLinkDirectory(TIFF *)
static int TIFFWriteDirectoryTagSlongArray(TIFF *tif, uint32_t *ndir, TIFFDirEntry *dir, uint16_t tag, uint32_t count, int32_t *value)
static int TIFFWriteDirectoryTagLong(TIFF *tif, uint32_t *ndir, TIFFDirEntry *dir, uint16_t tag, uint32_t value)
static uint16_t TIFFClampDoubleToUInt16(double val)
static int TIFFWriteDirectoryTagSbyteArray(TIFF *tif, uint32_t *ndir, TIFFDirEntry *dir, uint16_t tag, uint32_t count, int8_t *value)
static int TIFFWriteDirectoryTagRationalDoubleArray(TIFF *tif, uint32_t *ndir, TIFFDirEntry *dir, uint16_t tag, uint32_t count, double *value)
static int TIFFWriteDirectoryTagAscii(TIFF *tif, uint32_t *ndir, TIFFDirEntry *dir, uint16_t tag, uint32_t count, char *value)
static int _WriteAsType(TIFF *tif, uint64_t strile_size, uint64_t uncompressed_threshold)
static int TIFFWriteDirectoryTagIfdArray(TIFF *tif, uint32_t *ndir, TIFFDirEntry *dir, uint16_t tag, uint32_t count, uint32_t *value)
static int TIFFWriteDirectoryTagCheckedDoubleArray(TIFF *tif, uint32_t *ndir, TIFFDirEntry *dir, uint16_t tag, uint32_t count, double *value)
void TIFFCvtNativeToIEEEDouble(TIFF *tif, uint32_t n, double *dp)
static int TIFFWriteDirectoryTagCheckedLong(TIFF *tif, uint32_t *ndir, TIFFDirEntry *dir, uint16_t tag, uint32_t value)
static int TIFFRewriteDirectorySec(TIFF *tif, int isimage, int imagedone, uint64_t *pdiroff)
static int TIFFWriteDirectoryTagCheckedRationalArray(TIFF *tif, uint32_t *ndir, TIFFDirEntry *dir, uint16_t tag, uint32_t count, float *value)
static void EvaluateIFDdatasizeWrite(TIFF *tif, uint32_t count, uint32_t typesize, uint32_t *ndir)
static void DoubleToSrational(double value, int32_t *num, int32_t *denom)
static int TIFFWriteDirectoryTagCheckedAscii(TIFF *tif, uint32_t *ndir, TIFFDirEntry *dir, uint16_t tag, uint32_t count, char *value)
static int TIFFWriteDirectoryTagSrationalDoubleArray(TIFF *tif, uint32_t *ndir, TIFFDirEntry *dir, uint16_t tag, uint32_t count, double *value)
static int TIFFWriteDirectoryTagCheckedSbyteArray(TIFF *tif, uint32_t *ndir, TIFFDirEntry *dir, uint16_t tag, uint32_t count, int8_t *value)
static int TIFFWriteDirectoryTagCheckedUndefinedArray(TIFF *tif, uint32_t *ndir, TIFFDirEntry *dir, uint16_t tag, uint32_t count, uint8_t *value)
static int TIFFWriteDirectoryTagCheckedShort(TIFF *tif, uint32_t *ndir, TIFFDirEntry *dir, uint16_t tag, uint16_t value)
static int TIFFWriteDirectoryTagDoubleArray(TIFF *tif, uint32_t *ndir, TIFFDirEntry *dir, uint16_t tag, uint32_t count, double *value)
static int TIFFWriteDirectoryTagLongArray(TIFF *tif, uint32_t *ndir, TIFFDirEntry *dir, uint16_t tag, uint32_t count, uint32_t *value)
static int TIFFWriteDirectoryTagSlong8Array(TIFF *tif, uint32_t *ndir, TIFFDirEntry *dir, uint16_t tag, uint32_t count, int64_t *value)
static int TIFFWriteDirectoryTagCheckedByteArray(TIFF *tif, uint32_t *ndir, TIFFDirEntry *dir, uint16_t tag, uint32_t count, uint8_t *value)
static int TIFFWriteDirectoryTagColormap(TIFF *tif, uint32_t *ndir, TIFFDirEntry *dir)
static int TIFFWriteDirectoryTagTransferfunction(TIFF *tif, uint32_t *ndir, TIFFDirEntry *dir)
static int TIFFWriteDirectoryTagCheckedIfdArray(TIFF *tif, uint32_t *ndir, TIFFDirEntry *dir, uint16_t tag, uint32_t count, uint32_t *value)
static int TIFFWriteDirectoryTagSrationalArray(TIFF *tif, uint32_t *ndir, TIFFDirEntry *dir, uint16_t tag, uint32_t count, float *value)
static int TIFFWriteDirectoryTagCheckedSlong8Array(TIFF *tif, uint32_t *ndir, TIFFDirEntry *dir, uint16_t tag, uint32_t count, int64_t *value)
static int32_t TIFFClampDoubleToInt32(double val)
static int TIFFWriteDirectoryTagCheckedSrationalArray(TIFF *tif, uint32_t *ndir, TIFFDirEntry *dir, uint16_t tag, uint32_t count, float *value)
static int TIFFWriteDirectoryTagByteArray(TIFF *tif, uint32_t *ndir, TIFFDirEntry *dir, uint16_t tag, uint32_t count, uint8_t *value)
static int8_t TIFFClampDoubleToInt8(double val)
static int TIFFWriteDirectoryTagCheckedShortArray(TIFF *tif, uint32_t *ndir, TIFFDirEntry *dir, uint16_t tag, uint32_t count, uint16_t *value)
static int TIFFWriteDirectoryTagData(TIFF *tif, uint32_t *ndir, TIFFDirEntry *dir, uint16_t tag, uint16_t datatype, uint32_t count, uint32_t datalength, void *data)
static int WriteAsLong4(TIFF *tif, uint64_t strile_size)
static int TIFFWriteDirectoryTagCheckedRational(TIFF *tif, uint32_t *ndir, TIFFDirEntry *dir, uint16_t tag, double value)
static int TIFFWriteDirectoryTagRationalArray(TIFF *tif, uint32_t *ndir, TIFFDirEntry *dir, uint16_t tag, uint32_t count, float *value)
static int TIFFWriteDirectoryTagSampleformatArray(TIFF *tif, uint32_t *ndir, TIFFDirEntry *dir, uint16_t tag, uint32_t count, double *value)
static int TIFFWriteDirectoryTagCheckedLong8Array(TIFF *tif, uint32_t *ndir, TIFFDirEntry *dir, uint16_t tag, uint32_t count, uint64_t *value)
static void DoubleToRational(double value, uint32_t *num, uint32_t *denom)
int _TIFFRewriteField(TIFF *tif, uint16_t tag, TIFFDataType in_datatype, tmsize_t count, void *data)
static int TIFFWriteDirectoryTagIfdIfd8Array(TIFF *tif, uint32_t *ndir, TIFFDirEntry *dir, uint16_t tag, uint32_t count, uint64_t *value)
static int TIFFWriteDirectoryTagFloatArray(TIFF *tif, uint32_t *ndir, TIFFDirEntry *dir, uint16_t tag, uint32_t count, float *value)
static int TIFFWriteDirectoryTagLongLong8Array(TIFF *tif, uint32_t *ndir, TIFFDirEntry *dir, uint16_t tag, uint32_t count, uint64_t *value)
int TIFFRewriteDirectory(TIFF *tif)
static uint32_t TIFFClampDoubleToUInt32(double val)
static int TIFFWriteDirectoryTagSshortArray(TIFF *tif, uint32_t *ndir, TIFFDirEntry *dir, uint16_t tag, uint32_t count, int16_t *value)
static void ToRationalEuclideanGCD(double value, int blnUseSignedRange, int blnUseSmallRange, uint64_t *ullNum, uint64_t *ullDenom)
static int WriteAsLong8(TIFF *tif, uint64_t strile_size)
int TIFFDeferStrileArrayWriting(TIFF *tif)
static int TIFFWriteDirectorySec(TIFF *tif, int isimage, int imagedone, uint64_t *pdiroff)
static int TIFFWriteDirectoryTagShortArray(TIFF *tif, uint32_t *ndir, TIFFDirEntry *dir, uint16_t tag, uint32_t count, uint16_t *value)
static int TIFFWriteDirectoryTagCheckedFloatArray(TIFF *tif, uint32_t *ndir, TIFFDirEntry *dir, uint16_t tag, uint32_t count, float *value)
static int TIFFWriteDirectoryTagShortPerSample(TIFF *tif, uint32_t *ndir, TIFFDirEntry *dir, uint16_t tag, uint16_t value)
static int TIFFWriteDirectoryTagCheckedSshortArray(TIFF *tif, uint32_t *ndir, TIFFDirEntry *dir, uint16_t tag, uint32_t count, int16_t *value)
static int TIFFWriteDirectoryTagUndefinedArray(TIFF *tif, uint32_t *ndir, TIFFDirEntry *dir, uint16_t tag, uint32_t count, uint8_t *value)
static int TIFFWriteDirectoryTagCheckedIfd8Array(TIFF *tif, uint32_t *ndir, TIFFDirEntry *dir, uint16_t tag, uint32_t count, uint64_t *value)
static int TIFFWriteDirectoryTagCheckedRationalDoubleArray(TIFF *tif, uint32_t *ndir, TIFFDirEntry *dir, uint16_t tag, uint32_t count, double *value)
static int TIFFWriteDirectoryTagCheckedSrationalDoubleArray(TIFF *tif, uint32_t *ndir, TIFFDirEntry *dir, uint16_t tag, uint32_t count, double *value)
static int TIFFWriteDirectoryTagShort(TIFF *tif, uint32_t *ndir, TIFFDirEntry *dir, uint16_t tag, uint16_t value)
int TIFFWriteDirectory(TIFF *tif)
static int TIFFWriteDirectoryTagLong8Array(TIFF *tif, uint32_t *ndir, TIFFDirEntry *dir, uint16_t tag, uint32_t count, uint64_t *value)
void TIFFCvtNativeToIEEEFloat(TIFF *tif, uint32_t n, float *fp)
static int TIFFWriteDirectoryTagCheckedLongArray(TIFF *tif, uint32_t *ndir, TIFFDirEntry *dir, uint16_t tag, uint32_t count, uint32_t *value)
static int16_t TIFFClampDoubleToInt16(double val)
static int TIFFWriteDirectoryTagRational(TIFF *tif, uint32_t *ndir, TIFFDirEntry *dir, uint16_t tag, double value)
static int TIFFWriteDirectoryTagSubifd(TIFF *tif, uint32_t *ndir, TIFFDirEntry *dir)
int TIFFWriteCustomDirectory(TIFF *tif, uint64_t *pdiroff)
static uint8_t TIFFClampDoubleToUInt8(double val)
void TIFFErrorExt(thandle_t fd, const char *module, const char *fmt,...)
void TIFFErrorExtR(TIFF *tif, const char *module, const char *fmt,...)
void _TIFFfreeExt(TIFF *tif, void *p)
void * _TIFFmallocExt(TIFF *tif, tmsize_t s)
uint64_t TIFFStripSize64(TIFF *tif)
void TIFFSwabArrayOfLong(register uint32_t *lp, tmsize_t n)
void TIFFSwabArrayOfFloat(register float *fp, tmsize_t n)
void TIFFSwabArrayOfDouble(double *dp, tmsize_t n)
void TIFFSwabLong8(uint64_t *lp)
void TIFFSwabShort(uint16_t *wp)
void TIFFSwabArrayOfLong8(register uint64_t *lp, tmsize_t n)
void TIFFSwabLong(uint32_t *lp)
void TIFFSwabArrayOfShort(register uint16_t *wp, tmsize_t n)
uint64_t TIFFTileSize64(TIFF *tif)
int _TIFFmemcmp(const void *p1, const void *p2, tmsize_t c)
void _TIFFmemcpy(void *d, const void *s, tmsize_t c)
void TIFFWarningExtR(TIFF *tif, const char *module, const char *fmt,...)
void TIFFSetWriteOffset(TIFF *tif, toff_t off)
int TIFFFlushData1(TIFF *tif)
int TIFFSetupStrips(TIFF *tif)
#define TIFFTAG_BITSPERSAMPLE
#define TIFFTAG_RESOLUTIONUNIT
#define TIFFTAG_FILLORDER
#define TIFFTAG_SAMPLESPERPIXEL
#define COMPRESSION_DEFLATE
#define TIFFTAG_YPOSITION
#define SAMPLEFORMAT_UINT
#define TIFFTAG_IMAGEDEPTH
#define TIFFTAG_PHOTOMETRIC
#define TIFFTAG_TILELENGTH
#define TIFFTAG_MAXSAMPLEVALUE
#define TIFFTAG_TILEDEPTH
#define TIFFTAG_EXTRASAMPLES
#define TIFFTAG_IMAGEWIDTH
#define TIFFTAG_XRESOLUTION
#define TIFFTAG_ORIENTATION
#define COMPRESSION_ADOBE_DEFLATE
#define TIFFTAG_HALFTONEHINTS
#define TIFFTAG_MINSAMPLEVALUE
#define TIFFTAG_NUMBEROFINKS
#define SAMPLEFORMAT_IEEEFP
#define TIFFTAG_TRANSFERFUNCTION
#define TIFFTAG_YRESOLUTION
#define TIFFTAG_TILEBYTECOUNTS
#define TIFFTAG_STRIPBYTECOUNTS
#define TIFFTAG_SMINSAMPLEVALUE
#define TIFFTAG_YCBCRSUBSAMPLING
#define TIFFTAG_TILEOFFSETS
#define TIFFTAG_ROWSPERSTRIP
#define TIFFTAG_SMAXSAMPLEVALUE
#define TIFFTAG_SAMPLEFORMAT
#define TIFFTAG_REFERENCEBLACKWHITE
#define TIFFTAG_TILEWIDTH
#define TIFFTAG_IMAGELENGTH
#define TIFFTAG_PAGENUMBER
#define TIFFTAG_COMPRESSION
#define TIFFTAG_PLANARCONFIG
#define TIFFTAG_STRIPOFFSETS
#define TIFFTAG_SUBFILETYPE
#define TIFFTAG_XPOSITION
#define TIFFTAG_YCBCRPOSITIONING
#define TIFFTAG_THRESHHOLDING
#define TIFF_NON_EXISTENT_DIR_NUMBER
#define WriteOK(tif, buf, size)
#define ReadOK(tif, buf, size)
#define TIFFSeekFile(tif, off, whence)