ReactOS  0.4.14-dev-337-gf981a68
tiffio.h File Reference
#include "tiff.h"
#include "tiffvers.h"
#include <stdio.h>
#include <stdarg.h>
Include dependency graph for tiffio.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  TIFFDisplay
 
struct  TIFFYCbCrToRGB
 
struct  TIFFCIELabToRGB
 
struct  _TIFFRGBAImage
 
struct  TIFFCodec
 
struct  TIFFTagMethods
 
struct  TIFFFieldInfo
 

Macros

#define TIFFPRINT_NONE   0x0 /* no extra info */
 
#define TIFFPRINT_STRIPS   0x1 /* strips/tiles info */
 
#define TIFFPRINT_CURVES   0x2 /* color/gray response curves */
 
#define TIFFPRINT_COLORMAP   0x4 /* colormap */
 
#define TIFFPRINT_JPEGQTABLES   0x100 /* JPEG Q matrices */
 
#define TIFFPRINT_JPEGACTABLES   0x200 /* JPEG AC tables */
 
#define TIFFPRINT_JPEGDCTABLES   0x200 /* JPEG DC tables */
 
#define D65_X0   (95.0470F)
 
#define D65_Y0   (100.0F)
 
#define D65_Z0   (108.8827F)
 
#define D50_X0   (96.4250F)
 
#define D50_Y0   (100.0F)
 
#define D50_Z0   (82.4680F)
 
#define CIELABTORGB_TABLE_RANGE   1500
 
#define TIFFGetR(abgr)   ((abgr) & 0xff)
 
#define TIFFGetG(abgr)   (((abgr) >> 8) & 0xff)
 
#define TIFFGetB(abgr)   (((abgr) >> 16) & 0xff)
 
#define TIFFGetA(abgr)   (((abgr) >> 24) & 0xff)
 
#define LOGLUV_PUBLIC   1
 
#define __attribute__(x)   /*nothing*/
 
#define TIFF_ANY   TIFF_NOTYPE /* for field descriptor searching */
 
#define TIFF_VARIABLE   -1 /* marker for variable length tags */
 
#define TIFF_SPP   -2 /* marker for SamplesPerPixel tags */
 
#define TIFF_VARIABLE2   -3 /* marker for uint32 var-length tags */
 
#define FIELD_CUSTOM   65
 
#define U_NEU   0.210526316
 
#define V_NEU   0.473684211
 
#define UVSCALE   410.
 

Typedefs

typedef struct tiff TIFF
 
typedef TIFF_SSIZE_T tmsize_t
 
typedef uint64 toff_t
 
typedef uint32 ttag_t
 
typedef uint16 tdir_t
 
typedef uint16 tsample_t
 
typedef uint32 tstrile_t
 
typedef tstrile_t tstrip_t
 
typedef tstrile_t ttile_t
 
typedef tmsize_t tsize_t
 
typedef voidtdata_t
 
typedef voidthandle_t
 
typedef unsigned char TIFFRGBValue
 
typedef struct _TIFFRGBAImage TIFFRGBAImage
 
typedef void(* tileContigRoutine) (TIFFRGBAImage *, uint32 *, uint32, uint32, uint32, uint32, int32, int32, unsigned char *)
 
typedef void(* tileSeparateRoutine) (TIFFRGBAImage *, uint32 *, uint32, uint32, uint32, uint32, int32, int32, unsigned char *, unsigned char *, unsigned char *, unsigned char *)
 
typedef int(* TIFFInitMethod) (TIFF *, int)
 
typedef void(* TIFFErrorHandler) (const char *, const char *, va_list)
 
typedef void(* TIFFErrorHandlerExt) (thandle_t, const char *, const char *, va_list)
 
typedef tmsize_t(* TIFFReadWriteProc) (thandle_t, void *, tmsize_t)
 
typedef toff_t(* TIFFSeekProc) (thandle_t, toff_t, int)
 
typedef int(* TIFFCloseProc) (thandle_t)
 
typedef toff_t(* TIFFSizeProc) (thandle_t)
 
typedef int(* TIFFMapFileProc) (thandle_t, void **base, toff_t *size)
 
typedef void(* TIFFUnmapFileProc) (thandle_t, void *base, toff_t size)
 
typedef void(* TIFFExtendProc) (TIFF *)
 
typedef struct _TIFFField TIFFField
 
typedef struct _TIFFFieldArray TIFFFieldArray
 
typedef int(* TIFFVSetMethod) (TIFF *, uint32, va_list)
 
typedef int(* TIFFVGetMethod) (TIFF *, uint32, va_list)
 
typedef void(* TIFFPrintMethod) (TIFF *, FILE *, long)
 

Functions

const charTIFFGetVersion (void)
 
const TIFFCodecTIFFFindCODEC (uint16)
 
TIFFCodecTIFFRegisterCODEC (uint16, const char *, TIFFInitMethod)
 
void TIFFUnRegisterCODEC (TIFFCodec *)
 
int TIFFIsCODECConfigured (uint16)
 
TIFFCodecTIFFGetConfiguredCODECs (void)
 
void_TIFFmalloc (tmsize_t s)
 
void_TIFFcalloc (tmsize_t nmemb, tmsize_t siz)
 
void_TIFFrealloc (void *p, tmsize_t s)
 
void _TIFFmemset (void *p, int v, tmsize_t c)
 
void _TIFFmemcpy (void *d, const void *s, tmsize_t c)
 
int _TIFFmemcmp (const void *p1, const void *p2, tmsize_t c)
 
void _TIFFfree (void *p)
 
int TIFFGetTagListCount (TIFF *)
 
uint32 TIFFGetTagListEntry (TIFF *, int tag_index)
 
const TIFFFieldTIFFFindField (TIFF *, uint32, TIFFDataType)
 
const TIFFFieldTIFFFieldWithTag (TIFF *, uint32)
 
const TIFFFieldTIFFFieldWithName (TIFF *, const char *)
 
uint32 TIFFFieldTag (const TIFFField *)
 
const charTIFFFieldName (const TIFFField *)
 
TIFFDataType TIFFFieldDataType (const TIFFField *)
 
int TIFFFieldPassCount (const TIFFField *)
 
int TIFFFieldReadCount (const TIFFField *)
 
int TIFFFieldWriteCount (const TIFFField *)
 
TIFFTagMethodsTIFFAccessTagMethods (TIFF *)
 
voidTIFFGetClientInfo (TIFF *, const char *)
 
void TIFFSetClientInfo (TIFF *, void *, const char *)
 
void TIFFCleanup (TIFF *tif)
 
void TIFFClose (TIFF *tif)
 
int TIFFFlush (TIFF *tif)
 
int TIFFFlushData (TIFF *tif)
 
int TIFFGetField (TIFF *tif, uint32 tag,...)
 
int TIFFVGetField (TIFF *tif, uint32 tag, va_list ap)
 
int TIFFGetFieldDefaulted (TIFF *tif, uint32 tag,...)
 
int TIFFVGetFieldDefaulted (TIFF *tif, uint32 tag, va_list ap)
 
int TIFFReadDirectory (TIFF *tif)
 
int TIFFReadCustomDirectory (TIFF *tif, toff_t diroff, const TIFFFieldArray *infoarray)
 
int TIFFReadEXIFDirectory (TIFF *tif, toff_t diroff)
 
uint64 TIFFScanlineSize64 (TIFF *tif)
 
tmsize_t TIFFScanlineSize (TIFF *tif)
 
uint64 TIFFRasterScanlineSize64 (TIFF *tif)
 
tmsize_t TIFFRasterScanlineSize (TIFF *tif)
 
uint64 TIFFStripSize64 (TIFF *tif)
 
tmsize_t TIFFStripSize (TIFF *tif)
 
uint64 TIFFRawStripSize64 (TIFF *tif, uint32 strip)
 
tmsize_t TIFFRawStripSize (TIFF *tif, uint32 strip)
 
uint64 TIFFVStripSize64 (TIFF *tif, uint32 nrows)
 
tmsize_t TIFFVStripSize (TIFF *tif, uint32 nrows)
 
uint64 TIFFTileRowSize64 (TIFF *tif)
 
tmsize_t TIFFTileRowSize (TIFF *tif)
 
uint64 TIFFTileSize64 (TIFF *tif)
 
tmsize_t TIFFTileSize (TIFF *tif)
 
uint64 TIFFVTileSize64 (TIFF *tif, uint32 nrows)
 
tmsize_t TIFFVTileSize (TIFF *tif, uint32 nrows)
 
uint32 TIFFDefaultStripSize (TIFF *tif, uint32 request)
 
void TIFFDefaultTileSize (TIFF *, uint32 *, uint32 *)
 
int TIFFFileno (TIFF *)
 
int TIFFSetFileno (TIFF *, int)
 
thandle_t TIFFClientdata (TIFF *)
 
thandle_t TIFFSetClientdata (TIFF *, thandle_t)
 
int TIFFGetMode (TIFF *)
 
int TIFFSetMode (TIFF *, int)
 
int TIFFIsTiled (TIFF *)
 
int TIFFIsByteSwapped (TIFF *)
 
int TIFFIsUpSampled (TIFF *)
 
int TIFFIsMSB2LSB (TIFF *)
 
int TIFFIsBigEndian (TIFF *)
 
TIFFReadWriteProc TIFFGetReadProc (TIFF *)
 
TIFFReadWriteProc TIFFGetWriteProc (TIFF *)
 
TIFFSeekProc TIFFGetSeekProc (TIFF *)
 
TIFFCloseProc TIFFGetCloseProc (TIFF *)
 
TIFFSizeProc TIFFGetSizeProc (TIFF *)
 
TIFFMapFileProc TIFFGetMapFileProc (TIFF *)
 
TIFFUnmapFileProc TIFFGetUnmapFileProc (TIFF *)
 
uint32 TIFFCurrentRow (TIFF *)
 
uint16 TIFFCurrentDirectory (TIFF *)
 
uint16 TIFFNumberOfDirectories (TIFF *)
 
uint64 TIFFCurrentDirOffset (TIFF *)
 
uint32 TIFFCurrentStrip (TIFF *)
 
uint32 TIFFCurrentTile (TIFF *tif)
 
int TIFFReadBufferSetup (TIFF *tif, void *bp, tmsize_t size)
 
int TIFFWriteBufferSetup (TIFF *tif, void *bp, tmsize_t size)
 
int TIFFSetupStrips (TIFF *)
 
int TIFFWriteCheck (TIFF *, int, const char *)
 
void TIFFFreeDirectory (TIFF *)
 
int TIFFCreateDirectory (TIFF *)
 
int TIFFCreateCustomDirectory (TIFF *, const TIFFFieldArray *)
 
int TIFFCreateEXIFDirectory (TIFF *)
 
int TIFFLastDirectory (TIFF *)
 
int TIFFSetDirectory (TIFF *, uint16)
 
int TIFFSetSubDirectory (TIFF *, uint64)
 
int TIFFUnlinkDirectory (TIFF *, uint16)
 
int TIFFSetField (TIFF *, uint32,...)
 
int TIFFVSetField (TIFF *, uint32, va_list)
 
int TIFFUnsetField (TIFF *, uint32)
 
int TIFFWriteDirectory (TIFF *)
 
int TIFFWriteCustomDirectory (TIFF *, uint64 *)
 
int TIFFCheckpointDirectory (TIFF *)
 
int TIFFRewriteDirectory (TIFF *)
 
void TIFFPrintDirectory (TIFF *, FILE *, long)
 
int TIFFReadScanline (TIFF *tif, void *buf, uint32 row, uint16 sample)
 
int TIFFWriteScanline (TIFF *tif, void *buf, uint32 row, uint16 sample)
 
int TIFFReadRGBAImage (TIFF *, uint32, uint32, uint32 *, int)
 
int TIFFReadRGBAImageOriented (TIFF *, uint32, uint32, uint32 *, int, int)
 
int TIFFReadRGBAStrip (TIFF *, uint32, uint32 *)
 
int TIFFReadRGBATile (TIFF *, uint32, uint32, uint32 *)
 
int TIFFReadRGBAStripExt (TIFF *, uint32, uint32 *, int stop_on_error)
 
int TIFFReadRGBATileExt (TIFF *, uint32, uint32, uint32 *, int stop_on_error)
 
int TIFFRGBAImageOK (TIFF *, char [1024])
 
int TIFFRGBAImageBegin (TIFFRGBAImage *, TIFF *, int, char [1024])
 
int TIFFRGBAImageGet (TIFFRGBAImage *, uint32 *, uint32, uint32)
 
void TIFFRGBAImageEnd (TIFFRGBAImage *)
 
TIFFTIFFOpen (const char *, const char *)
 
TIFFTIFFFdOpen (int, const char *, const char *)
 
TIFFTIFFClientOpen (const char *, const char *, thandle_t, TIFFReadWriteProc, TIFFReadWriteProc, TIFFSeekProc, TIFFCloseProc, TIFFSizeProc, TIFFMapFileProc, TIFFUnmapFileProc)
 
const charTIFFFileName (TIFF *)
 
const charTIFFSetFileName (TIFF *, const char *)
 
void TIFFError (const char *, const char *,...) __attribute__((__format__(__printf__
 
void void TIFFErrorExt (thandle_t, const char *, const char *,...) __attribute__((__format__(__printf__
 
void void void TIFFWarning (const char *, const char *,...) __attribute__((__format__(__printf__
 
void void void void TIFFWarningExt (thandle_t, const char *, const char *,...) __attribute__((__format__(__printf__
 
void void void void TIFFErrorHandler TIFFSetErrorHandler (TIFFErrorHandler)
 
TIFFErrorHandlerExt TIFFSetErrorHandlerExt (TIFFErrorHandlerExt)
 
TIFFErrorHandler TIFFSetWarningHandler (TIFFErrorHandler)
 
TIFFErrorHandlerExt TIFFSetWarningHandlerExt (TIFFErrorHandlerExt)
 
TIFFExtendProc TIFFSetTagExtender (TIFFExtendProc)
 
uint32 TIFFComputeTile (TIFF *tif, uint32 x, uint32 y, uint32 z, uint16 s)
 
int TIFFCheckTile (TIFF *tif, uint32 x, uint32 y, uint32 z, uint16 s)
 
uint32 TIFFNumberOfTiles (TIFF *)
 
tmsize_t TIFFReadTile (TIFF *tif, void *buf, uint32 x, uint32 y, uint32 z, uint16 s)
 
tmsize_t TIFFWriteTile (TIFF *tif, void *buf, uint32 x, uint32 y, uint32 z, uint16 s)
 
uint32 TIFFComputeStrip (TIFF *, uint32, uint16)
 
uint32 TIFFNumberOfStrips (TIFF *)
 
tmsize_t TIFFReadEncodedStrip (TIFF *tif, uint32 strip, void *buf, tmsize_t size)
 
tmsize_t TIFFReadRawStrip (TIFF *tif, uint32 strip, void *buf, tmsize_t size)
 
tmsize_t TIFFReadEncodedTile (TIFF *tif, uint32 tile, void *buf, tmsize_t size)
 
tmsize_t TIFFReadRawTile (TIFF *tif, uint32 tile, void *buf, tmsize_t size)
 
tmsize_t TIFFWriteEncodedStrip (TIFF *tif, uint32 strip, void *data, tmsize_t cc)
 
tmsize_t TIFFWriteRawStrip (TIFF *tif, uint32 strip, void *data, tmsize_t cc)
 
tmsize_t TIFFWriteEncodedTile (TIFF *tif, uint32 tile, void *data, tmsize_t cc)
 
tmsize_t TIFFWriteRawTile (TIFF *tif, uint32 tile, void *data, tmsize_t cc)
 
int TIFFDataWidth (TIFFDataType)
 
void TIFFSetWriteOffset (TIFF *tif, toff_t off)
 
void TIFFSwabShort (uint16 *)
 
void TIFFSwabLong (uint32 *)
 
void TIFFSwabLong8 (uint64 *)
 
void TIFFSwabFloat (float *)
 
void TIFFSwabDouble (double *)
 
void TIFFSwabArrayOfShort (uint16 *wp, tmsize_t n)
 
void TIFFSwabArrayOfTriples (uint8 *tp, tmsize_t n)
 
void TIFFSwabArrayOfLong (uint32 *lp, tmsize_t n)
 
void TIFFSwabArrayOfLong8 (uint64 *lp, tmsize_t n)
 
void TIFFSwabArrayOfFloat (float *fp, tmsize_t n)
 
void TIFFSwabArrayOfDouble (double *dp, tmsize_t n)
 
void TIFFReverseBits (uint8 *cp, tmsize_t n)
 
const unsigned charTIFFGetBitRevTable (int)
 
double LogL16toY (int)
 
double LogL10toY (int)
 
void XYZtoRGB24 (float *, uint8 *)
 
int uv_decode (double *, double *, int)
 
void LogLuv24toXYZ (uint32, float *)
 
void LogLuv32toXYZ (uint32, float *)
 
int LogL16fromY (double, int)
 
int LogL10fromY (double, int)
 
int uv_encode (double, double, int)
 
uint32 LogLuv24fromXYZ (float *, int)
 
uint32 LogLuv32fromXYZ (float *, int)
 
int TIFFCIELabToRGBInit (TIFFCIELabToRGB *, const TIFFDisplay *, float *)
 
void TIFFCIELabToXYZ (TIFFCIELabToRGB *, uint32, int32, int32, float *, float *, float *)
 
void TIFFXYZToRGB (TIFFCIELabToRGB *, float, float, float, uint32 *, uint32 *, uint32 *)
 
int TIFFYCbCrToRGBInit (TIFFYCbCrToRGB *, float *, float *)
 
void TIFFYCbCrtoRGB (TIFFYCbCrToRGB *, uint32, int32, int32, uint32 *, uint32 *, uint32 *)
 
int TIFFMergeFieldInfo (TIFF *, const TIFFFieldInfo[], uint32)
 

Macro Definition Documentation

◆ __attribute__

#define __attribute__ (   x)    /*nothing*/

Definition at line 270 of file tiffio.h.

◆ CIELABTORGB_TABLE_RANGE

#define CIELABTORGB_TABLE_RANGE   1500

Definition at line 170 of file tiffio.h.

◆ D50_X0

#define D50_X0   (96.4250F)

Definition at line 135 of file tiffio.h.

◆ D50_Y0

#define D50_Y0   (100.0F)

Definition at line 136 of file tiffio.h.

◆ D50_Z0

#define D50_Z0   (82.4680F)

Definition at line 137 of file tiffio.h.

◆ D65_X0

#define D65_X0   (95.0470F)

Definition at line 131 of file tiffio.h.

◆ D65_Y0

#define D65_Y0   (100.0F)

Definition at line 132 of file tiffio.h.

◆ D65_Z0

#define D65_Z0   (108.8827F)

Definition at line 133 of file tiffio.h.

◆ FIELD_CUSTOM

#define FIELD_CUSTOM   65

Definition at line 317 of file tiffio.h.

◆ LOGLUV_PUBLIC

#define LOGLUV_PUBLIC   1

Definition at line 266 of file tiffio.h.

◆ TIFF_ANY

#define TIFF_ANY   TIFF_NOTYPE /* for field descriptor searching */

Definition at line 312 of file tiffio.h.

◆ TIFF_SPP

#define TIFF_SPP   -2 /* marker for SamplesPerPixel tags */

Definition at line 314 of file tiffio.h.

◆ TIFF_VARIABLE

#define TIFF_VARIABLE   -1 /* marker for variable length tags */

Definition at line 313 of file tiffio.h.

◆ TIFF_VARIABLE2

#define TIFF_VARIABLE2   -3 /* marker for uint32 var-length tags */

Definition at line 315 of file tiffio.h.

◆ TIFFGetA

#define TIFFGetA (   abgr)    (((abgr) >> 24) & 0xff)

Definition at line 245 of file tiffio.h.

◆ TIFFGetB

#define TIFFGetB (   abgr)    (((abgr) >> 16) & 0xff)

Definition at line 244 of file tiffio.h.

◆ TIFFGetG

#define TIFFGetG (   abgr)    (((abgr) >> 8) & 0xff)

Definition at line 243 of file tiffio.h.

◆ TIFFGetR

#define TIFFGetR (   abgr)    ((abgr) & 0xff)

Definition at line 242 of file tiffio.h.

◆ TIFFPRINT_COLORMAP

#define TIFFPRINT_COLORMAP   0x4 /* colormap */

Definition at line 121 of file tiffio.h.

◆ TIFFPRINT_CURVES

#define TIFFPRINT_CURVES   0x2 /* color/gray response curves */

Definition at line 120 of file tiffio.h.

◆ TIFFPRINT_JPEGACTABLES

#define TIFFPRINT_JPEGACTABLES   0x200 /* JPEG AC tables */

Definition at line 123 of file tiffio.h.

◆ TIFFPRINT_JPEGDCTABLES

#define TIFFPRINT_JPEGDCTABLES   0x200 /* JPEG DC tables */

Definition at line 124 of file tiffio.h.

◆ TIFFPRINT_JPEGQTABLES

#define TIFFPRINT_JPEGQTABLES   0x100 /* JPEG Q matrices */

Definition at line 122 of file tiffio.h.

◆ TIFFPRINT_NONE

#define TIFFPRINT_NONE   0x0 /* no extra info */

Definition at line 118 of file tiffio.h.

◆ TIFFPRINT_STRIPS

#define TIFFPRINT_STRIPS   0x1 /* strips/tiles info */

Definition at line 119 of file tiffio.h.

◆ U_NEU

#define U_NEU   0.210526316

Definition at line 497 of file tiffio.h.

◆ UVSCALE

#define UVSCALE   410.

Definition at line 499 of file tiffio.h.

◆ V_NEU

#define V_NEU   0.473684211

Definition at line 498 of file tiffio.h.

Typedef Documentation

◆ tdata_t

typedef void* tdata_t

Definition at line 76 of file tiffio.h.

◆ tdir_t

typedef uint16 tdir_t

Definition at line 70 of file tiffio.h.

◆ thandle_t

typedef void* thandle_t

Definition at line 109 of file tiffio.h.

◆ TIFF

typedef struct tiff TIFF

Definition at line 38 of file tiffio.h.

◆ TIFFCloseProc

typedef int(* TIFFCloseProc) (thandle_t)

Definition at line 280 of file tiffio.h.

◆ TIFFErrorHandler

typedef void(* TIFFErrorHandler) (const char *, const char *, va_list)

Definition at line 276 of file tiffio.h.

◆ TIFFErrorHandlerExt

typedef void(* TIFFErrorHandlerExt) (thandle_t, const char *, const char *, va_list)

Definition at line 277 of file tiffio.h.

◆ TIFFExtendProc

typedef void(* TIFFExtendProc) (TIFF *)

Definition at line 284 of file tiffio.h.

◆ TIFFField

Definition at line 319 of file tiffio.h.

◆ TIFFFieldArray

Definition at line 320 of file tiffio.h.

◆ TIFFInitMethod

typedef int(* TIFFInitMethod) (TIFF *, int)

Definition at line 254 of file tiffio.h.

◆ TIFFMapFileProc

typedef int(* TIFFMapFileProc) (thandle_t, void **base, toff_t *size)

Definition at line 282 of file tiffio.h.

◆ TIFFPrintMethod

typedef void(* TIFFPrintMethod) (TIFF *, FILE *, long)

Definition at line 335 of file tiffio.h.

◆ TIFFReadWriteProc

typedef tmsize_t(* TIFFReadWriteProc) (thandle_t, void *, tmsize_t)

Definition at line 278 of file tiffio.h.

◆ TIFFRGBAImage

Definition at line 182 of file tiffio.h.

◆ TIFFRGBValue

typedef unsigned char TIFFRGBValue

Definition at line 141 of file tiffio.h.

◆ TIFFSeekProc

typedef toff_t(* TIFFSeekProc) (thandle_t, toff_t, int)

Definition at line 279 of file tiffio.h.

◆ TIFFSizeProc

typedef toff_t(* TIFFSizeProc) (thandle_t)

Definition at line 281 of file tiffio.h.

◆ TIFFUnmapFileProc

typedef void(* TIFFUnmapFileProc) (thandle_t, void *base, toff_t size)

Definition at line 283 of file tiffio.h.

◆ TIFFVGetMethod

typedef int(* TIFFVGetMethod) (TIFF *, uint32, va_list)

Definition at line 334 of file tiffio.h.

◆ TIFFVSetMethod

typedef int(* TIFFVSetMethod) (TIFF *, uint32, va_list)

Definition at line 333 of file tiffio.h.

◆ tileContigRoutine

typedef void(* tileContigRoutine) (TIFFRGBAImage *, uint32 *, uint32, uint32, uint32, uint32, int32, int32, unsigned char *)

Definition at line 194 of file tiffio.h.

◆ tileSeparateRoutine

typedef void(* tileSeparateRoutine) (TIFFRGBAImage *, uint32 *, uint32, uint32, uint32, uint32, int32, int32, unsigned char *, unsigned char *, unsigned char *, unsigned char *)

Definition at line 197 of file tiffio.h.

◆ tmsize_t

Definition at line 65 of file tiffio.h.

◆ toff_t

typedef uint64 toff_t

Definition at line 66 of file tiffio.h.

◆ tsample_t

typedef uint16 tsample_t

Definition at line 71 of file tiffio.h.

◆ tsize_t

typedef tmsize_t tsize_t

Definition at line 75 of file tiffio.h.

◆ tstrile_t

typedef uint32 tstrile_t

Definition at line 72 of file tiffio.h.

◆ tstrip_t

Definition at line 73 of file tiffio.h.

◆ ttag_t

typedef uint32 ttag_t

Definition at line 69 of file tiffio.h.

◆ ttile_t

typedef tstrile_t ttile_t

Definition at line 74 of file tiffio.h.

Function Documentation

◆ _TIFFcalloc()

void* _TIFFcalloc ( tmsize_t  nmemb,
tmsize_t  siz 
)

Definition at line 317 of file tif_unix.c.

318 {
319  if( nmemb == 0 || siz == 0 )
320  return ((void *) NULL);
321 
322  return calloc((size_t) nmemb, (size_t)siz);
323 }
smooth NULL
Definition: ftsmooth.c:416
#define calloc
Definition: rosglue.h:14

Referenced by TIFFReadBufferSetup(), and TIFFReadDirectory().

◆ _TIFFfree()

void _TIFFfree ( void p)

Definition at line 326 of file tif_unix.c.

327 {
328  free(p);
329 }
#define free
Definition: debug_ros.c:5
GLfloat GLfloat p
Definition: glext.h:8902

Referenced by _TIFFCreateAnonField(), _TIFFRewriteField(), _TIFFSetupFields(), _TIFFVSetField(), ChopUpSingleUncompressedStrip(), EstimateStripByteCounts(), fpAcc(), fpDiff(), gtStripContig(), gtStripSeparate(), gtTileContig(), gtTileSeparate(), initCIELabConversion(), PredictorEncodeTile(), setByteArray(), setDoubleArrayOneValue(), setupMap(), TIFFCleanup(), TIFFDefaultDirectory(), TIFFDefaultTransferFunction(), TIFFFetchDirectory(), TIFFFetchNormalTag(), TIFFFetchStripThing(), TIFFFillStrip(), TIFFFillTile(), TIFFFreeDirectory(), TIFFGetConfiguredCODECs(), TIFFGrowStrips(), TIFFOpenW(), TIFFPrintDirectory(), TIFFReadAndRealloc(), TIFFReadBufferSetup(), TIFFReadCustomDirectory(), TIFFReadDirectory(), TIFFReadDirEntryArrayWithLimit(), TIFFReadDirEntryByteArray(), TIFFReadDirEntryDoubleArray(), TIFFReadDirEntryFloatArray(), TIFFReadDirEntryIfd8Array(), TIFFReadDirEntryLong8ArrayWithLimit(), TIFFReadDirEntryLongArray(), TIFFReadDirEntryPersampleShort(), TIFFReadDirEntrySbyteArray(), TIFFReadDirEntryShortArray(), TIFFReadDirEntrySlong8Array(), TIFFReadDirEntrySlongArray(), TIFFReadDirEntrySshortArray(), TIFFRGBAImageEnd(), TIFFUnlinkDirectory(), TIFFUnRegisterCODEC(), TIFFUnsetField(), TIFFWriteBufferSetup(), TIFFWriteDirectorySec(), TIFFWriteDirectoryTagCheckedRationalArray(), TIFFWriteDirectoryTagCheckedSrationalArray(), TIFFWriteDirectoryTagColormap(), TIFFWriteDirectoryTagIfdIfd8Array(), TIFFWriteDirectoryTagLongLong8Array(), TIFFWriteDirectoryTagSampleformatArray(), TIFFWriteDirectoryTagShortPerSample(), TIFFWriteDirectoryTagSubifd(), and TIFFWriteDirectoryTagTransferfunction().

◆ _TIFFmalloc()

void* _TIFFmalloc ( tmsize_t  s)

Definition at line 309 of file tif_unix.c.

310 {
311  if (s == 0)
312  return ((void *) NULL);
313 
314  return (malloc((size_t) s));
315 }
smooth NULL
Definition: ftsmooth.c:416
GLdouble s
Definition: gl.h:2039
#define malloc
Definition: debug_ros.c:4

Referenced by _TIFFCreateAnonField(), _TIFFReadEncodedStripAndAllocBuffer(), _TIFFReadEncodedTileAndAllocBuffer(), BuildMapBitdepth16To8(), BuildMapUaToAa(), fpAcc(), fpDiff(), initCIELabConversion(), initYCbCrConversion(), makebwmap(), makecmap(), PredictorEncodeTile(), setByteArray(), setDoubleArrayOneValue(), setupMap(), TIFFClientOpen(), TIFFDefaultRefBlackWhite(), TIFFDefaultTransferFunction(), TIFFFetchNormalTag(), TIFFOpenW(), TIFFPrintDirectory(), TIFFReadDirEntryByteArray(), TIFFReadDirEntryDoubleArray(), TIFFReadDirEntryFloatArray(), TIFFReadDirEntryIfd8Array(), TIFFReadDirEntryLong8ArrayWithLimit(), TIFFReadDirEntryLongArray(), TIFFReadDirEntrySbyteArray(), TIFFReadDirEntryShortArray(), TIFFReadDirEntrySlong8Array(), TIFFReadDirEntrySlongArray(), TIFFReadDirEntrySshortArray(), TIFFRegisterCODEC(), TIFFRGBAImageBegin(), TIFFSetClientInfo(), TIFFWriteBufferSetup(), TIFFWriteDirectorySec(), TIFFWriteDirectoryTagCheckedRationalArray(), TIFFWriteDirectoryTagCheckedSrationalArray(), TIFFWriteDirectoryTagColormap(), TIFFWriteDirectoryTagIfdIfd8Array(), TIFFWriteDirectoryTagLongLong8Array(), TIFFWriteDirectoryTagSampleformatArray(), TIFFWriteDirectoryTagShortPerSample(), TIFFWriteDirectoryTagSubifd(), and TIFFWriteDirectoryTagTransferfunction().

◆ _TIFFmemcmp()

int _TIFFmemcmp ( const void p1,
const void p2,
tmsize_t  c 
)

Definition at line 350 of file tif_unix.c.

351 {
352  return (memcmp(p1, p2, (size_t) c));
353 }
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
const GLubyte * c
Definition: glext.h:8905

Referenced by TIFFWriteDirectoryTagTransferfunction().

◆ _TIFFmemcpy()

◆ _TIFFmemset()

◆ _TIFFrealloc()

void* _TIFFrealloc ( void p,
tmsize_t  s 
)

Definition at line 332 of file tif_unix.c.

333 {
334  return (realloc(p, (size_t) s));
335 }
#define realloc
Definition: debug_ros.c:6
GLdouble s
Definition: gl.h:2039
GLfloat GLfloat p
Definition: glext.h:8902

Referenced by _TIFFCheckRealloc(), _TIFFVSetField(), TIFFGetConfiguredCODECs(), TIFFGrowStrips(), TIFFReadAndRealloc(), and TIFFReadDirEntryDataAndRealloc().

◆ LogL10fromY()

int LogL10fromY ( double  ,
int   
)

◆ LogL10toY()

double LogL10toY ( int  )

◆ LogL16fromY()

int LogL16fromY ( double  ,
int   
)

◆ LogL16toY()

double LogL16toY ( int  )

◆ LogLuv24fromXYZ()

uint32 LogLuv24fromXYZ ( float *  ,
int   
)

◆ LogLuv24toXYZ()

void LogLuv24toXYZ ( uint32  ,
float *   
)

◆ LogLuv32fromXYZ()

uint32 LogLuv32fromXYZ ( float *  ,
int   
)

◆ LogLuv32toXYZ()

void LogLuv32toXYZ ( uint32  ,
float *   
)

◆ TIFFAccessTagMethods()

TIFFTagMethods* TIFFAccessTagMethods ( TIFF )

Definition at line 58 of file tif_extension.c.

60 {
61  return &(tif->tif_tagmethods);
62 }

◆ TIFFCheckpointDirectory()

int TIFFCheckpointDirectory ( TIFF )

Definition at line 192 of file tif_dirwrite.c.

193 {
194  int rc;
195  /* Setup the strips arrays, if they haven't already been. */
196  if (tif->tif_dir.td_stripoffset == NULL)
197  (void) TIFFSetupStrips(tif);
199  (void) TIFFSetWriteOffset(tif, TIFFSeekFile(tif, 0, SEEK_END));
200  return rc;
201 }
#define TRUE
Definition: types.h:120
static int TIFFWriteDirectorySec(TIFF *tif, int isimage, int imagedone, uint64 *pdiroff)
Definition: tif_dirwrite.c:362
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
int TIFFSetupStrips(TIFF *tif)
Definition: tif_write.c:526
#define TIFFSeekFile(tif, off, whence)
Definition: tiffiop.h:221
smooth NULL
Definition: ftsmooth.c:416
void TIFFSetWriteOffset(TIFF *tif, toff_t off)
Definition: tif_write.c:823
#define SEEK_END
Definition: cabinet.c:27

◆ TIFFCheckTile()

int TIFFCheckTile ( TIFF tif,
uint32  x,
uint32  y,
uint32  z,
uint16  s 
)

Definition at line 74 of file tif_tile.c.

75 {
76  TIFFDirectory *td = &tif->tif_dir;
77 
78  if (x >= td->td_imagewidth) {
80  "%lu: Col out of range, max %lu",
81  (unsigned long) x,
82  (unsigned long) (td->td_imagewidth - 1));
83  return (0);
84  }
85  if (y >= td->td_imagelength) {
87  "%lu: Row out of range, max %lu",
88  (unsigned long) y,
89  (unsigned long) (td->td_imagelength - 1));
90  return (0);
91  }
92  if (z >= td->td_imagedepth) {
94  "%lu: Depth out of range, max %lu",
95  (unsigned long) z,
96  (unsigned long) (td->td_imagedepth - 1));
97  return (0);
98  }
100  s >= td->td_samplesperpixel) {
102  "%lu: Sample out of range, max %lu",
103  (unsigned long) s,
104  (unsigned long) (td->td_samplesperpixel - 1));
105  return (0);
106  }
107  return (1);
108 }
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
uint32 td_imagedepth
Definition: tif_dir.h:71
thandle_t tif_clientdata
Definition: tiffiop.h:191
char * tif_name
Definition: tiffiop.h:103
GLdouble GLdouble z
Definition: glext.h:5874
uint16 td_planarconfig
Definition: tif_dir.h:88
uint32 td_imagelength
Definition: tif_dir.h:71
void TIFFErrorExt(thandle_t fd, const char *module, const char *fmt,...)
Definition: tif_error.c:65
#define PLANARCONFIG_SEPARATE
Definition: tiff.h:241
GLdouble s
Definition: gl.h:2039
TIFFDirectory tif_dir
Definition: tiffiop.h:135
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
uint16 td_samplesperpixel
Definition: tif_dir.h:81
uint32 td_imagewidth
Definition: tif_dir.h:71

Referenced by _TIFFReadTileAndAllocBuffer(), TIFFReadTile(), and TIFFWriteTile().

◆ TIFFCIELabToRGBInit()

int TIFFCIELabToRGBInit ( TIFFCIELabToRGB ,
const TIFFDisplay ,
float *   
)

Definition at line 123 of file tif_color.c.

125 {
126  int i;
127  double dfGamma;
128 
129  cielab->range = CIELABTORGB_TABLE_RANGE;
130 
131  _TIFFmemcpy(&cielab->display, display, sizeof(TIFFDisplay));
132 
133  /* Red */
134  dfGamma = 1.0 / cielab->display.d_gammaR ;
135  cielab->rstep =
136  (cielab->display.d_YCR - cielab->display.d_Y0R) / cielab->range;
137  for(i = 0; i <= cielab->range; i++) {
138  cielab->Yr2r[i] = cielab->display.d_Vrwr
139  * ((float)pow((double)i / cielab->range, dfGamma));
140  }
141 
142  /* Green */
143  dfGamma = 1.0 / cielab->display.d_gammaG ;
144  cielab->gstep =
145  (cielab->display.d_YCR - cielab->display.d_Y0R) / cielab->range;
146  for(i = 0; i <= cielab->range; i++) {
147  cielab->Yg2g[i] = cielab->display.d_Vrwg
148  * ((float)pow((double)i / cielab->range, dfGamma));
149  }
150 
151  /* Blue */
152  dfGamma = 1.0 / cielab->display.d_gammaB ;
153  cielab->bstep =
154  (cielab->display.d_YCR - cielab->display.d_Y0R) / cielab->range;
155  for(i = 0; i <= cielab->range; i++) {
156  cielab->Yb2b[i] = cielab->display.d_Vrwb
157  * ((float)pow((double)i / cielab->range, dfGamma));
158  }
159 
160  /* Init reference white point */
161  cielab->X0 = refWhite[0];
162  cielab->Y0 = refWhite[1];
163  cielab->Z0 = refWhite[2];
164 
165  return 0;
166 }
int * display
Definition: x11stubs.c:12
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
Definition: glfuncs.h:248
float pow(float __x, int __y)
Definition: _cmath.h:458
#define CIELABTORGB_TABLE_RANGE
Definition: tiffio.h:170
GLenum GLint * range
Definition: glext.h:7539
void _TIFFmemcpy(void *d, const void *s, tmsize_t c)
Definition: tif_unix.c:344

Referenced by initCIELabConversion().

◆ TIFFCIELabToXYZ()

void TIFFCIELabToXYZ ( TIFFCIELabToRGB ,
uint32  ,
int32  ,
int32  ,
float *  ,
float *  ,
float *   
)

Definition at line 44 of file tif_color.c.

46 {
47  float L = (float)l * 100.0F / 255.0F;
48  float cby, tmp;
49 
50  if( L < 8.856F ) {
51  *Y = (L * cielab->Y0) / 903.292F;
52  cby = 7.787F * (*Y / cielab->Y0) + 16.0F / 116.0F;
53  } else {
54  cby = (L + 16.0F) / 116.0F;
55  *Y = cielab->Y0 * cby * cby * cby;
56  }
57 
58  tmp = (float)a / 500.0F + cby;
59  if( tmp < 0.2069F )
60  *X = cielab->X0 * (tmp - 0.13793F) / 7.787F;
61  else
62  *X = cielab->X0 * tmp * tmp * tmp;
63 
64  tmp = cby - (float)b / 200.0F;
65  if( tmp < 0.2069F )
66  *Z = cielab->Z0 * (tmp - 0.13793F) / 7.787F;
67  else
68  *Z = cielab->Z0 * tmp * tmp * tmp;
69 }
#define Y(I)
#define Z(I)
r l[0]
Definition: byte_order.h:167
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
static const WCHAR L[]
Definition: oid.c:1250
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
#define F(x, y, z)
Definition: md5.c:51

Referenced by DECLAREContigPutFunc().

◆ TIFFCleanup()

void TIFFCleanup ( TIFF tif)

Auxiliary function to free the TIFF structure. Given structure will be completely freed, so you should save opened file handle and pointer to the close procedure in external variables before calling _TIFFCleanup(), if you will need these ones to close the file.

Parameters
tifA TIFF pointer.

Definition at line 46 of file tif_close.c.

47 {
48  /*
49  * Flush buffered data and directory (if dirty).
50  */
51  if (tif->tif_mode != O_RDONLY)
52  TIFFFlush(tif);
53  (*tif->tif_cleanup)(tif);
54  TIFFFreeDirectory(tif);
55 
56  if (tif->tif_dirlist)
57  _TIFFfree(tif->tif_dirlist);
58 
59  /*
60  * Clean up client info links.
61  */
62  while( tif->tif_clientinfo )
63  {
64  TIFFClientInfoLink *psLink = tif->tif_clientinfo;
65 
66  tif->tif_clientinfo = psLink->next;
67  _TIFFfree( psLink->name );
68  _TIFFfree( psLink );
69  }
70 
71  if (tif->tif_rawdata && (tif->tif_flags&TIFF_MYBUFFER))
72  _TIFFfree(tif->tif_rawdata);
73  if (isMapped(tif))
75 
76  /*
77  * Clean up custom fields.
78  */
79  if (tif->tif_fields && tif->tif_nfields > 0) {
80  uint32 i;
81 
82  for (i = 0; i < tif->tif_nfields; i++) {
83  TIFFField *fld = tif->tif_fields[i];
84  if (fld->field_bit == FIELD_CUSTOM &&
85  strncmp("Tag ", fld->field_name, 4) == 0) {
86  _TIFFfree(fld->field_name);
87  _TIFFfree(fld);
88  }
89  }
90 
91  _TIFFfree(tif->tif_fields);
92  }
93 
94  if (tif->tif_nfieldscompat > 0) {
95  uint32 i;
96 
97  for (i = 0; i < tif->tif_nfieldscompat; i++) {
100  }
102  }
103 
104  _TIFFfree(tif);
105 }
#define FIELD_CUSTOM
Definition: tiffio.h:317
uint8 * tif_base
Definition: tiffiop.h:186
unsigned int uint32
Definition: types.h:32
uint64 toff_t
Definition: tiffio.h:66
TIFFClientInfoLink * tif_clientinfo
Definition: tiffiop.h:204
uint8 * tif_rawdata
Definition: tiffiop.h:179
#define TIFFUnmapFileContents(tif, addr, size)
Definition: tiffiop.h:229
unsigned short field_bit
Definition: tif_dir.h:286
char * name
Definition: tiffiop.h:83
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
Definition: glfuncs.h:248
char * field_name
Definition: tif_dir.h:289
int tif_mode
Definition: tiffiop.h:105
uint32 tif_flags
Definition: tiffiop.h:106
size_t tif_nfields
Definition: tiffiop.h:201
TIFFFieldArray * tif_fieldscompat
Definition: tiffiop.h:207
#define isMapped(tif)
Definition: tiffiop.h:214
uint32 allocated_size
Definition: tif_dir.h:273
void TIFFFreeDirectory(TIFF *tif)
Definition: tif_dir.c:1251
TIFFField * fields
Definition: tif_dir.h:275
struct client_info * next
Definition: tiffiop.h:81
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
Definition: utclib.c:534
uint64 * tif_dirlist
Definition: tiffiop.h:132
tmsize_t tif_size
Definition: tiffiop.h:187
TIFFVoidMethod tif_cleanup
Definition: tiffiop.h:172
TIFFField ** tif_fields
Definition: tiffiop.h:200
int TIFFFlush(TIFF *tif)
Definition: tif_flush.c:32
size_t tif_nfieldscompat
Definition: tiffiop.h:208
void _TIFFfree(void *p)
Definition: tif_unix.c:326
#define TIFF_MYBUFFER
Definition: tiffiop.h:115
#define O_RDONLY
Definition: acwin.h:108

Referenced by TIFFClientOpen(), and TIFFClose().

◆ TIFFClientdata()

thandle_t TIFFClientdata ( TIFF )

Definition at line 536 of file tif_open.c.

537 {
538  return (tif->tif_clientdata);
539 }

◆ TIFFClientOpen()

Definition at line 72 of file tif_open.c.

83 {
84  static const char module[] = "TIFFClientOpen";
85  TIFF *tif;
86  int m;
87  const char* cp;
88 
89  /* The following are configuration checks. They should be redundant, but should not
90  * compile to any actual code in an optimised release build anyway. If any of them
91  * fail, (makefile-based or other) configuration is not correct */
92  assert(sizeof(uint8)==1);
93  assert(sizeof(int8)==1);
94  assert(sizeof(uint16)==2);
95  assert(sizeof(int16)==2);
96  assert(sizeof(uint32)==4);
97  assert(sizeof(int32)==4);
98  assert(sizeof(uint64)==8);
99  assert(sizeof(int64)==8);
100  assert(sizeof(tmsize_t)==sizeof(void*));
101  {
102  union{
103  uint8 a8[2];
104  uint16 a16;
105  } n;
106  n.a8[0]=1;
107  n.a8[1]=0;
108  #ifdef WORDS_BIGENDIAN
109  assert(n.a16==256);
110  #else
111  assert(n.a16==1);
112  #endif
113  }
114 
116  if (m == -1)
117  goto bad2;
118  tif = (TIFF *)_TIFFmalloc((tmsize_t)(sizeof (TIFF) + strlen(name) + 1));
119  if (tif == NULL) {
120  TIFFErrorExt(clientdata, module, "%s: Out of memory (TIFF structure)", name);
121  goto bad2;
122  }
123  _TIFFmemset(tif, 0, sizeof (*tif));
124  tif->tif_name = (char *)tif + sizeof (TIFF);
125  strcpy(tif->tif_name, name);
126  tif->tif_mode = m &~ (O_CREAT|O_TRUNC);
127  tif->tif_curdir = (uint16) -1; /* non-existent directory */
128  tif->tif_curoff = 0;
129  tif->tif_curstrip = (uint32) -1; /* invalid strip */
130  tif->tif_row = (uint32) -1; /* read/write pre-increment */
131  tif->tif_clientdata = clientdata;
132  if (!readproc || !writeproc || !seekproc || !closeproc || !sizeproc) {
133  TIFFErrorExt(clientdata, module,
134  "One of the client procedures is NULL pointer.");
135  goto bad2;
136  }
137  tif->tif_readproc = readproc;
138  tif->tif_writeproc = writeproc;
139  tif->tif_seekproc = seekproc;
140  tif->tif_closeproc = closeproc;
141  tif->tif_sizeproc = sizeproc;
142  if (mapproc)
143  tif->tif_mapproc = mapproc;
144  else
146  if (unmapproc)
147  tif->tif_unmapproc = unmapproc;
148  else
150  _TIFFSetDefaultCompressionState(tif); /* setup default state */
151  /*
152  * Default is to return data MSB2LSB and enable the
153  * use of memory-mapped files and strip chopping when
154  * a file is opened read-only.
155  */
157  if (m == O_RDONLY )
158  tif->tif_flags |= TIFF_MAPPED;
159 
160  #ifdef STRIPCHOP_DEFAULT
161  if (m == O_RDONLY || m == O_RDWR)
163  #endif
164 
165  /*
166  * Process library-specific flags in the open mode string.
167  * The following flags may be used to control intrinsic library
168  * behaviour that may or may not be desirable (usually for
169  * compatibility with some application that claims to support
170  * TIFF but only supports some brain dead idea of what the
171  * vendor thinks TIFF is):
172  *
173  * 'l' use little-endian byte order for creating a file
174  * 'b' use big-endian byte order for creating a file
175  * 'L' read/write information using LSB2MSB bit order
176  * 'B' read/write information using MSB2LSB bit order
177  * 'H' read/write information using host bit order
178  * 'M' enable use of memory-mapped files when supported
179  * 'm' disable use of memory-mapped files
180  * 'C' enable strip chopping support when reading
181  * 'c' disable strip chopping support
182  * 'h' read TIFF header only, do not load the first IFD
183  * '4' ClassicTIFF for creating a file (default)
184  * '8' BigTIFF for creating a file
185  *
186  * The use of the 'l' and 'b' flags is strongly discouraged.
187  * These flags are provided solely because numerous vendors,
188  * typically on the PC, do not correctly support TIFF; they
189  * only support the Intel little-endian byte order. This
190  * support is not configured by default because it supports
191  * the violation of the TIFF spec that says that readers *MUST*
192  * support both byte orders. It is strongly recommended that
193  * you not use this feature except to deal with busted apps
194  * that write invalid TIFF. And even in those cases you should
195  * bang on the vendors to fix their software.
196  *
197  * The 'L', 'B', and 'H' flags are intended for applications
198  * that can optimize operations on data by using a particular
199  * bit order. By default the library returns data in MSB2LSB
200  * bit order for compatibility with older versions of this
201  * library. Returning data in the bit order of the native CPU
202  * makes the most sense but also requires applications to check
203  * the value of the FillOrder tag; something they probably do
204  * not do right now.
205  *
206  * The 'M' and 'm' flags are provided because some virtual memory
207  * systems exhibit poor behaviour when large images are mapped.
208  * These options permit clients to control the use of memory-mapped
209  * files on a per-file basis.
210  *
211  * The 'C' and 'c' flags are provided because the library support
212  * for chopping up large strips into multiple smaller strips is not
213  * application-transparent and as such can cause problems. The 'c'
214  * option permits applications that only want to look at the tags,
215  * for example, to get the unadulterated TIFF tag information.
216  */
217  for (cp = mode; *cp; cp++)
218  switch (*cp) {
219  case 'b':
220  #ifndef WORDS_BIGENDIAN
221  if (m&O_CREAT)
222  tif->tif_flags |= TIFF_SWAB;
223  #endif
224  break;
225  case 'l':
226  #ifdef WORDS_BIGENDIAN
227  if ((m&O_CREAT))
228  tif->tif_flags |= TIFF_SWAB;
229  #endif
230  break;
231  case 'B':
232  tif->tif_flags = (tif->tif_flags &~ TIFF_FILLORDER) |
234  break;
235  case 'L':
236  tif->tif_flags = (tif->tif_flags &~ TIFF_FILLORDER) |
238  break;
239  case 'H':
240  tif->tif_flags = (tif->tif_flags &~ TIFF_FILLORDER) |
242  break;
243  case 'M':
244  if (m == O_RDONLY)
245  tif->tif_flags |= TIFF_MAPPED;
246  break;
247  case 'm':
248  if (m == O_RDONLY)
249  tif->tif_flags &= ~TIFF_MAPPED;
250  break;
251  case 'C':
252  if (m == O_RDONLY)
253  tif->tif_flags |= TIFF_STRIPCHOP;
254  break;
255  case 'c':
256  if (m == O_RDONLY)
257  tif->tif_flags &= ~TIFF_STRIPCHOP;
258  break;
259  case 'h':
260  tif->tif_flags |= TIFF_HEADERONLY;
261  break;
262  case '8':
263  if (m&O_CREAT)
264  tif->tif_flags |= TIFF_BIGTIFF;
265  break;
266  }
267  /*
268  * Read in TIFF header.
269  */
270  if ((m & O_TRUNC) ||
271  !ReadOK(tif, &tif->tif_header, sizeof (TIFFHeaderClassic))) {
272  if (tif->tif_mode == O_RDONLY) {
274  "Cannot read TIFF header");
275  goto bad;
276  }
277  /*
278  * Setup header and write.
279  */
280  #ifdef WORDS_BIGENDIAN
283  #else
286  #endif
287  if (!(tif->tif_flags&TIFF_BIGTIFF))
288  {
290  tif->tif_header.classic.tiff_diroff = 0;
291  if (tif->tif_flags & TIFF_SWAB)
293  tif->tif_header_size = sizeof(TIFFHeaderClassic);
294  }
295  else
296  {
298  tif->tif_header.big.tiff_offsetsize = 8;
299  tif->tif_header.big.tiff_unused = 0;
300  tif->tif_header.big.tiff_diroff = 0;
301  if (tif->tif_flags & TIFF_SWAB)
302  {
305  }
306  tif->tif_header_size = sizeof (TIFFHeaderBig);
307  }
308  /*
309  * The doc for "fopen" for some STD_C_LIBs says that if you
310  * open a file for modify ("+"), then you must fseek (or
311  * fflush?) between any freads and fwrites. This is not
312  * necessary on most systems, but has been shown to be needed
313  * on Solaris.
314  */
315  TIFFSeekFile( tif, 0, SEEK_SET );
316  if (!WriteOK(tif, &tif->tif_header, (tmsize_t)(tif->tif_header_size))) {
318  "Error writing TIFF header");
319  goto bad;
320  }
321  /*
322  * Setup the byte order handling.
323  */
325  #ifndef WORDS_BIGENDIAN
326  tif->tif_flags |= TIFF_SWAB;
327  #endif
328  } else {
329  #ifdef WORDS_BIGENDIAN
330  tif->tif_flags |= TIFF_SWAB;
331  #endif
332  }
333  /*
334  * Setup default directory.
335  */
336  if (!TIFFDefaultDirectory(tif))
337  goto bad;
338  tif->tif_diroff = 0;
339  tif->tif_dirlist = NULL;
340  tif->tif_dirlistsize = 0;
341  tif->tif_dirnumber = 0;
342  return (tif);
343  }
344  /*
345  * Setup the byte order handling.
346  */
349  #if MDI_SUPPORT
350  &&
351  #if HOST_BIGENDIAN
353  #else
355  #endif
356  ) {
358  "Not a TIFF or MDI file, bad magic number %d (0x%x)",
359  #else
360  ) {
362  "Not a TIFF file, bad magic number %d (0x%x)",
363  #endif
366  goto bad;
367  }
369  #ifndef WORDS_BIGENDIAN
370  tif->tif_flags |= TIFF_SWAB;
371  #endif
372  } else {
373  #ifdef WORDS_BIGENDIAN
374  tif->tif_flags |= TIFF_SWAB;
375  #endif
376  }
377  if (tif->tif_flags & TIFF_SWAB)
382  "Not a TIFF file, bad version number %d (0x%x)",
385  goto bad;
386  }
388  {
389  if (tif->tif_flags & TIFF_SWAB)
391  tif->tif_header_size = sizeof(TIFFHeaderClassic);
392  }
393  else
394  {
395  if (!ReadOK(tif, ((uint8*)(&tif->tif_header) + sizeof(TIFFHeaderClassic)), (sizeof(TIFFHeaderBig)-sizeof(TIFFHeaderClassic))))
396  {
398  "Cannot read TIFF header");
399  goto bad;
400  }
401  if (tif->tif_flags & TIFF_SWAB)
402  {
405  }
406  if (tif->tif_header.big.tiff_offsetsize != 8)
407  {
409  "Not a TIFF file, bad BigTIFF offsetsize %d (0x%x)",
412  goto bad;
413  }
414  if (tif->tif_header.big.tiff_unused != 0)
415  {
417  "Not a TIFF file, bad BigTIFF unused %d (0x%x)",
419  tif->tif_header.big.tiff_unused);
420  goto bad;
421  }
422  tif->tif_header_size = sizeof(TIFFHeaderBig);
423  tif->tif_flags |= TIFF_BIGTIFF;
424  }
425  tif->tif_flags |= TIFF_MYBUFFER;
426  tif->tif_rawcp = tif->tif_rawdata = 0;
427  tif->tif_rawdatasize = 0;
428  tif->tif_rawdataoff = 0;
429  tif->tif_rawdataloaded = 0;
430 
431  switch (mode[0]) {
432  case 'r':
433  if (!(tif->tif_flags&TIFF_BIGTIFF))
435  else
437  /*
438  * Try to use a memory-mapped file if the client
439  * has not explicitly suppressed usage with the
440  * 'm' flag in the open mode (see above).
441  */
442  if (tif->tif_flags & TIFF_MAPPED)
443  {
444  toff_t n;
445  if (TIFFMapFileContents(tif,(void**)(&tif->tif_base),&n))
446  {
447  tif->tif_size=(tmsize_t)n;
448  assert((toff_t)tif->tif_size==n);
449  }
450  else
451  tif->tif_flags &= ~TIFF_MAPPED;
452  }
453  /*
454  * Sometimes we do not want to read the first directory (for example,
455  * it may be broken) and want to proceed to other directories. I this
456  * case we use the TIFF_HEADERONLY flag to open file and return
457  * immediately after reading TIFF header.
458  */
459  if (tif->tif_flags & TIFF_HEADERONLY)
460  return (tif);
461 
462  /*
463  * Setup initial directory.
464  */
465  if (TIFFReadDirectory(tif)) {
466  tif->tif_rawcc = (tmsize_t)-1;
467  tif->tif_flags |= TIFF_BUFFERSETUP;
468  return (tif);
469  }
470  break;
471  case 'a':
472  /*
473  * New directories are automatically append
474  * to the end of the directory chain when they
475  * are written out (see TIFFWriteDirectory).
476  */
477  if (!TIFFDefaultDirectory(tif))
478  goto bad;
479  return (tif);
480  }
481 bad:
482  tif->tif_mode = O_RDONLY; /* XXX avoid flush */
483  TIFFCleanup(tif);
484 bad2:
485  return ((TIFF*)0);
486 }
unsigned long long uint64
Definition: platform.h:18
static int _tiffDummyMapProc(thandle_t fd, void **pbase, toff_t *psize)
Definition: tif_open.c:35
TIFFSeekProc tif_seekproc
Definition: tiffiop.h:194
uint8 * tif_rawcp
Definition: tiffiop.h:183
void _TIFFmemset(void *p, int v, tmsize_t c)
Definition: tif_unix.c:338
uint16 tif_header_size
Definition: tiffiop.h:142
int TIFFReadDirectory(TIFF *tif)
Definition: tif_dirread.c:3542
uint8 * tif_base
Definition: tiffiop.h:186
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define TIFF_STRIPCHOP
Definition: tiffiop.h:121
TIFFUnmapFileProc tif_unmapproc
Definition: tiffiop.h:189
#define WriteOK(tif, buf, size)
Definition: tiffiop.h:243
unsigned int uint32
Definition: types.h:32
#define TIFFSeekFile(tif, off, whence)
Definition: tiffiop.h:221
uint64 toff_t
Definition: tiffio.h:66
uint32 tif_curstrip
Definition: tiffiop.h:145
#define FILLORDER_LSB2MSB
Definition: tiff.h:217
GLdouble n
Definition: glext.h:7729
#define assert(x)
Definition: debug.h:53
struct tiff TIFF
Definition: tiffio.h:38
uint8 * tif_rawdata
Definition: tiffiop.h:179
uint64 tif_curoff
Definition: tiffiop.h:146
thandle_t tif_clientdata
Definition: tiffiop.h:191
tmsize_t tif_rawdataoff
Definition: tiffiop.h:181
#define STRIPCHOP_DEFAULT
Definition: tiffconf.h:124
long long int64
Definition: platform.h:13
tmsize_t tif_rawcc
Definition: tiffiop.h:184
uint16 tif_curdir
Definition: tiffiop.h:144
char * tif_name
Definition: tiffiop.h:103
const GLfloat * m
Definition: glext.h:10848
Definition: tiffiop.h:102
void TIFFCleanup(TIFF *tif)
Definition: tif_close.c:46
#define TIFF_HEADERONLY
Definition: tiffiop.h:122
TIFFHeaderCommon common
Definition: tiffiop.h:138
#define TIFF_BIGTIFF
Definition: tiffiop.h:125
#define TIFF_SWAB
Definition: tiffiop.h:113
static BOOL readproc(HANDLE proc, LPVOID address, PVOID target, DWORD size)
Definition: env.c:189
TIFF_SSIZE_T tmsize_t
Definition: tiffio.h:65
int tif_mode
Definition: tiffiop.h:105
uint32 tif_flags
Definition: tiffiop.h:106
smooth NULL
Definition: ftsmooth.c:416
uint64 tif_nextdiroff
Definition: tiffiop.h:131
void * _TIFFmalloc(tmsize_t s)
Definition: tif_unix.c:309
#define TIFFMapFileContents(tif, paddr, psize)
Definition: tiffiop.h:227
TIFFMapFileProc tif_mapproc
Definition: tiffiop.h:188
#define MDI_BIGENDIAN
Definition: tiff.h:54
#define SEEK_SET
Definition: jmemansi.c:26
#define TIFF_FILLORDER
Definition: tiffiop.h:107
void TIFFSwabShort(uint16 *wp)
Definition: tif_swab.c:34
#define TIFF_BIGENDIAN
Definition: tiff.h:51
uint32 tiff_diroff
Definition: tiff.h:98
if(!(yy_init))
Definition: macro.lex.yy.c:714
unsigned char uint8
Definition: types.h:28
void TIFFErrorExt(thandle_t fd, const char *module, const char *fmt,...)
Definition: tif_error.c:65
static void _tiffDummyUnmapProc(thandle_t fd, void *base, toff_t size)
Definition: tif_open.c:42
tmsize_t tif_rawdatasize
Definition: tiffiop.h:180
tmsize_t tif_rawdataloaded
Definition: tiffiop.h:182
#define HOST_BIGENDIAN
Definition: tiffconf.h:86
uint64 * tif_dirlist
Definition: tiffiop.h:132
uint16 tif_dirnumber
Definition: tiffiop.h:134
uint64 tif_diroff
Definition: tiffiop.h:130
TIFFReadWriteProc tif_readproc
Definition: tiffiop.h:192
tmsize_t tif_size
Definition: tiffiop.h:187
#define O_TRUNC
Definition: acwin.h:112
TIFFSizeProc tif_sizeproc
Definition: tiffiop.h:196
void _TIFFSetDefaultCompressionState(TIFF *tif)
Definition: tif_compress.c:135
GLenum mode
Definition: glext.h:6217
union tiff::@3328 tif_header
#define MDI_SUPPORT
Definition: tiffconf.h:139
TIFFCloseProc tif_closeproc
Definition: tiffiop.h:195
#define TIFF_BUFFERSETUP
Definition: tiffiop.h:110
TIFFReadWriteProc tif_writeproc
Definition: tiffiop.h:193
TIFFHeaderBig big
Definition: tiffiop.h:140
#define HOST_FILLORDER
Definition: tif_config.h:113
uint16 tiff_version
Definition: tiff.h:93
uint16 tiff_magic
Definition: tiff.h:92
#define TIFF_MAPPED
Definition: tiffiop.h:117
uint32 tif_row
Definition: tiffiop.h:143
void TIFFSwabLong(uint32 *lp)
Definition: tif_swab.c:45
#define TIFF_LITTLEENDIAN
Definition: tiff.h:52
int _TIFFgetMode(const char *mode, const char *module)
Definition: tif_open.c:48
unsigned short uint16
Definition: types.h:30
short int16
Definition: platform.h:11
#define O_RDWR
Definition: fcntl.h:36
int TIFFDefaultDirectory(TIFF *tif)
Definition: tif_dir.c:1356
POINT cp
Definition: magnifier.c:59
Definition: name.c:36
long int32
Definition: platform.h:12
#define ReadOK(tif, buf, size)
Definition: tiffiop.h:236
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
#define TIFF_VERSION_CLASSIC
Definition: tiff.h:48
uint64 tiff_diroff
Definition: tiff.h:105
TIFFHeaderClassic classic
Definition: tiffiop.h:139
#define MDI_LITTLEENDIAN
Definition: tiff.h:53
uint16 tiff_offsetsize
Definition: tiff.h:103
uint16 tiff_unused
Definition: tiff.h:104
#define O_CREAT
Definition: acwin.h:110
#define TIFF_VERSION_BIG
Definition: tiff.h:49
uint16 tif_dirlistsize
Definition: tiffiop.h:133
#define FILLORDER_MSB2LSB
Definition: tiff.h:216
#define TIFF_MYBUFFER
Definition: tiffiop.h:115
void TIFFSwabLong8(uint64 *lp)
Definition: tif_swab.c:57
char int8
Definition: platform.h:10
#define O_RDONLY
Definition: acwin.h:108

Referenced by _tiffStreamOpen(), and TIFFFdOpen().

◆ TIFFClose()

void TIFFClose ( TIFF tif)

Close a previously opened TIFF file.

TIFFClose closes a file that was previously opened with TIFFOpen(). Any buffered data are flushed to the file, including the contents of the current directory (if modified); and all resources are reclaimed.

Parameters
tifA TIFF pointer.

Definition at line 122 of file tif_close.c.

123 {
124  TIFFCloseProc closeproc = tif->tif_closeproc;
125  thandle_t fd = tif->tif_clientdata;
126 
127  TIFFCleanup(tif);
128  (void) (*closeproc)(fd);
129 }
int(* TIFFCloseProc)(thandle_t)
Definition: tiffio.h:280
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
static int fd
Definition: io.c:51
thandle_t tif_clientdata
Definition: tiffiop.h:191
void TIFFCleanup(TIFF *tif)
Definition: tif_close.c:46
TIFFCloseProc tif_closeproc
Definition: tiffiop.h:195

◆ TIFFComputeStrip()

uint32 TIFFComputeStrip ( TIFF ,
uint32  ,
uint16   
)

Definition at line 37 of file tif_strip.c.

38 {
39  static const char module[] = "TIFFComputeStrip";
40  TIFFDirectory *td = &tif->tif_dir;
41  uint32 strip;
42 
43  strip = row / td->td_rowsperstrip;
45  if (sample >= td->td_samplesperpixel) {
46  TIFFErrorExt(tif->tif_clientdata, module,
47  "%lu: Sample out of range, max %lu",
48  (unsigned long) sample, (unsigned long) td->td_samplesperpixel);
49  return (0);
50  }
51  strip += (uint32)sample*td->td_stripsperimage;
52  }
53  return (strip);
54 }
unsigned int uint32
Definition: types.h:32
uint32 td_stripsperimage
Definition: tif_dir.h:98
uint16 td_planarconfig
Definition: tif_dir.h:88
void TIFFErrorExt(thandle_t fd, const char *module, const char *fmt,...)
Definition: tif_error.c:65
#define PLANARCONFIG_SEPARATE
Definition: tiff.h:241
uint32 td_rowsperstrip
Definition: tif_dir.h:82
uint16 td_samplesperpixel
Definition: tif_dir.h:81
struct png_info_def *typedef unsigned char **typedef struct png_info_def *typedef struct png_info_def *typedef struct png_info_def *typedef unsigned char ** row
Definition: typeof.h:78

Referenced by gtStripContig(), and gtStripSeparate().

◆ TIFFComputeTile()

uint32 TIFFComputeTile ( TIFF tif,
uint32  x,
uint32  y,
uint32  z,
uint16  s 
)

Definition at line 37 of file tif_tile.c.

38 {
39  TIFFDirectory *td = &tif->tif_dir;
40  uint32 dx = td->td_tilewidth;
41  uint32 dy = td->td_tilelength;
42  uint32 dz = td->td_tiledepth;
43  uint32 tile = 1;
44 
45  if (td->td_imagedepth == 1)
46  z = 0;
47  if (dx == (uint32) -1)
48  dx = td->td_imagewidth;
49  if (dy == (uint32) -1)
50  dy = td->td_imagelength;
51  if (dz == (uint32) -1)
52  dz = td->td_imagedepth;
53  if (dx != 0 && dy != 0 && dz != 0) {
56  uint32 zpt = TIFFhowmany_32(td->td_imagedepth, dz);
57 
59  tile = (xpt*ypt*zpt)*s +
60  (xpt*ypt)*(z/dz) +
61  xpt*(y/dy) +
62  x/dx;
63  else
64  tile = (xpt*ypt)*(z/dz) + xpt*(y/dy) + x/dx;
65  }
66  return (tile);
67 }
uint32 td_tiledepth
Definition: tif_dir.h:72
#define TIFFhowmany_32(x, y)
Definition: tiffiop.h:248
unsigned int uint32
Definition: types.h:32
GLint dy
Definition: linetemp.h:97
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
uint32 td_imagedepth
Definition: tif_dir.h:71
uint32 td_tilelength
Definition: tif_dir.h:72
GLdouble GLdouble z
Definition: glext.h:5874
uint16 td_planarconfig
Definition: tif_dir.h:88
uint32 td_imagelength
Definition: tif_dir.h:71
uint32 td_tilewidth
Definition: tif_dir.h:72
#define PLANARCONFIG_SEPARATE
Definition: tiff.h:241
GLdouble s
Definition: gl.h:2039
TIFFDirectory tif_dir
Definition: tiffiop.h:135
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLint dx
Definition: linetemp.h:97
uint32 td_imagewidth
Definition: tif_dir.h:71

Referenced by _TIFFReadTileAndAllocBuffer(), TIFFReadTile(), and TIFFWriteTile().

◆ TIFFCreateCustomDirectory()

int TIFFCreateCustomDirectory ( TIFF ,
const TIFFFieldArray  
)

Definition at line 1324 of file tif_dir.c.

1325 {
1326  TIFFDefaultDirectory(tif);
1327 
1328  /*
1329  * Reset the field definitions to match the application provided list.
1330  * Hopefully TIFFDefaultDirectory() won't have done anything irreversable
1331  * based on it's assumption this is an image directory.
1332  */
1333  _TIFFSetupFields(tif, infoarray);
1334 
1335  tif->tif_diroff = 0;
1336  tif->tif_nextdiroff = 0;
1337  tif->tif_curoff = 0;
1338  tif->tif_row = (uint32) -1;
1339  tif->tif_curstrip = (uint32) -1;
1340 
1341  return 0;
1342 }
unsigned int uint32
Definition: types.h:32
void _TIFFSetupFields(TIFF *tif, const TIFFFieldArray *fieldarray)
Definition: tif_dirinfo.c:317
int TIFFDefaultDirectory(TIFF *tif)
Definition: tif_dir.c:1356

Referenced by TIFFCreateEXIFDirectory().

◆ TIFFCreateDirectory()

int TIFFCreateDirectory ( TIFF )

Definition at line 1311 of file tif_dir.c.

1312 {
1313  TIFFDefaultDirectory(tif);
1314  tif->tif_diroff = 0;
1315  tif->tif_nextdiroff = 0;
1316  tif->tif_curoff = 0;
1317  tif->tif_row = (uint32) -1;
1318  tif->tif_curstrip = (uint32) -1;
1319 
1320  return 0;
1321 }
unsigned int uint32
Definition: types.h:32
int TIFFDefaultDirectory(TIFF *tif)
Definition: tif_dir.c:1356

Referenced by TIFFWriteDirectorySec().

◆ TIFFCreateEXIFDirectory()

int TIFFCreateEXIFDirectory ( TIFF )

Definition at line 1345 of file tif_dir.c.

1346 {
1350 }
int TIFFCreateCustomDirectory(TIFF *tif, const TIFFFieldArray *infoarray)
Definition: tif_dir.c:1324
const TIFFFieldArray * _TIFFGetExifFields(void)
Definition: tif_dirinfo.c:311
static const TIFFFieldArray exifFieldArray
Definition: tif_dirinfo.c:49

◆ TIFFCurrentDirectory()

uint16 TIFFCurrentDirectory ( TIFF )

Definition at line 595 of file tif_open.c.

596 {
597  return (tif->tif_curdir);
598 }

◆ TIFFCurrentDirOffset()

uint64 TIFFCurrentDirOffset ( TIFF )

Definition at line 1648 of file tif_dir.c.

1649 {
1650  return (tif->tif_diroff);
1651 }

◆ TIFFCurrentRow()

uint32 TIFFCurrentRow ( TIFF )

Definition at line 586 of file tif_open.c.

587 {
588  return (tif->tif_row);
589 }

◆ TIFFCurrentStrip()

uint32 TIFFCurrentStrip ( TIFF )

Definition at line 604 of file tif_open.c.

605 {
606  return (tif->tif_curstrip);
607 }

◆ TIFFCurrentTile()

uint32 TIFFCurrentTile ( TIFF tif)

Definition at line 613 of file tif_open.c.

614 {
615  return (tif->tif_curtile);
616 }
uint32 tif_curtile
Definition: tiffiop.h:153

◆ TIFFDataWidth()

int TIFFDataWidth ( TIFFDataType  )

Definition at line 438 of file tif_dirinfo.c.

439 {
440  switch(type)
441  {
442  case 0: /* nothing */
443  case TIFF_BYTE:
444  case TIFF_ASCII:
445  case TIFF_SBYTE:
446  case TIFF_UNDEFINED:
447  return 1;
448  case TIFF_SHORT:
449  case TIFF_SSHORT:
450  return 2;
451  case TIFF_LONG:
452  case TIFF_SLONG:
453  case TIFF_FLOAT:
454  case TIFF_IFD:
455  return 4;
456  case TIFF_RATIONAL:
457  case TIFF_SRATIONAL:
458  case TIFF_DOUBLE:
459  case TIFF_LONG8:
460  case TIFF_SLONG8:
461  case TIFF_IFD8:
462  return 8;
463  default:
464  return 0; /* will return 0 for unknown types */
465  }
466 }
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
Definition: tiff.h:137

Referenced by _TIFFRewriteField(), EstimateStripByteCounts(), and TIFFReadDirEntryArrayWithLimit().

◆ TIFFDefaultStripSize()

uint32 TIFFDefaultStripSize ( TIFF tif,
uint32  request 
)

Definition at line 233 of file tif_strip.c.

234 {
235  return (*tif->tif_defstripsize)(tif, request);
236 }
Definition: tftpd.h:85
TIFFStripMethod tif_defstripsize
Definition: tiffiop.h:173

◆ TIFFDefaultTileSize()

void TIFFDefaultTileSize ( TIFF ,
uint32 ,
uint32  
)

Definition at line 294 of file tif_tile.c.

295 {
296  (*tif->tif_deftilesize)(tif, tw, th);
297 }

◆ TIFFError()

void TIFFError ( const char ,
const char ,
  ... 
)

◆ TIFFErrorExt()

void void TIFFErrorExt ( thandle_t  ,
const char ,
const char ,
  ... 
)

◆ TIFFFdOpen()

TIFF* TIFFFdOpen ( int  ,
const char ,
const char  
)

Definition at line 203 of file tif_unix.c.

204 {
205  TIFF* tif;
206 
208  fdh.fd = fd;
209  tif = TIFFClientOpen(name, mode,
210  fdh.h,
214  if (tif)
215  tif->tif_fd = fd;
216  return (tif);
217 }
static tmsize_t _tiffReadProc(thandle_t fd, void *buf, tmsize_t size)
Definition: tif_unix.c:67
static int fd
Definition: io.c:51
thandle_t h
Definition: tif_unix.c:63
Definition: tiffiop.h:102
int tif_fd
Definition: tiffiop.h:104
static tmsize_t _tiffWriteProc(thandle_t fd, void *buf, tmsize_t size)
Definition: tif_unix.c:95
TIFF * TIFFClientOpen(const char *name, const char *mode, thandle_t clientdata, TIFFReadWriteProc readproc, TIFFReadWriteProc writeproc, TIFFSeekProc seekproc, TIFFCloseProc closeproc, TIFFSizeProc sizeproc, TIFFMapFileProc mapproc, TIFFUnmapFileProc unmapproc)
Definition: tif_open.c:72
static int _tiffCloseProc(thandle_t fd)
Definition: tif_unix.c:138
static uint64 _tiffSeekProc(thandle_t fd, uint64 off, int whence)
Definition: tif_unix.c:124
static uint64 _tiffSizeProc(thandle_t fd)
Definition: tif_unix.c:146
GLenum mode
Definition: glext.h:6217
static int _tiffMapProc(thandle_t fd, void **pbase, toff_t *psize)
Definition: tif_unix.c:186
static void _tiffUnmapProc(thandle_t fd, void *base, toff_t size)
Definition: tif_unix.c:193
Definition: name.c:36

Referenced by TIFFOpen(), and TIFFOpenW().

◆ TIFFFieldDataType()

TIFFDataType TIFFFieldDataType ( const TIFFField )

Definition at line 594 of file tif_dirinfo.c.

595 {
596  return fip->field_type;
597 }

◆ TIFFFieldName()

const char* TIFFFieldName ( const TIFFField )

Definition at line 588 of file tif_dirinfo.c.

589 {
590  return fip->field_name;
591 }

◆ TIFFFieldPassCount()

int TIFFFieldPassCount ( const TIFFField )

Definition at line 600 of file tif_dirinfo.c.

601 {
602  return fip->field_passcount;
603 }

◆ TIFFFieldReadCount()

int TIFFFieldReadCount ( const TIFFField )

Definition at line 606 of file tif_dirinfo.c.

607 {
608  return fip->field_readcount;
609 }

◆ TIFFFieldTag()

uint32 TIFFFieldTag ( const TIFFField )

Definition at line 582 of file tif_dirinfo.c.

583 {
584  return fip->field_tag;
585 }

Referenced by TIFFWriteDirectorySec().

◆ TIFFFieldWithName()

const TIFFField* TIFFFieldWithName ( TIFF ,
const char  
)

Definition at line 570 of file tif_dirinfo.c.

571 {
572  const TIFFField* fip =
573  _TIFFFindFieldByName(tif, field_name, TIFF_ANY);
574  if (!fip) {
575  TIFFErrorExt(tif->tif_clientdata, "TIFFFieldWithName",
576  "Internal error, unknown tag %s", field_name);
577  }
578  return (fip);
579 }
static const TIFFField * _TIFFFindFieldByName(TIFF *tif, const char *field_name, TIFFDataType dt)
Definition: tif_dirinfo.c:531
#define TIFF_ANY
Definition: tiffio.h:312
void TIFFErrorExt(thandle_t fd, const char *module, const char *fmt,...)
Definition: tif_error.c:65

◆ TIFFFieldWithTag()

const TIFFField* TIFFFieldWithTag ( TIFF ,
uint32   
)

Definition at line 558 of file tif_dirinfo.c.

559 {
560  const TIFFField* fip = TIFFFindField(tif, tag, TIFF_ANY);
561  if (!fip) {
562  TIFFErrorExt(tif->tif_clientdata, "TIFFFieldWithTag",
563  "Internal error, unknown tag 0x%x",
564  (unsigned int) tag);
565  }
566  return (fip);
567 }
#define TIFF_ANY
Definition: tiffio.h:312
Definition: ecma_167.h:138
void TIFFErrorExt(thandle_t fd, const char *module, const char *fmt,...)
Definition: tif_error.c:65
const TIFFField * TIFFFindField(TIFF *tif, uint32 tag, TIFFDataType dt)
Definition: tif_dirinfo.c:506

Referenced by _TIFFVSetField(), CheckDirCount(), TIFFFetchStripThing(), TIFFPrintDirectory(), TIFFReadDirectory(), and TIFFUnsetField().

◆ TIFFFieldWriteCount()

int TIFFFieldWriteCount ( const TIFFField )

Definition at line 612 of file tif_dirinfo.c.

613 {
614  return fip->field_writecount;
615 }

◆ TIFFFileName()

◆ TIFFFileno()

int TIFFFileno ( TIFF )

Definition at line 516 of file tif_open.c.

517 {
518  return (tif->tif_fd);
519 }

◆ TIFFFindCODEC()

const TIFFCodec* TIFFFindCODEC ( uint16  )

Definition at line 186 of file tif_compress.c.

187 {
188  const TIFFCodec* c;
189  codec_t* cd;
190 
191  for (cd = registeredCODECS; cd; cd = cd->next)
192  if (cd->info->scheme == scheme)
193  return ((const TIFFCodec*) cd->info);
194  for (c = _TIFFBuiltinCODECS; c->name; c++)
195  if (c->scheme == scheme)
196  return (c);
197  return ((const TIFFCodec*) 0);
198 }
static struct cd_image cd
Definition: cdmake.c:182
DWORD scheme
static codec_t * registeredCODECS
Definition: tif_compress.c:183
const GLubyte * c
Definition: glext.h:8905
TIFFCodec _TIFFBuiltinCODECS[]
Definition: tif_codec.c:87
#define c
Definition: ke_i.h:80
char * name
Definition: tiffio.h:256

Referenced by _notConfigured(), TIFFIsCODECConfigured(), TIFFNoDecode(), TIFFNoEncode(), TIFFPrintDirectory(), and TIFFSetCompressionScheme().

◆ TIFFFindField()

const TIFFField* TIFFFindField ( TIFF ,
uint32  ,
TIFFDataType   
)

Definition at line 506 of file tif_dirinfo.c.

507 {
508  TIFFField key = {0, 0, 0, TIFF_NOTYPE, 0, 0, 0, 0, 0, 0, NULL, NULL};
509  TIFFField* pkey = &key;
510  const TIFFField **ret;
511  if (tif->tif_foundfield && tif->tif_foundfield->field_tag == tag &&
512  (dt == TIFF_ANY || dt == tif->tif_foundfield->field_type))
513  return tif->tif_foundfield;
514 
515  /* If we are invoked with no field information, then just return. */
516  if (!tif->tif_fields)
517  return NULL;
518 
519  /* NB: use sorted search (e.g. binary search) */
520 
521  key.field_tag = tag;
522  key.field_type = dt;
523 
524  ret = (const TIFFField **) bsearch(&pkey, tif->tif_fields,
525  tif->tif_nfields,
526  sizeof(TIFFField *), tagCompare);
527  return tif->tif_foundfield = (ret ? *ret : NULL);
528 }
#define TIFF_ANY
Definition: tiffio.h:312
Definition: ecma_167.h:138
smooth NULL
Definition: ftsmooth.c:416
int ret
HKEY key
Definition: reg.c:42
static int tagCompare(const void *a, const void *b)
Definition: tif_dirinfo.c:342
Definition: path.c:42
#define bsearch
char * tag
Definition: main.c:59

Referenced by _TIFFFindOrRegisterField(), _TIFFMergeFields(), _TIFFRewriteField(), _TIFFVGetField(), _TIFFVSetField(), OkToChangeTag(), TIFFFieldWithTag(), and TIFFVGetField().

◆ TIFFFlush()

int TIFFFlush ( TIFF tif)

Definition at line 32 of file tif_flush.c.

33 {
34  if( tif->tif_mode == O_RDONLY )
35  return 1;
36 
37  if (!TIFFFlushData(tif))
38  return (0);
39 
40  /* In update (r+) mode we try to detect the case where
41  only the strip/tile map has been altered, and we try to
42  rewrite only that portion of the directory without
43  making any other changes */
44 
45  if( (tif->tif_flags & TIFF_DIRTYSTRIP)
46  && !(tif->tif_flags & TIFF_DIRTYDIRECT)
47  && tif->tif_mode == O_RDWR )
48  {
49  uint64 *offsets=NULL, *sizes=NULL;
50 
51  if( TIFFIsTiled(tif) )
52  {
53  if( TIFFGetField( tif, TIFFTAG_TILEOFFSETS, &offsets )
56  tif->tif_dir.td_nstrips, offsets )
58  tif->tif_dir.td_nstrips, sizes ) )
59  {
60  tif->tif_flags &= ~TIFF_DIRTYSTRIP;
61  tif->tif_flags &= ~TIFF_BEENWRITING;
62  return 1;
63  }
64  }
65  else
66  {
67  if( TIFFGetField( tif, TIFFTAG_STRIPOFFSETS, &offsets )
70  tif->tif_dir.td_nstrips, offsets )
72  tif->tif_dir.td_nstrips, sizes ) )
73  {
74  tif->tif_flags &= ~TIFF_DIRTYSTRIP;
75  tif->tif_flags &= ~TIFF_BEENWRITING;
76  return 1;
77  }
78  }
79  }
80 
82  && !TIFFRewriteDirectory(tif))
83  return (0);
84 
85  return (1);
86 }
unsigned long long uint64
Definition: platform.h:18
#define TIFF_BEENWRITING
Definition: tiffiop.h:112
int TIFFRewriteDirectory(TIFF *tif)
Definition: tif_dirwrite.c:216
#define TIFFTAG_STRIPBYTECOUNTS
Definition: tiff.h:234
#define TIFFTAG_STRIPOFFSETS
Definition: tiff.h:222
#define TIFF_DIRTYDIRECT
Definition: tiffiop.h:109
#define TIFFTAG_TILEBYTECOUNTS
Definition: tiff.h:289
int TIFFGetField(TIFF *tif, uint32 tag,...)
Definition: tif_dir.c:1215
int TIFFFlushData(TIFF *tif)
Definition: tif_flush.c:98
int tif_mode
Definition: tiffiop.h:105
uint32 tif_flags
Definition: tiffiop.h:106
smooth NULL
Definition: ftsmooth.c:416
#define TIFFTAG_TILEOFFSETS
Definition: tiff.h:288
uint32 td_nstrips
Definition: tif_dir.h:99
#define TIFF_DIRTYSTRIP
Definition: tiffiop.h:127
static const struct @527 sizes[]
#define O_RDWR
Definition: fcntl.h:36
TIFFDirectory tif_dir
Definition: tiffiop.h:135
int _TIFFRewriteField(TIFF *tif, uint16 tag, TIFFDataType in_datatype, tmsize_t count, void *data)
int TIFFIsTiled(TIFF *tif)
Definition: tif_open.c:577
#define O_RDONLY
Definition: acwin.h:108

Referenced by TIFFCleanup().

◆ TIFFFlushData()

int TIFFFlushData ( TIFF tif)

Definition at line 98 of file tif_flush.c.

99 {
100  if ((tif->tif_flags & TIFF_BEENWRITING) == 0)
101  return (1);
102  if (tif->tif_flags & TIFF_POSTENCODE) {
103  tif->tif_flags &= ~TIFF_POSTENCODE;
104  if (!(*tif->tif_postencode)(tif))
105  return (0);
106  }
107  return (TIFFFlushData1(tif));
108 }
#define TIFF_BEENWRITING
Definition: tiffiop.h:112
uint32 tif_flags
Definition: tiffiop.h:106
#define TIFF_POSTENCODE
Definition: tiffiop.h:118
TIFFBoolMethod tif_postencode
Definition: tiffiop.h:163
int TIFFFlushData1(TIFF *tif)
Definition: tif_write.c:792

Referenced by TIFFFlush(), and TIFFWriteScanline().

◆ TIFFFreeDirectory()

void TIFFFreeDirectory ( TIFF )

Definition at line 1251 of file tif_dir.c.

1252 {
1253  TIFFDirectory *td = &tif->tif_dir;
1254  int i;
1255 
1257  CleanupField(td_sminsamplevalue);
1258  CleanupField(td_smaxsamplevalue);
1259  CleanupField(td_colormap[0]);
1260  CleanupField(td_colormap[1]);
1261  CleanupField(td_colormap[2]);
1262  CleanupField(td_sampleinfo);
1263  CleanupField(td_subifd);
1264  CleanupField(td_inknames);
1265  CleanupField(td_refblackwhite);
1266  CleanupField(td_transferfunction[0]);
1267  CleanupField(td_transferfunction[1]);
1268  CleanupField(td_transferfunction[2]);
1269  CleanupField(td_stripoffset);
1270  CleanupField(td_stripbytecount);
1273 
1274  /* Cleanup custom tag values */
1275  for( i = 0; i < td->td_customValueCount; i++ ) {
1276  if (td->td_customValues[i].value)
1278  }
1279 
1280  td->td_customValueCount = 0;
1281  CleanupField(td_customValues);
1282 
1283 #if defined(DEFER_STRILE_LOAD)
1284  _TIFFmemset( &(td->td_stripoffset_entry), 0, sizeof(TIFFDirEntry));
1285  _TIFFmemset( &(td->td_stripbytecount_entry), 0, sizeof(TIFFDirEntry));
1286 #endif
1287 }
void _TIFFmemset(void *p, int v, tmsize_t c)
Definition: tif_unix.c:338
#define TIFFClrFieldBit(tif, field)
Definition: tif_dir.h:194
TIFFTagValue * td_customValues
Definition: tif_dir.h:120
int td_customValueCount
Definition: tif_dir.h:119
#define FIELD_YCBCRSUBSAMPLING
Definition: tif_dir.h:167
#define FIELD_SETLONGS
Definition: tif_dir.h:67
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
Definition: glfuncs.h:248
#define CleanupField(member)
Definition: tif_dir.c:1240
#define FIELD_YCBCRPOSITIONING
Definition: tif_dir.h:168
void * value
Definition: tif_dir.h:38
unsigned long td_fieldsset[FIELD_SETLONGS]
Definition: tif_dir.h:69
void _TIFFfree(void *p)
Definition: tif_unix.c:326

Referenced by TIFFCleanup(), TIFFReadCustomDirectory(), TIFFReadDirectory(), TIFFUnlinkDirectory(), and TIFFWriteDirectorySec().

◆ TIFFGetBitRevTable()

const unsigned char* TIFFGetBitRevTable ( int  )

Definition at line 278 of file tif_swab.c.

279 {
280  return (reversed ? TIFFBitRevTable : TIFFNoBitRevTable);
281 }
static const unsigned char TIFFNoBitRevTable[256]
Definition: tif_swab.c:242
static const unsigned char TIFFBitRevTable[256]
Definition: tif_swab.c:208

◆ TIFFGetClientInfo()

void* TIFFGetClientInfo ( TIFF ,
const char  
)

Definition at line 64 of file tif_extension.c.

66 {
67  TIFFClientInfoLink *psLink = tif->tif_clientinfo;
68 
69  while( psLink != NULL && strcmp(psLink->name,name) != 0 )
70  psLink = psLink->next;
71 
72  if( psLink != NULL )
73  return psLink->data;
74  else
75  return NULL;
76 }
void * data
Definition: tiffiop.h:82
char * name
Definition: tiffiop.h:83
smooth NULL
Definition: ftsmooth.c:416
struct client_info * next
Definition: tiffiop.h:81
Definition: name.c:36
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469

◆ TIFFGetCloseProc()

TIFFCloseProc TIFFGetCloseProc ( TIFF )

Definition at line 685 of file tif_open.c.

686 {
687  return (tif->tif_closeproc);
688 }

◆ TIFFGetConfiguredCODECs()

TIFFCodec* TIFFGetConfiguredCODECs ( void  )

Get list of configured codecs, both built-in and registered by user. Caller is responsible to free this structure.

Returns
returns array of TIFFCodec records (the last record should be NULL) or NULL if function failed.

Definition at line 252 of file tif_compress.c.

253 {
254  int i = 1;
255  codec_t *cd;
256  const TIFFCodec* c;
257  TIFFCodec* codecs = NULL;
258  TIFFCodec* new_codecs;
259 
260  for (cd = registeredCODECS; cd; cd = cd->next) {
261  new_codecs = (TIFFCodec *)
262  _TIFFrealloc(codecs, i * sizeof(TIFFCodec));
263  if (!new_codecs) {
264  _TIFFfree (codecs);
265  return NULL;
266  }
267  codecs = new_codecs;
268  _TIFFmemcpy(codecs + i - 1, cd, sizeof(TIFFCodec));
269  i++;
270  }
271  for (c = _TIFFBuiltinCODECS; c->name; c++) {
272  if (TIFFIsCODECConfigured(c->scheme)) {
273  new_codecs = (TIFFCodec *)
274  _TIFFrealloc(codecs, i * sizeof(TIFFCodec));
275  if (!new_codecs) {
276  _TIFFfree (codecs);
277  return NULL;
278  }
279  codecs = new_codecs;
280  _TIFFmemcpy(codecs + i - 1, (const void*)c, sizeof(TIFFCodec));
281  i++;
282  }
283  }
284 
285  new_codecs = (TIFFCodec *) _TIFFrealloc(codecs, i * sizeof(TIFFCodec));
286  if (!new_codecs) {
287  _TIFFfree (codecs);
288  return NULL;
289  }
290  codecs = new_codecs;
291  _TIFFmemset(codecs + i - 1, 0, sizeof(TIFFCodec));
292 
293  return codecs;
294 }
void _TIFFmemset(void *p, int v, tmsize_t c)
Definition: tif_unix.c:338
static const struct image_codec codecs[NUM_CODECS]
Definition: image.c:4235
static struct cd_image cd
Definition: cdmake.c:182
static codec_t * registeredCODECS
Definition: tif_compress.c:183
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
Definition: glfuncs.h:248
smooth NULL
Definition: ftsmooth.c:416
const GLubyte * c
Definition: glext.h:8905
void * _TIFFrealloc(void *p, tmsize_t s)
Definition: tif_unix.c:332
TIFFCodec _TIFFBuiltinCODECS[]
Definition: tif_codec.c:87
int TIFFIsCODECConfigured(uint16 scheme)
Definition: tif_codec.c:150
#define c
Definition: ke_i.h:80
char * name
Definition: tiffio.h:256
void _TIFFfree(void *p)
Definition: tif_unix.c:326
void _TIFFmemcpy(void *d, const void *s, tmsize_t c)
Definition: tif_unix.c:344

◆ TIFFGetField()

int TIFFGetField ( TIFF tif,
uint32  tag,
  ... 
)

Definition at line 1215 of file tif_dir.c.

1216 {
1217  int status;
1218  va_list ap;
1219 
1220  va_start(ap, tag);
1221  status = TIFFVGetField(tif, tag, ap);
1222  va_end(ap);
1223  return (status);
1224 }
Definition: ecma_167.h:138
#define va_end(ap)
Definition: acmsvcex.h:90
char * va_list
Definition: acmsvcex.h:78
int TIFFVGetField(TIFF *tif, uint32 tag, va_list ap)
Definition: tif_dir.c:1233
#define va_start(ap, A)
Definition: acmsvcex.h:91
void int int ULONGLONG int va_list * ap
Definition: winesup.h:32
static SERVICE_STATUS status
Definition: service.c:31
Definition: ps.c:97

Referenced by gtTileContig(), gtTileSeparate(), isCCITTCompression(), TIFFFlush(), TIFFPrintDirectory(), TIFFRGBAImageBegin(), TIFFRGBAImageOK(), and TIFFWriteDirectorySec().

◆ TIFFGetFieldDefaulted()

int TIFFGetFieldDefaulted ( TIFF tif,
uint32  tag,
  ... 
)

Definition at line 309 of file tif_aux.c.

310 {
311  int ok;
312  va_list ap;
313 
314  va_start(ap, tag);
315  ok = TIFFVGetFieldDefaulted(tif, tag, ap);
316  va_end(ap);
317  return (ok);
318 }
Definition: ecma_167.h:138
#define va_end(ap)
Definition: acmsvcex.h:90
char * va_list
Definition: acmsvcex.h:78
#define ok(value,...)
Definition: atltest.h:57
#define va_start(ap, A)
Definition: acmsvcex.h:91
void int int ULONGLONG int va_list * ap
Definition: winesup.h:32
int TIFFVGetFieldDefaulted(TIFF *tif, uint32 tag, va_list ap)
Definition: tif_aux.c:173

Referenced by gtStripContig(), gtStripSeparate(), initCIELabConversion(), initYCbCrConversion(), PickContigCase(), PickSeparateCase(), TIFFReadRGBAStripExt(), TIFFReadRGBATileExt(), TIFFRGBAImageBegin(), TIFFRGBAImageOK(), TIFFScanlineSize64(), TIFFVStripSize64(), TIFFVTileSize64(), and TIFFWriteDirectorySec().

◆ TIFFGetMapFileProc()

TIFFMapFileProc TIFFGetMapFileProc ( TIFF )

Definition at line 703 of file tif_open.c.

704 {
705  return (tif->tif_mapproc);
706 }

◆ TIFFGetMode()

int TIFFGetMode ( TIFF )

Definition at line 556 of file tif_open.c.

557 {
558  return (tif->tif_mode);
559 }

◆ TIFFGetReadProc()

TIFFReadWriteProc TIFFGetReadProc ( TIFF )

Definition at line 658 of file tif_open.c.

659 {
660  return (tif->tif_readproc);
661 }

◆ TIFFGetSeekProc()

TIFFSeekProc TIFFGetSeekProc ( TIFF )

Definition at line 676 of file tif_open.c.

677 {
678  return (tif->tif_seekproc);
679 }

◆ TIFFGetSizeProc()

TIFFSizeProc TIFFGetSizeProc ( TIFF )

Definition at line 694 of file tif_open.c.

695 {
696  return (tif->tif_sizeproc);
697 }

◆ TIFFGetTagListCount()

int TIFFGetTagListCount ( TIFF )

Definition at line 34 of file tif_extension.c.

36 {
37  TIFFDirectory* td = &tif->tif_dir;
38 
39  return td->td_customValueCount;
40 }
int td_customValueCount
Definition: tif_dir.h:119

Referenced by TIFFPrintDirectory().

◆ TIFFGetTagListEntry()

uint32 TIFFGetTagListEntry ( TIFF ,
int  tag_index 
)

Definition at line 42 of file tif_extension.c.

44 {
45  TIFFDirectory* td = &tif->tif_dir;
46 
47  if( tag_index < 0 || tag_index >= td->td_customValueCount )
48  return (uint32)(-1);
49  else
50  return td->td_customValues[tag_index].info->field_tag;
51 }
unsigned int uint32
Definition: types.h:32
TIFFTagValue * td_customValues
Definition: tif_dir.h:120
int td_customValueCount
Definition: tif_dir.h:119
const TIFFField * info
Definition: tif_dir.h:36
uint32 field_tag
Definition: tif_dir.h:279

Referenced by TIFFPrintDirectory().

◆ TIFFGetUnmapFileProc()

TIFFUnmapFileProc TIFFGetUnmapFileProc ( TIFF )

Definition at line 712 of file tif_open.c.

713 {
714  return (tif->tif_unmapproc);
715 }

◆ TIFFGetVersion()

const char* TIFFGetVersion ( void  )

Definition at line 30 of file tif_version.c.

31 {
32  return (TIFFVersion);
33 }
static const char TIFFVersion[]
Definition: tif_version.c:27

◆ TIFFGetWriteProc()

TIFFReadWriteProc TIFFGetWriteProc ( TIFF )

Definition at line 667 of file tif_open.c.

668 {
669  return (tif->tif_writeproc);
670 }

◆ TIFFIsBigEndian()

int TIFFIsBigEndian ( TIFF )

Definition at line 649 of file tif_open.c.

650 {
651  return (tif->tif_header.common.tiff_magic == TIFF_BIGENDIAN);
652 }
#define TIFF_BIGENDIAN
Definition: tiff.h:51

◆ TIFFIsByteSwapped()

int TIFFIsByteSwapped ( TIFF )

Definition at line 622 of file tif_open.c.

623 {
624  return ((tif->tif_flags & TIFF_SWAB) != 0);
625 }
#define TIFF_SWAB
Definition: tiffiop.h:113

◆ TIFFIsCODECConfigured()

int TIFFIsCODECConfigured ( uint16  scheme)

Check whether we have working codec for the specific coding scheme.

Returns
returns 1 if the codec is configured and working. Otherwise 0 will be returned.

Definition at line 150 of file tif_codec.c.

151 {
152  const TIFFCodec* codec = TIFFFindCODEC(scheme);
153 
154  if(codec == NULL) {
155  return 0;
156  }
157  if(codec->init == NULL) {
158  return 0;
159  }
160  if(codec->init != NotConfigured){
161  return 1;
162  }
163  return 0;
164 }
DWORD scheme
static int NotConfigured(TIFF *, int)
Definition: tif_codec.c:126
smooth NULL
Definition: ftsmooth.c:416
const TIFFCodec * TIFFFindCODEC(uint16 scheme)
Definition: tif_compress.c:186
TIFFInitMethod init
Definition: tiffio.h:258

Referenced by TIFFGetConfiguredCODECs().

◆ TIFFIsMSB2LSB()

int TIFFIsMSB2LSB ( TIFF )

Definition at line 640 of file tif_open.c.

641 {
642  return (isFillOrder(tif, FILLORDER_MSB2LSB));
643 }
#define isFillOrder(tif, o)
Definition: tiffiop.h:215
#define FILLORDER_MSB2LSB
Definition: tiff.h:216

◆ TIFFIsTiled()

int TIFFIsTiled ( TIFF )

Definition at line 577 of file tif_open.c.

578 {
579  return (isTiled(tif));
580 }
#define isTiled(tif)
Definition: tiffiop.h:213

Referenced by PickContigCase(), PickSeparateCase(), TIFFFlush(), TIFFReadRGBAStripExt(), and TIFFReadRGBATileExt().

◆ TIFFIsUpSampled()

int TIFFIsUpSampled ( TIFF )

Definition at line 631 of file tif_open.c.

632 {
633  return (isUpSampled(tif));
634 }
#define isUpSampled(tif)
Definition: tiffiop.h:216

◆ TIFFLastDirectory()

int TIFFLastDirectory ( TIFF )

Definition at line 1658 of file tif_dir.c.

1659 {
1660  return (tif->tif_nextdiroff == 0);
1661 }

◆ TIFFMergeFieldInfo()

int TIFFMergeFieldInfo ( TIFF ,
const  TIFFFieldInfo[],
uint32   
)

Definition at line 888 of file tif_dirinfo.c.

889 {
890  static const char module[] = "TIFFMergeFieldInfo";
891  static const char reason[] = "for fields array";
892  TIFFField *tp;
893  size_t nfields;
894  uint32 i;
895 
896  if (tif->tif_nfieldscompat > 0) {
897  tif->tif_fieldscompat = (TIFFFieldArray *)
898  _TIFFCheckRealloc(tif, tif->tif_fieldscompat,
899  tif->tif_nfieldscompat + 1,
900  sizeof(TIFFFieldArray), reason);
901  } else {
902  tif->tif_fieldscompat = (TIFFFieldArray *)
903  _TIFFCheckMalloc(tif, 1, sizeof(TIFFFieldArray),
904  reason);
905  }
906  if (!tif->tif_fieldscompat) {
907  TIFFErrorExt(tif->tif_clientdata, module,
908  "Failed to allocate fields array");
909  return -1;
910  }
911  nfields = tif->tif_nfieldscompat++;
912 
913  tif->tif_fieldscompat[nfields].type = tfiatOther;
914  tif->tif_fieldscompat[nfields].allocated_size = n;
915  tif->tif_fieldscompat[nfields].count = n;
916  tif->tif_fieldscompat[nfields].fields =
917  (TIFFField *)_TIFFCheckMalloc(tif, n, sizeof(TIFFField),
918  reason);
919  if (!tif->tif_fieldscompat[nfields].fields) {
920  TIFFErrorExt(tif->tif_clientdata, module,
921  "Failed to allocate fields array");
922  return -1;
923  }
924 
925  tp = tif->tif_fieldscompat[nfields].fields;
926  for (i = 0; i < n; i++) {
927  tp->field_tag = info[i].field_tag;
928  tp->field_readcount = info[i].field_readcount;
929  tp->field_writecount = info[i].field_writecount;
930  tp->field_type = info[i].field_type;
931  tp->reserved = 0;
932  tp->set_field_type =
933  _TIFFSetGetType(info[i].field_type,
934  info[i].field_readcount,
935  info[i].field_passcount);
936  tp->get_field_type =
937  _TIFFSetGetType(info[i].field_type,
938  info[i].field_readcount,
939  info[i].field_passcount);
940  tp->field_bit = info[i].field_bit;
941  tp->field_oktochange = info[i].field_oktochange;
942  tp->field_passcount = info[i].field_passcount;
943  tp->field_name = info[i].field_name;
944  tp->field_subfields = NULL;
945  tp++;
946  }
947 
948  if (!_TIFFMergeFields(tif, tif->tif_fieldscompat[nfields].fields, n)) {
949  TIFFErrorExt(tif->tif_clientdata, module,
950  "Setting up field info failed");
951  return -1;
952  }
953 
954  return 0;
955 }
void * _TIFFCheckRealloc(TIFF *tif, void *buffer, tmsize_t nmemb, tmsize_t elem_size, const char *what)
Definition: tif_aux.c:62
unsigned int uint32
Definition: types.h:32
static TIFFSetGetFieldType _TIFFSetGetType(TIFFDataType type, short count, unsigned char passcount)
Definition: tif_dirinfo.c:735
GLdouble n
Definition: glext.h:7729
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
Definition: glfuncs.h:248
void * _TIFFCheckMalloc(TIFF *tif, tmsize_t nmemb, tmsize_t elem_size, const char *what)
Definition: tif_aux.c:85
int _TIFFMergeFields(TIFF *tif, const TIFFField info[], uint32 n)
Definition: tif_dirinfo.c:369
smooth NULL
Definition: ftsmooth.c:416
_In_ uint64_t _In_ uint64_t _In_ uint64_t _In_opt_ traverse_ptr * tp
Definition: btrfs.c:2855
void TIFFErrorExt(thandle_t fd, const char *module, const char *fmt,...)
Definition: tif_error.c:65
static WCHAR reason[MAX_STRING_RESOURCE_LEN]
Definition: object.c:1904

◆ TIFFNumberOfDirectories()

uint16 TIFFNumberOfDirectories ( TIFF )

Definition at line 1568 of file tif_dir.c.

1569 {
1570  static const char module[] = "TIFFNumberOfDirectories";
1571  uint64 nextdir;
1572  uint16 n;
1573  if (!(tif->tif_flags&TIFF_BIGTIFF))
1574  nextdir = tif->tif_header.classic.tiff_diroff;
1575  else
1576  nextdir = tif->tif_header.big.tiff_diroff;
1577  n = 0;
1578  while (nextdir != 0 && TIFFAdvanceDirectory(tif, &nextdir, NULL))
1579  {
1580  if (n != 65535) {
1581  ++n;
1582  }
1583  else
1584  {
1585  TIFFErrorExt(tif->tif_clientdata, module,
1586  "Directory count exceeded 65535 limit,"
1587  " giving up on counting.");
1588  return (65535);
1589  }
1590  }
1591  return (n);
1592 }
unsigned long long uint64
Definition: platform.h:18
GLdouble n
Definition: glext.h:7729
#define TIFF_BIGTIFF
Definition: tiffiop.h:125
smooth NULL
Definition: ftsmooth.c:416
void TIFFErrorExt(thandle_t fd, const char *module, const char *fmt,...)
Definition: tif_error.c:65
static int TIFFAdvanceDirectory(TIFF *tif, uint64 *nextdir, uint64 *off)
Definition: tif_dir.c:1426
unsigned short uint16
Definition: types.h:30

◆ TIFFNumberOfStrips()

uint32 TIFFNumberOfStrips ( TIFF )

Definition at line 60 of file tif_strip.c.

61 {
62  TIFFDirectory *td = &tif->tif_dir;
63  uint32 nstrips;
64 
65  nstrips = (td->td_rowsperstrip == (uint32) -1 ? 1 :
68  nstrips = _TIFFMultiply32(tif, nstrips, (uint32)td->td_samplesperpixel,
69  "TIFFNumberOfStrips");
70  return (nstrips);
71 }
uint32 _TIFFMultiply32(TIFF *tif, uint32 first, uint32 second, const char *where)
Definition: tif_aux.c:36
#define TIFFhowmany_32(x, y)
Definition: tiffiop.h:248
unsigned int uint32
Definition: types.h:32
uint16 td_planarconfig
Definition: tif_dir.h:88
uint32 td_imagelength
Definition: tif_dir.h:71
#define PLANARCONFIG_SEPARATE
Definition: tiff.h:241
uint32 td_rowsperstrip
Definition: tif_dir.h:82
uint16 td_samplesperpixel
Definition: tif_dir.h:81

Referenced by TIFFReadDirectory(), and TIFFSetupStrips().

◆ TIFFNumberOfTiles()

uint32 TIFFNumberOfTiles ( TIFF )

Definition at line 114 of file tif_tile.c.

115 {
116  TIFFDirectory *td = &tif->tif_dir;
117  uint32 dx = td->td_tilewidth;
118  uint32 dy = td->td_tilelength;
119  uint32 dz = td->td_tiledepth;
120  uint32 ntiles;
121 
122  if (dx == (uint32) -1)
123  dx = td->td_imagewidth;
124  if (dy == (uint32) -1)
125  dy = td->td_imagelength;
126  if (dz == (uint32) -1)
127  dz = td->td_imagedepth;
128  ntiles = (dx == 0 || dy == 0 || dz == 0) ? 0 :
131  "TIFFNumberOfTiles"),
132  TIFFhowmany_32(td->td_imagedepth, dz), "TIFFNumberOfTiles");
134  ntiles = _TIFFMultiply32(tif, ntiles, td->td_samplesperpixel,
135  "TIFFNumberOfTiles");
136  return (ntiles);
137 }
uint32 td_tiledepth
Definition: tif_dir.h:72
uint32 _TIFFMultiply32(TIFF *tif, uint32 first, uint32 second, const char *where)
Definition: tif_aux.c:36
#define TIFFhowmany_32(x, y)
Definition: tiffiop.h:248
unsigned int uint32
Definition: types.h:32
GLint dy
Definition: linetemp.h:97
uint32 td_imagedepth
Definition: tif_dir.h:71
uint32 td_tilelength
Definition: tif_dir.h:72
uint16 td_planarconfig
Definition: tif_dir.h:88
uint32 td_imagelength
Definition: tif_dir.h:71
uint32 td_tilewidth
Definition: tif_dir.h:72
#define PLANARCONFIG_SEPARATE
Definition: tiff.h:241
GLint dx
Definition: linetemp.h:97
uint16 td_samplesperpixel
Definition: tif_dir.h:81
uint32 td_imagewidth
Definition: tif_dir.h:71

Referenced by TIFFReadDirectory(), and TIFFSetupStrips().

◆ TIFFOpen()

TIFF* TIFFOpen ( const char ,
const char  
)

Definition at line 223 of file tif_unix.c.

224 {
225  static const char module[] = "TIFFOpen";
226  int m, fd;
227  TIFF* tif;
228 
230  if (m == -1)
231  return ((TIFF*)0);
232 
233 /* for cygwin and mingw */
234 #ifdef O_BINARY
235  m |= O_BINARY;
236 #endif
237 
238  fd = open(name, m, 0666);
239  if (fd < 0) {
240  if (errno > 0 && strerror(errno) != NULL ) {
241  TIFFErrorExt(0, module, "%s: %s", name, strerror(errno) );
242  } else {
243  TIFFErrorExt(0, module, "%s: Cannot open", name);
244  }
245  return ((TIFF *)0);
246  }
247 
248  tif = TIFFFdOpen((int)fd, name, mode);
249  if(!tif)
250  close(fd);
251  return tif;
252 }
#define open
Definition: acwin.h:95
TIFF * TIFFFdOpen(int fd, const char *name, const char *mode)
Definition: tif_unix.c:203
static int fd
Definition: io.c:51
int errno
const char * strerror(int err)
Definition: compat_str.c:23
const GLfloat * m
Definition: glext.h:10848
Definition: tiffiop.h:102
smooth NULL
Definition: ftsmooth.c:416
void TIFFErrorExt(thandle_t fd, const char *module, const char *fmt,...)
Definition: tif_error.c:65
#define close
Definition: acwin.h:98
GLenum mode
Definition: glext.h:6217
int _TIFFgetMode(const char *mode, const char *module)
Definition: tif_open.c:48
#define O_BINARY
Definition: acwin.h:109
Definition: name.c:36

◆ TIFFPrintDirectory()

void TIFFPrintDirectory ( TIFF ,
FILE ,
long   
)

Definition at line 235 of file tif_print.c.

236 {
237  TIFFDirectory *td = &tif->tif_dir;
238  char *sep;
239  long l, n;
240 
241 #if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__))
242  fprintf(fd, "TIFF Directory at offset 0x%I64x (%I64u)\n",
243  (unsigned __int64) tif->tif_diroff,
244  (unsigned __int64) tif->tif_diroff);
245 #else
246  fprintf(fd, "TIFF Directory at offset 0x%llx (%llu)\n",
247  (unsigned long long) tif->tif_diroff,
248  (unsigned long long) tif->tif_diroff);
249 #endif
250  if (TIFFFieldSet(tif,FIELD_SUBFILETYPE)) {
251  fprintf(fd, " Subfile Type:");
252  sep = " ";
254  fprintf(fd, "%sreduced-resolution image", sep);
255  sep = "/";
256  }
257  if (td->td_subfiletype & FILETYPE_PAGE) {
258  fprintf(fd, "%smulti-page document", sep);
259  sep = "/";
260  }
261  if (td->td_subfiletype & FILETYPE_MASK)
262  fprintf(fd, "%stransparency mask", sep);
263  fprintf(fd, " (%lu = 0x%lx)\n",
264  (unsigned long) td->td_subfiletype, (long) td->td_subfiletype);
265  }
267  fprintf(fd, " Image Width: %lu Image Length: %lu",
268  (unsigned long) td->td_imagewidth, (unsigned long) td->td_imagelength);
270  fprintf(fd, " Image Depth: %lu",
271  (unsigned long) td->td_imagedepth);
272  fprintf(fd, "\n");
273  }
275  fprintf(fd, " Tile Width: %lu Tile Length: %lu",
276  (unsigned long) td->td_tilewidth, (unsigned long) td->td_tilelength);
277  if (TIFFFieldSet(tif,FIELD_TILEDEPTH))
278  fprintf(fd, " Tile Depth: %lu",
279  (unsigned long) td->td_tiledepth);
280  fprintf(fd, "\n");
281  }
282  if (TIFFFieldSet(tif,FIELD_RESOLUTION)) {
283  fprintf(fd, " Resolution: %g, %g",
284  td->td_xresolution, td->td_yresolution);
286  switch (td->td_resolutionunit) {
287  case RESUNIT_NONE:
288  fprintf(fd, " (unitless)");
289  break;
290  case RESUNIT_INCH:
291  fprintf(fd, " pixels/inch");
292  break;
293  case RESUNIT_CENTIMETER:
294  fprintf(fd, " pixels/cm");
295  break;
296  default:
297  fprintf(fd, " (unit %u = 0x%x)",
298  td->td_resolutionunit,
299  td->td_resolutionunit);
300  break;
301  }
302  }
303  fprintf(fd, "\n");
304  }
305  if (TIFFFieldSet(tif,FIELD_POSITION))
306  fprintf(fd, " Position: %g, %g\n",
307  td->td_xposition, td->td_yposition);
309  fprintf(fd, " Bits/Sample: %u\n", td->td_bitspersample);
310  if (TIFFFieldSet(tif,FIELD_SAMPLEFORMAT)) {
311  fprintf(fd, " Sample Format: ");
312  switch (td->td_sampleformat) {
313  case SAMPLEFORMAT_VOID:
314  fprintf(fd, "void\n");
315  break;
316  case SAMPLEFORMAT_INT:
317  fprintf(fd, "signed integer\n");
318  break;
319  case SAMPLEFORMAT_UINT:
320  fprintf(fd, "unsigned integer\n");
321  break;
322  case SAMPLEFORMAT_IEEEFP:
323  fprintf(fd, "IEEE floating point\n");
324  break;
326  fprintf(fd, "complex signed integer\n");
327  break;
329  fprintf(fd, "complex IEEE floating point\n");
330  break;
331  default:
332  fprintf(fd, "%u (0x%x)\n",
334  break;
335  }
336  }
337  if (TIFFFieldSet(tif,FIELD_COMPRESSION)) {
338  const TIFFCodec* c = TIFFFindCODEC(td->td_compression);
339  fprintf(fd, " Compression Scheme: ");
340  if (c)
341  fprintf(fd, "%s\n", c->name);
342  else
343  fprintf(fd, "%u (0x%x)\n",
344  td->td_compression, td->td_compression);
345  }
346  if (TIFFFieldSet(tif,FIELD_PHOTOMETRIC)) {
347  fprintf(fd, " Photometric Interpretation: ");
348  if (td->td_photometric < NPHOTONAMES)
349  fprintf(fd, "%s\n", photoNames[td->td_photometric]);
350  else {
351  switch (td->td_photometric) {
352  case PHOTOMETRIC_LOGL:
353  fprintf(fd, "CIE Log2(L)\n");
354  break;
355  case PHOTOMETRIC_LOGLUV:
356  fprintf(fd, "CIE Log2(L) (u',v')\n");
357  break;
358  default:
359  fprintf(fd, "%u (0x%x)\n",
360  td->td_photometric, td->td_photometric);
361  break;
362  }
363  }
364  }
366  uint16 i;
367  fprintf(fd, " Extra Samples: %u<", td->td_extrasamples);
368  sep = "";
369  for (i = 0; i < td->td_extrasamples; i++) {
370  switch (td->td_sampleinfo[i]) {
372  fprintf(fd, "%sunspecified", sep);
373  break;
375  fprintf(fd, "%sassoc-alpha", sep);
376  break;
378  fprintf(fd, "%sunassoc-alpha", sep);
379  break;
380  default:
381  fprintf(fd, "%s%u (0x%x)", sep,
382  td->td_sampleinfo[i], td->td_sampleinfo[i]);
383  break;
384  }
385  sep = ", ";
386  }
387  fprintf(fd, ">\n");
388  }
389  if (TIFFFieldSet(tif,FIELD_INKNAMES)) {
390  char* cp;
391  uint16 i;
392  fprintf(fd, " Ink Names: ");
393  i = td->td_samplesperpixel;
394  sep = "";
395  for (cp = td->td_inknames;
396  i > 0 && cp < td->td_inknames + td->td_inknameslen;
397  cp = strchr(cp,'\0')+1, i--) {
398  size_t max_chars =
399  td->td_inknameslen - (cp - td->td_inknames);
400  fputs(sep, fd);
401  _TIFFprintAsciiBounded(fd, cp, max_chars);
402  sep = ", ";
403  }
404  fputs("\n", fd);
405  }
407  fprintf(fd, " Thresholding: ");
408  switch (td->td_threshholding) {
409  case THRESHHOLD_BILEVEL:
410  fprintf(fd, "bilevel art scan\n");
411  break;
412  case THRESHHOLD_HALFTONE:
413  fprintf(fd, "halftone or dithered scan\n");
414  break;
416  fprintf(fd, "error diffused\n");
417  break;
418  default:
419  fprintf(fd, "%u (0x%x)\n",
421  break;
422  }
423  }
424  if (TIFFFieldSet(tif,FIELD_FILLORDER)) {
425  fprintf(fd, " FillOrder: ");
426  switch (td->td_fillorder) {
427  case FILLORDER_MSB2LSB:
428  fprintf(fd, "msb-to-lsb\n");
429  break;
430  case FILLORDER_LSB2MSB:
431  fprintf(fd, "lsb-to-msb\n");
432  break;
433  default:
434  fprintf(fd, "%u (0x%x)\n",
435  td->td_fillorder, td->td_fillorder);
436  break;
437  }
438  }
440  {
441  fprintf(fd, " YCbCr Subsampling: %u, %u\n",
442  td->td_ycbcrsubsampling[0], td->td_ycbcrsubsampling[1] );
443  }
445  fprintf(fd, " YCbCr Positioning: ");
446  switch (td->td_ycbcrpositioning) {
448  fprintf(fd, "centered\n");
449  break;
451  fprintf(fd, "cosited\n");
452  break;
453  default:
454  fprintf(fd, "%u (0x%x)\n",
456  break;
457  }
458  }
460  fprintf(fd, " Halftone Hints: light %u dark %u\n",
461  td->td_halftonehints[0], td->td_halftonehints[1]);
462  if (TIFFFieldSet(tif,FIELD_ORIENTATION)) {
463  fprintf(fd, " Orientation: ");
464  if (td->td_orientation < NORIENTNAMES)
465  fprintf(fd, "%s\n", orientNames[td->td_orientation]);
466  else
467  fprintf(fd, "%u (0x%x)\n",
468  td->td_orientation, td->td_orientation);
469  }
471  fprintf(fd, " Samples/Pixel: %u\n", td->td_samplesperpixel);
472  if (TIFFFieldSet(tif,FIELD_ROWSPERSTRIP)) {
473  fprintf(fd, " Rows/Strip: ");
474  if (td->td_rowsperstrip == (uint32) -1)
475  fprintf(fd, "(infinite)\n");
476  else
477  fprintf(fd, "%lu\n", (unsigned long) td->td_rowsperstrip);
478  }
480  fprintf(fd, " Min Sample Value: %u\n", td->td_minsamplevalue);
482  fprintf(fd, " Max Sample Value: %u\n", td->td_maxsamplevalue);
484  int i;
485  int count = (tif->tif_flags & TIFF_PERSAMPLE) ? td->td_samplesperpixel : 1;
486  fprintf(fd, " SMin Sample Value:");
487  for (i = 0; i < count; ++i)
488  fprintf(fd, " %g", td->td_sminsamplevalue[i]);
489  fprintf(fd, "\n");
490  }
492  int i;
493  int count = (tif->tif_flags & TIFF_PERSAMPLE) ? td->td_samplesperpixel : 1;
494  fprintf(fd, " SMax Sample Value:");
495  for (i = 0; i < count; ++i)
496  fprintf(fd, " %g", td->td_smaxsamplevalue[i]);
497  fprintf(fd, "\n");
498  }
499  if (TIFFFieldSet(tif,FIELD_PLANARCONFIG)) {
500  fprintf(fd, " Planar Configuration: ");
501  switch (td->td_planarconfig) {
502  case PLANARCONFIG_CONTIG:
503  fprintf(fd, "single image plane\n");
504  break;
506  fprintf(fd, "separate image planes\n");
507  break;
508  default:
509  fprintf(fd, "%u (0x%x)\n",
511  break;
512  }
513  }
515  fprintf(fd, " Page Number: %u-%u\n",
516  td->td_pagenumber[0], td->td_pagenumber[1]);
517  if (TIFFFieldSet(tif,FIELD_COLORMAP)) {
518  fprintf(fd, " Color Map: ");
519  if (flags & TIFFPRINT_COLORMAP) {
520  fprintf(fd, "\n");
521  n = 1L<<td->td_bitspersample;
522  for (l = 0; l < n; l++)
523  fprintf(fd, " %5ld: %5u %5u %5u\n",
524  l,
525  td->td_colormap[0][l],
526  td->td_colormap[1][l],
527  td->td_colormap[2][l]);
528  } else
529  fprintf(fd, "(present)\n");
530  }
532  int i;
533  fprintf(fd, " Reference Black/White:\n");
534  for (i = 0; i < 3; i++)
535  fprintf(fd, " %2d: %5g %5g\n", i,
536  td->td_refblackwhite[2*i+0],
537  td->td_refblackwhite[2*i+1]);
538  }
540  fprintf(fd, " Transfer Function: ");
541  if (flags & TIFFPRINT_CURVES) {
542  fprintf(fd, "\n");
543  n = 1L<<td->td_bitspersample;
544  for (l = 0; l < n; l++) {
545  uint16 i;
546  fprintf(fd, " %2ld: %5u",
547  l, td->td_transferfunction[0][l]);
548  for (i = 1; i < td->td_samplesperpixel - td->td_extrasamples && i < 3; i++)
549  fprintf(fd, " %5u",
550  td->td_transferfunction[i][l]);
551  fputc('\n', fd);
552  }
553  } else
554  fprintf(fd, "(present)\n");
555  }
556  if (TIFFFieldSet(tif, FIELD_SUBIFD) && (td->td_subifd)) {
557  uint16 i;
558  fprintf(fd, " SubIFD Offsets:");
559  for (i = 0; i < td->td_nsubifd; i++)
560 #if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__))
561  fprintf(fd, " %5I64u",
562  (unsigned __int64) td->td_subifd[i]);
563 #else
564  fprintf(fd, " %5llu",
565  (unsigned long long) td->td_subifd[i]);
566 #endif
567  fputc('\n', fd);
568  }
569 
570  /*
571  ** Custom tag support.
572  */
573  {
574  int i;
575  short count;
576 
578  for(i = 0; i < count; i++) {
580  const TIFFField *fip;
581  uint32 value_count;
582  int mem_alloc = 0;
583  void *raw_data;
584 
585  fip = TIFFFieldWithTag(tif, tag);
586  if(fip == NULL)
587  continue;
588 
589  if(fip->field_passcount) {
590  if (fip->field_readcount == TIFF_VARIABLE2 ) {
591  if(TIFFGetField(tif, tag, &value_count, &raw_data) != 1)
592  continue;
593  } else if (fip->field_readcount == TIFF_VARIABLE ) {
594  uint16 small_value_count;
595  if(TIFFGetField(tif, tag, &small_value_count, &raw_data) != 1)
596  continue;
597  value_count = small_value_count;
598  } else {
600  || fip->field_readcount == TIFF_VARIABLE2);
601  continue;
602  }
603  } else {
604  if (fip->field_readcount == TIFF_VARIABLE
605  || fip->field_readcount == TIFF_VARIABLE2)
606  value_count = 1;
607  else if (fip->field_readcount == TIFF_SPP)
608  value_count = td->td_samplesperpixel;
609  else
610  value_count = fip->field_readcount;
611  if (fip->field_tag == TIFFTAG_DOTRANGE
612  && strcmp(fip->field_name,"DotRange") == 0) {
613  /* TODO: This is an evil exception and should not have been
614  handled this way ... likely best if we move it into
615  the directory structure with an explicit field in
616  libtiff 4.1 and assign it a FIELD_ value */
617  static uint16 dotrange[2];
618  raw_data = dotrange;
619  TIFFGetField(tif, tag, dotrange+0, dotrange+1);
620  } else if (fip->field_type == TIFF_ASCII
621  || fip->field_readcount == TIFF_VARIABLE
623  || fip->field_readcount == TIFF_SPP
624  || value_count > 1) {
625  if(TIFFGetField(tif, tag, &raw_data) != 1)
626  continue;
627  } else {
628  raw_data = _TIFFmalloc(
630  * value_count);
631  mem_alloc = 1;
632  if(TIFFGetField(tif, tag, raw_data) != 1) {
633  _TIFFfree(raw_data);
634  continue;
635  }
636  }
637  }
638 
639  /*
640  * Catch the tags which needs to be specially handled
641  * and pretty print them. If tag not handled in
642  * _TIFFPrettyPrintField() fall down and print it as
643  * any other tag.
644  */
645  if (!_TIFFPrettyPrintField(tif, fip, fd, tag, value_count, raw_data))
646  _TIFFPrintField(fd, fip, value_count, raw_data);
647 
648  if(mem_alloc)
649  _TIFFfree(raw_data);
650  }
651  }
652 
653  if (tif->tif_tagmethods.printdir)
654  (*tif->tif_tagmethods.printdir)(tif, fd, flags);
655 
656  _TIFFFillStriles( tif );
657 
658  if ((flags & TIFFPRINT_STRIPS) &&
660  uint32 s;
661 
662  fprintf(fd, " %lu %s:\n",
663  (unsigned long) td->td_nstrips,
664  isTiled(tif) ? "Tiles" : "Strips");
665  for (s = 0; s < td->td_nstrips; s++)
666 #if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__))
667  fprintf(fd, " %3lu: [%8I64u, %8I64u]\n",
668  (unsigned long) s,
669  td->td_stripoffset ? (unsigned __int64) td->td_stripoffset[s] : 0,
670  td->td_stripbytecount ? (unsigned __int64) td->td_stripbytecount[s] : 0);
671 #else
672  fprintf(fd, " %3lu: [%8llu, %8llu]\n",
673  (unsigned long) s,
674  td->td_stripoffset ? (unsigned long long) td->td_stripoffset[s] : 0,
675  td->td_stripbytecount ? (unsigned long long) td->td_stripbytecount[s] : 0);
676 #endif
677  }
678 }
#define TIFF_VARIABLE
Definition: tiffio.h:313
uint16 td_ycbcrpositioning
Definition: tif_dir.h:111
_Check_return_opt_ _CRTIMP int __cdecl fputc(_In_ int _Ch, _Inout_ FILE *_File)
float td_yposition
Definition: tif_dir.h:89
uint16 td_bitspersample
Definition: tif_dir.h:74
uint32 td_tiledepth
Definition: tif_dir.h:72
#define FIELD_MINSAMPLEVALUE
Definition: tif_dir.h:152
#define FIELD_RESOLUTION
Definition: tif_dir.h:139
#define THRESHHOLD_ERRORDIFFUSE
Definition: tiff.h:212
char * td_inknames
Definition: tif_dir.h:117
int td_inknameslen
Definition: tif_dir.h:116
#define FIELD_STRIPOFFSETS
Definition: tif_dir.h:158
#define THRESHHOLD_BILEVEL
Definition: tiff.h:210
#define TIFFPRINT_CURVES
Definition: tiffio.h:120
#define FIELD_IMAGEDIMENSIONS
Definition: tif_dir.h:137
GLuint GLuint GLsizei count
Definition: gl.h:1545
unsigned int uint32
Definition: types.h:32
#define FIELD_THRESHHOLDING
Definition: tif_dir.h:147
#define YCBCRPOSITION_COSITED
Definition: tiff.h:370
#define PHOTOMETRIC_LOGL
Definition: tiff.h:207
uint16 td_halftonehints[2]
Definition: tif_dir.h:92
#define FILLORDER_LSB2MSB
Definition: tiff.h:217
GLdouble n
Definition: glext.h:7729
#define assert(x)
Definition: debug.h:53
Definition: ecma_167.h:138
#define FIELD_HALFTONEHINTS
Definition: tif_dir.h:166
#define PHOTOMETRIC_LOGLUV
Definition: tiff.h:208
#define TIFFTAG_DOTRANGE
Definition: tiff.h:302
static int fd
Definition: io.c:51
uint32 td_imagedepth
Definition: tif_dir.h:71
#define TIFFPRINT_COLORMAP
Definition: tiffio.h:121
#define FIELD_RESOLUTIONUNIT
Definition: tif_dir.h:155
#define FIELD_YCBCRSUBSAMPLING
Definition: tif_dir.h:167
#define SAMPLEFORMAT_INT
Definition: tiff.h:310
#define FIELD_SMAXSAMPLEVALUE
Definition: tif_dir.h:163
float td_xresolution
Definition: tif_dir.h:86
#define RESUNIT_INCH
Definition: tiff.h:264
uint32 td_tilelength
Definition: tif_dir.h:72
#define FIELD_SUBIFD
Definition: tif_dir.h:172
#define FIELD_TRANSFERFUNCTION
Definition: tif_dir.h:170
#define FIELD_FILLORDER
Definition: tif_dir.h:148
#define FIELD_MAXSAMPLEVALUE
Definition: tif_dir.h:153
int TIFFGetField(TIFF *tif, uint32 tag,...)
Definition: tif_dir.c:1215
unsigned short(__cdecl typeof(TIFFCurrentDirectory))(struct tiff *)
Definition: typeof.h:93
uint32 TIFFGetTagListEntry(TIFF *tif, int tag_index)
Definition: tif_extension.c:42
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
Definition: glfuncs.h:248
float td_xposition
Definition: tif_dir.h:89
#define FIELD_BITSPERSAMPLE
Definition: tif_dir.h:144
#define mem_alloc(bsize)
Definition: types.h:123
char * field_name
Definition: tif_dir.h:289
uint32 td_subfiletype
Definition: tif_dir.h:73
uint16 * td_sampleinfo
Definition: tif_dir.h:94
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
#define NPHOTONAMES
Definition: tif_print.c:52
uint16 td_nsubifd
Definition: tif_dir.h:107
#define YCBCRPOSITION_CENTERED
Definition: tiff.h:369
uint16 td_resolutionunit
Definition: tif_dir.h:87
smooth NULL
Definition: ftsmooth.c:416
#define FIELD_PLANARCONFIG
Definition: tif_dir.h:154
static const char *const photoNames[]
Definition: tif_print.c:39
uint16 td_planarconfig
Definition: tif_dir.h:88
#define SAMPLEFORMAT_VOID
Definition: tiff.h:312
uint16 * td_colormap[3]
Definition: tif_dir.h:91
double * td_sminsamplevalue
Definition: tif_dir.h:84
uint16 td_orientation
Definition: tif_dir.h:80
uint16 td_minsamplevalue
Definition: tif_dir.h:83
void * _TIFFmalloc(tmsize_t s)
Definition: tif_unix.c:309
unsigned char field_passcount
Definition: tif_dir.h:288
r l[0]
Definition: byte_order.h:167
uint32 td_nstrips
Definition: tif_dir.h:99
#define SAMPLEFORMAT_COMPLEXIEEEFP
Definition: tiff.h:314
#define SAMPLEFORMAT_UINT
Definition: tiff.h:309
#define TIFF_PERSAMPLE
Definition: tiffiop.h:128
#define RESUNIT_CENTIMETER
Definition: tiff.h:265
uint16 td_extrasamples
Definition: tif_dir.h:93
uint32 td_imagelength
Definition: tif_dir.h:71
uint32 field_tag
Definition: tif_dir.h:279
#define SAMPLEFORMAT_IEEEFP
Definition: tiff.h:311
uint16 td_photometric
Definition: tif_dir.h:77
const GLubyte * c
Definition: glext.h:8905
#define FIELD_PHOTOMETRIC
Definition: tif_dir.h:146
#define NORIENTNAMES
Definition: tif_print.c:65
double * td_smaxsamplevalue
Definition: tif_dir.h:85
#define EXTRASAMPLE_UNASSALPHA
Definition: tiff.h:307
#define TIFFFieldSet(tif, field)
Definition: tif_dir.h:192
GLbitfield flags
Definition: glext.h:7161
uint16 td_fillorder
Definition: tif_dir.h:79
#define FIELD_COMPRESSION
Definition: tif_dir.h:145
uint64 * td_stripoffset
Definition: tif_dir.h:100
#define FIELD_SMINSAMPLEVALUE
Definition: tif_dir.h:162
#define FIELD_ROWSPERSTRIP
Definition: tif_dir.h:151
static void _TIFFPrintField(FILE *fd, const TIFFField *fip, uint32 value_count, void *raw_data)
Definition: tif_print.c:68
static int _TIFFPrettyPrintField(TIFF *tif, const TIFFField *fip, FILE *fd, uint32 tag, uint32 value_count, void *raw_data)
Definition: tif_print.c:142
static const WCHAR L[]
Definition: oid.c:1250
#define FIELD_INKNAMES
Definition: tif_dir.h:171
const TIFFCodec * TIFFFindCODEC(uint16 scheme)
Definition: tif_compress.c:186
uint32 td_tilewidth
Definition: tif_dir.h:72
#define FIELD_ORIENTATION
Definition: tif_dir.h:149
uint16 td_sampleformat
Definition: tif_dir.h:75
uint16 td_threshholding
Definition: tif_dir.h:78
#define PLANARCONFIG_SEPARATE
Definition: tiff.h:241
uint64 * td_stripbytecount
Definition: tif_dir.h:101
#define FILETYPE_REDUCEDIMAGE
Definition: tiff.h:147
GLdouble s
Definition: gl.h:2039
static const char *const orientNames[]
Definition: tif_print.c:54
uint16 td_pagenumber[2]
Definition: tif_dir.h:90
const TIFFField * TIFFFieldWithTag(TIFF *tif, uint32 tag)
Definition: tif_dirinfo.c:558
#define FIELD_IMAGEDEPTH
Definition: tif_dir.h:164
#define isTiled(tif)
Definition: tiffiop.h:213
#define FILETYPE_PAGE
Definition: tiff.h:148
#define FIELD_YCBCRPOSITIONING
Definition: tif_dir.h:168
int _TIFFDataSize(TIFFDataType type)
Definition: tif_dirinfo.c:476
#define FIELD_EXTRASAMPLES
Definition: tif_dir.h:160
#define TIFF_VARIABLE2
Definition: tiffio.h:315
uint16 td_maxsamplevalue
Definition: tif_dir.h:83
uint32 td_rowsperstrip
Definition: tif_dir.h:82
uint64 * td_subifd
Definition: tif_dir.h:108
TIFFDataType field_type
Definition: tif_dir.h:282
#define TIFF_SPP
Definition: tiffio.h:314
uint16 td_ycbcrsubsampling[2]
Definition: tif_dir.h:110
int TIFFGetTagListCount(TIFF *tif)
Definition: tif_extension.c:34
unsigned short uint16
Definition: types.h:30
#define FIELD_POSITION
Definition: tif_dir.h:140
#define EXTRASAMPLE_UNSPECIFIED
Definition: tiff.h:305
#define FIELD_PAGENUMBER
Definition: tif_dir.h:156
#define FIELD_TILEDEPTH
Definition: tif_dir.h:165
#define FIELD_TILEDIMENSIONS
Definition: tif_dir.h:138
float * td_refblackwhite
Definition: tif_dir.h:114
uint16 * td_transferfunction[3]
Definition: tif_dir.h:113
#define SAMPLEFORMAT_COMPLEXINT
Definition: tiff.h:313
#define FILETYPE_MASK
Definition: tiff.h:149
char * strchr(const char *String, int ch)
Definition: utclib.c:501
#define FIELD_COLORMAP
Definition: tif_dir.h:159
POINT cp
Definition: magnifier.c:59
#define FIELD_SAMPLESPERPIXEL
Definition: tif_dir.h:150
float td_yresolution
Definition: tif_dir.h:86
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
#define RESUNIT_NONE
Definition: tiff.h:263
uint16 td_samplesperpixel
Definition: tif_dir.h:81
#define FIELD_REFBLACKWHITE
Definition: tif_dir.h:169
uint16 td_compression
Definition: tif_dir.h:76
void _TIFFfree(void *p)
Definition: tif_unix.c:326
#define TIFFPRINT_STRIPS
Definition: tiffio.h:119
#define EXTRASAMPLE_ASSOCALPHA
Definition: tiff.h:306
#define FIELD_SAMPLEFORMAT
Definition: tif_dir.h:161
uint32 td_imagewidth
Definition: tif_dir.h:71
static void _TIFFprintAsciiBounded(FILE *fd, const char *cp, size_t max_chars)
Definition: tif_print.c:687
#define THRESHHOLD_HALFTONE
Definition: tiff.h:211
_Check_return_opt_ _CRTIMP int __cdecl fputs(_In_z_ const char *_Str, _Inout_ FILE *_File)
#define FILLORDER_MSB2LSB
Definition: tiff.h:216
#define __int64
Definition: basetyps.h:16
#define PLANARCONFIG_CONTIG
Definition: tiff.h:240
int _TIFFFillStriles(TIFF *tif)
Definition: tif_dirread.c:5812
#define FIELD_SUBFILETYPE
Definition: tif_dir.h:143
short field_readcount
Definition: tif_dir.h:280

◆ TIFFRasterScanlineSize()

tmsize_t TIFFRasterScanlineSize ( TIFF tif)

Definition at line 366 of file tif_strip.c.

367 {
368  static const char module[] = "TIFFRasterScanlineSize";
369  uint64 m;
370  tmsize_t n;
372  n=(tmsize_t)m;
373  if ((uint64)n!=m)
374  {
375  TIFFErrorExt(tif->tif_clientdata,module,"Integer arithmetic overflow");
376  n=0;
377  }
378  return(n);
379 }
unsigned long long uint64
Definition: platform.h:18
uint64 TIFFRasterScanlineSize64(TIFF *tif)
Definition: tif_strip.c:351
GLdouble n
Definition: glext.h:7729
thandle_t tif_clientdata
Definition: tiffiop.h:191
const GLfloat * m
Definition: glext.h:10848
TIFF_SSIZE_T tmsize_t
Definition: tiffio.h:65
void TIFFErrorExt(thandle_t fd, const char *module, const char *fmt,...)
Definition: tif_error.c:65

◆ TIFFRasterScanlineSize64()

uint64 TIFFRasterScanlineSize64 ( TIFF tif)

Definition at line 351 of file tif_strip.c.

352 {
353  static const char module[] = "TIFFRasterScanlineSize64";
354  TIFFDirectory *td = &tif->tif_dir;
355  uint64 scanline;
356 
357  scanline = _TIFFMultiply64(tif, td->td_bitspersample, td->td_imagewidth, module);
359  scanline = _TIFFMultiply64(tif, scanline, td->td_samplesperpixel, module);
360  return (TIFFhowmany8_64(scanline));
361  } else
362  return (_TIFFMultiply64(tif, TIFFhowmany8_64(scanline),
363  td->td_samplesperpixel, module));
364 }
unsigned long long uint64
Definition: platform.h:18
uint16 td_bitspersample
Definition: tif_dir.h:74
#define TIFFhowmany8_64(x)
Definition: tiffiop.h:258
uint16 td_planarconfig
Definition: tif_dir.h:88
TIFFDirectory tif_dir
Definition: tiffiop.h:135
uint64 _TIFFMultiply64(TIFF *tif, uint64 first, uint64 second, const char *where)
Definition: tif_aux.c:49
uint16 td_samplesperpixel
Definition: tif_dir.h:81
uint32 td_imagewidth
Definition: tif_dir.h:71
#define PLANARCONFIG_CONTIG
Definition: tiff.h:240

Referenced by TIFFRasterScanlineSize().

◆ TIFFRawStripSize()

tmsize_t TIFFRawStripSize ( TIFF tif,
uint32  strip 
)

Definition at line 173 of file tif_strip.c.

174 {
175  static const char module[] = "TIFFRawStripSize";
176  uint64 m;
177  tmsize_t n;
178  m=TIFFRawStripSize64(tif,strip);
179  if (m==(uint64)(-1))
180  n=(tmsize_t)(-1);
181  else
182  {
183  n=(tmsize_t)m;
184  if ((uint64)n!=m)
185  {
186  TIFFErrorExt(tif->tif_clientdata,module,"Integer overflow");
187  n=0;
188  }
189  }
190  return(n);
191 }
unsigned long long uint64
Definition: platform.h:18
uint64 TIFFRawStripSize64(TIFF *tif, uint32 strip)
Definition: tif_strip.c:148
GLdouble n
Definition: glext.h:7729
thandle_t tif_clientdata
Definition: tiffiop.h:191
const GLfloat * m
Definition: glext.h:10848
TIFF_SSIZE_T tmsize_t
Definition: tiffio.h:65
void TIFFErrorExt(thandle_t fd, const char *module, const char *fmt,...)
Definition: tif_error.c:65

◆ TIFFRawStripSize64()

uint64 TIFFRawStripSize64 ( TIFF tif,
uint32  strip 
)

Definition at line 148 of file tif_strip.c.

149 {
150  static const char module[] = "TIFFRawStripSize64";
151  TIFFDirectory* td = &tif->tif_dir;
152  uint64 bytecount = td->td_stripbytecount[strip];
153 
154  if (bytecount == 0)
155  {
156 #if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__))
158  "%I64u: Invalid strip byte count, strip %lu",
159  (unsigned __int64) bytecount,
160  (unsigned long) strip);
161 #else
163  "%llu: Invalid strip byte count, strip %lu",
164  (unsigned long long) bytecount,
165  (unsigned long) strip);
166 #endif
167  bytecount = (uint64) -1;
168  }
169 
170  return bytecount;
171 }
unsigned long long uint64
Definition: platform.h:18
thandle_t tif_clientdata
Definition: tiffiop.h:191
void TIFFErrorExt(thandle_t fd, const char *module, const char *fmt,...)
Definition: tif_error.c:65
uint64 * td_stripbytecount
Definition: tif_dir.h:101
TIFFDirectory tif_dir
Definition: tiffiop.h:135
#define __int64
Definition: basetyps.h:16

Referenced by TIFFRawStripSize().

◆ TIFFReadBufferSetup()

int TIFFReadBufferSetup ( TIFF tif,
void bp,
tmsize_t  size 
)

Definition at line 1389 of file tif_read.c.

1390 {
1391  static const char module[] = "TIFFReadBufferSetup";
1392 
1393  assert((tif->tif_flags&TIFF_NOREADRAW)==0);
1394  tif->tif_flags &= ~TIFF_BUFFERMMAP;
1395 
1396  if (tif->tif_rawdata) {
1397  if (tif->tif_flags & TIFF_MYBUFFER)
1398  _TIFFfree(tif->tif_rawdata);
1399  tif->tif_rawdata = NULL;
1400  tif->tif_rawdatasize = 0;
1401  }
1402  if (bp) {
1403  tif->tif_rawdatasize = size;
1404  tif->tif_rawdata = (uint8*) bp;
1405  tif->tif_flags &= ~TIFF_MYBUFFER;
1406  } else {
1408  if (tif->tif_rawdatasize==0) {
1410  "Invalid buffer size");
1411  return (0);
1412  }
1413  /* Initialize to zero to avoid uninitialized buffers in case of */
1414  /* short reads (http://bugzilla.maptools.org/show_bug.cgi?id=2651) */
1415  tif->tif_rawdata = (uint8*) _TIFFcalloc(1, tif->tif_rawdatasize);
1416  tif->tif_flags |= TIFF_MYBUFFER;
1417  }
1418  if (tif->tif_rawdata == NULL) {
1420  "No space for data buffer at scanline %lu",
1421  (unsigned long) tif->tif_row);
1422  tif->tif_rawdatasize = 0;
1423  return (0);
1424  }
1425  return (1);
1426 }
unsigned long long uint64
Definition: platform.h:18
#define TIFF_NOREADRAW
Definition: tiffiop.h:123
#define assert(x)
Definition: debug.h:53
uint8 * tif_rawdata
Definition: tiffiop.h:179
thandle_t tif_clientdata
Definition: tiffiop.h:191
TIFF_SSIZE_T tmsize_t
Definition: tiffio.h:65
uint32 tif_flags
Definition: tiffiop.h:106
smooth NULL
Definition: ftsmooth.c:416
#define TIFF_BUFFERMMAP
Definition: tiffiop.h:129
GLsizeiptr size
Definition: glext.h:5919
unsigned char uint8
Definition: types.h:28
void TIFFErrorExt(thandle_t fd, const char *module, const char *fmt,...)
Definition: tif_error.c:65
tmsize_t tif_rawdatasize
Definition: tiffiop.h:180
void * _TIFFcalloc(tmsize_t nmemb, tmsize_t siz)
Definition: tif_unix.c:317
uint32 tif_row
Definition: tiffiop.h:143
#define TIFFroundup_64(x, y)
Definition: tiffiop.h:259
void _TIFFfree(void *p)
Definition: tif_unix.c:326
#define TIFF_MYBUFFER
Definition: tiffiop.h:115

Referenced by TIFFFillStrip(), and TIFFFillTile().

◆ TIFFReadCustomDirectory()

int TIFFReadCustomDirectory ( TIFF tif,
toff_t  diroff,
const TIFFFieldArray infoarray 
)

Definition at line 4363 of file tif_dirread.c.

4365 {
4366  static const char module[] = "TIFFReadCustomDirectory";
4367  TIFFDirEntry* dir;
4368  uint16 dircount;
4369  TIFFDirEntry* dp;
4370  uint16 di;
4371  const TIFFField* fip;
4372  uint32 fii;
4373  _TIFFSetupFields(tif, infoarray);
4374  dircount=TIFFFetchDirectory(tif,diroff,&dir,NULL);
4375  if (!dircount)
4376  {