ReactOS  0.4.15-dev-509-g96a357b
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 *)
 
int TIFFDeferStrileArrayWriting (TIFF *)
 
int TIFFForceStrileArrayWriting (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)
 
int TIFFReadFromUserBuffer (TIFF *tif, uint32 strile, void *inbuf, tmsize_t insize, void *outbuf, tmsize_t outsize)
 
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)
 
uint64 TIFFGetStrileOffset (TIFF *tif, uint32 strile)
 
uint64 TIFFGetStrileByteCount (TIFF *tif, uint32 strile)
 
uint64 TIFFGetStrileOffsetWithErr (TIFF *tif, uint32 strile, int *pbErr)
 
uint64 TIFFGetStrileByteCountWithErr (TIFF *tif, uint32 strile, int *pbErr)
 
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 265 of file tiffio.h.

◆ CIELABTORGB_TABLE_RANGE

#define CIELABTORGB_TABLE_RANGE   1500

Definition at line 165 of file tiffio.h.

◆ D50_X0

#define D50_X0   (96.4250F)

Definition at line 130 of file tiffio.h.

◆ D50_Y0

#define D50_Y0   (100.0F)

Definition at line 131 of file tiffio.h.

◆ D50_Z0

#define D50_Z0   (82.4680F)

Definition at line 132 of file tiffio.h.

◆ D65_X0

#define D65_X0   (95.0470F)

Definition at line 126 of file tiffio.h.

◆ D65_Y0

#define D65_Y0   (100.0F)

Definition at line 127 of file tiffio.h.

◆ D65_Z0

#define D65_Z0   (108.8827F)

Definition at line 128 of file tiffio.h.

◆ FIELD_CUSTOM

#define FIELD_CUSTOM   65

Definition at line 312 of file tiffio.h.

◆ LOGLUV_PUBLIC

#define LOGLUV_PUBLIC   1

Definition at line 261 of file tiffio.h.

◆ TIFF_ANY

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

Definition at line 307 of file tiffio.h.

◆ TIFF_SPP

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

Definition at line 309 of file tiffio.h.

◆ TIFF_VARIABLE

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

Definition at line 308 of file tiffio.h.

◆ TIFF_VARIABLE2

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

Definition at line 310 of file tiffio.h.

◆ TIFFGetA

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

Definition at line 240 of file tiffio.h.

◆ TIFFGetB

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

Definition at line 239 of file tiffio.h.

◆ TIFFGetG

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

Definition at line 238 of file tiffio.h.

◆ TIFFGetR

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

Definition at line 237 of file tiffio.h.

◆ TIFFPRINT_COLORMAP

#define TIFFPRINT_COLORMAP   0x4 /* colormap */

Definition at line 116 of file tiffio.h.

◆ TIFFPRINT_CURVES

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

Definition at line 115 of file tiffio.h.

◆ TIFFPRINT_JPEGACTABLES

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

Definition at line 118 of file tiffio.h.

◆ TIFFPRINT_JPEGDCTABLES

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

Definition at line 119 of file tiffio.h.

◆ TIFFPRINT_JPEGQTABLES

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

Definition at line 117 of file tiffio.h.

◆ TIFFPRINT_NONE

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

Definition at line 113 of file tiffio.h.

◆ TIFFPRINT_STRIPS

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

Definition at line 114 of file tiffio.h.

◆ U_NEU

#define U_NEU   0.210526316

Definition at line 502 of file tiffio.h.

◆ UVSCALE

#define UVSCALE   410.

Definition at line 504 of file tiffio.h.

◆ V_NEU

#define V_NEU   0.473684211

Definition at line 503 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 104 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 275 of file tiffio.h.

◆ TIFFErrorHandler

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

Definition at line 271 of file tiffio.h.

◆ TIFFErrorHandlerExt

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

Definition at line 272 of file tiffio.h.

◆ TIFFExtendProc

typedef void(* TIFFExtendProc) (TIFF *)

Definition at line 279 of file tiffio.h.

◆ TIFFField

Definition at line 314 of file tiffio.h.

◆ TIFFFieldArray

Definition at line 315 of file tiffio.h.

◆ TIFFInitMethod

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

Definition at line 249 of file tiffio.h.

◆ TIFFMapFileProc

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

Definition at line 277 of file tiffio.h.

◆ TIFFPrintMethod

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

Definition at line 330 of file tiffio.h.

◆ TIFFReadWriteProc

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

Definition at line 273 of file tiffio.h.

◆ TIFFRGBAImage

Definition at line 177 of file tiffio.h.

◆ TIFFRGBValue

Definition at line 136 of file tiffio.h.

◆ TIFFSeekProc

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

Definition at line 274 of file tiffio.h.

◆ TIFFSizeProc

typedef toff_t(* TIFFSizeProc) (thandle_t)

Definition at line 276 of file tiffio.h.

◆ TIFFUnmapFileProc

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

Definition at line 278 of file tiffio.h.

◆ TIFFVGetMethod

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

Definition at line 329 of file tiffio.h.

◆ TIFFVSetMethod

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

Definition at line 328 of file tiffio.h.

◆ tileContigRoutine

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

Definition at line 189 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 192 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(), _TIFFFetchStrileValue(), _TIFFFillStrilesInternal(), _TIFFRewriteField(), _TIFFSetupFields(), _TIFFVSetField(), allocChoppedUpStripArrays(), EstimateStripByteCounts(), fpAcc(), fpDiff(), gtStripContig(), gtStripSeparate(), gtTileContig(), gtTileSeparate(), initCIELabConversion(), PredictorEncodeTile(), setByteArray(), setDoubleArrayOneValue(), setExtraSamples(), setupMap(), TIFFCleanup(), TIFFClientOpen(), 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(), _TIFFFetchStrileValue(), _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 237 of file tif_dirwrite.c.

238 {
239  int rc;
240  /* Setup the strips arrays, if they haven't already been. */
241  if (tif->tif_dir.td_stripoffset_p == NULL)
242  (void) TIFFSetupStrips(tif);
244  (void) TIFFSetWriteOffset(tif, TIFFSeekFile(tif, 0, SEEK_END));
245  return rc;
246 }
#define TRUE
Definition: types.h:120
static int TIFFWriteDirectorySec(TIFF *tif, int isimage, int imagedone, uint64 *pdiroff)
Definition: tif_dirwrite.c:407
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:523
#define TIFFSeekFile(tif, off, whence)
Definition: tiffiop.h:237
smooth NULL
Definition: ftsmooth.c:416
void TIFFSetWriteOffset(TIFF *tif, toff_t off)
Definition: tif_write.c:834
#define SEEK_END
Definition: cabinet.c:27

◆ TIFFCheckTile()

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

Definition at line 73 of file tif_tile.c.

74 {
75  TIFFDirectory *td = &tif->tif_dir;
76 
77  if (x >= td->td_imagewidth) {
79  "%lu: Col out of range, max %lu",
80  (unsigned long) x,
81  (unsigned long) (td->td_imagewidth - 1));
82  return (0);
83  }
84  if (y >= td->td_imagelength) {
86  "%lu: Row out of range, max %lu",
87  (unsigned long) y,
88  (unsigned long) (td->td_imagelength - 1));
89  return (0);
90  }
91  if (z >= td->td_imagedepth) {
93  "%lu: Depth out of range, max %lu",
94  (unsigned long) z,
95  (unsigned long) (td->td_imagedepth - 1));
96  return (0);
97  }
99  s >= td->td_samplesperpixel) {
101  "%lu: Sample out of range, max %lu",
102  (unsigned long) s,
103  (unsigned long) (td->td_samplesperpixel - 1));
104  return (0);
105  }
106  return (1);
107 }
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
uint32 td_imagedepth
Definition: tif_dir.h:72
thandle_t tif_clientdata
Definition: tiffiop.h:207
char * tif_name
Definition: tiffiop.h:116
GLdouble GLdouble z
Definition: glext.h:5874
uint16 td_planarconfig
Definition: tif_dir.h:89
uint32 td_imagelength
Definition: tif_dir.h:72
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:151
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
uint16 td_samplesperpixel
Definition: tif_dir.h:82
uint32 td_imagewidth
Definition: tif_dir.h:72

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:165
GLenum GLint * range
Definition: glext.h:7539
static float(__cdecl *square_half_float)(float x
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
static float(__cdecl *square_half_float)(float x
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:312
uint8 * tif_base
Definition: tiffiop.h:202
unsigned int uint32
Definition: types.h:32
uint64 toff_t
Definition: tiffio.h:66
TIFFClientInfoLink * tif_clientinfo
Definition: tiffiop.h:220
uint8 * tif_rawdata
Definition: tiffiop.h:195
#define TIFFUnmapFileContents(tif, addr, size)
Definition: tiffiop.h:245
unsigned short field_bit
Definition: tif_dir.h:290
char * name
Definition: tiffiop.h:96
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:293
int tif_mode
Definition: tiffiop.h:118
uint32 tif_flags
Definition: tiffiop.h:119
size_t tif_nfields
Definition: tiffiop.h:217
TIFFFieldArray * tif_fieldscompat
Definition: tiffiop.h:223
#define isMapped(tif)
Definition: tiffiop.h:230
uint32 allocated_size
Definition: tif_dir.h:277
void TIFFFreeDirectory(TIFF *tif)
Definition: tif_dir.c:1268
TIFFField * fields
Definition: tif_dir.h:279
struct client_info * next
Definition: tiffiop.h:94
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
Definition: utclib.c:534
uint64 * tif_dirlist
Definition: tiffiop.h:148
tmsize_t tif_size
Definition: tiffiop.h:203
TIFFVoidMethod tif_cleanup
Definition: tiffiop.h:188
TIFFField ** tif_fields
Definition: tiffiop.h:216
int TIFFFlush(TIFF *tif)
Definition: tif_flush.c:32
size_t tif_nfieldscompat
Definition: tiffiop.h:224
void _TIFFfree(void *p)
Definition: tif_unix.c:326
#define TIFF_MYBUFFER
Definition: tiffiop.h:128
#define O_RDONLY
Definition: acwin.h:108

Referenced by TIFFClientOpen(), and TIFFClose().

◆ TIFFClientdata()

thandle_t TIFFClientdata ( TIFF )

Definition at line 553 of file tif_open.c.

554 {
555  return (tif->tif_clientdata);
556 }

◆ TIFFClientOpen()

Definition at line 71 of file tif_open.c.

82 {
83  static const char module[] = "TIFFClientOpen";
84  TIFF *tif;
85  int m;
86  const char* cp;
87 
88  /* The following are configuration checks. They should be redundant, but should not
89  * compile to any actual code in an optimised release build anyway. If any of them
90  * fail, (makefile-based or other) configuration is not correct */
91  assert(sizeof(uint8)==1);
92  assert(sizeof(int8)==1);
93  assert(sizeof(uint16)==2);
94  assert(sizeof(int16)==2);
95  assert(sizeof(uint32)==4);
96  assert(sizeof(int32)==4);
97  assert(sizeof(uint64)==8);
98  assert(sizeof(int64)==8);
99  assert(sizeof(tmsize_t)==sizeof(void*));
100  {
101  union{
102  uint8 a8[2];
103  uint16 a16;
104  } n;
105  n.a8[0]=1;
106  n.a8[1]=0;
107  #ifdef WORDS_BIGENDIAN
108  assert(n.a16==256);
109  #else
110  assert(n.a16==1);
111  #endif
112  }
113 
115  if (m == -1)
116  goto bad2;
117  tif = (TIFF *)_TIFFmalloc((tmsize_t)(sizeof (TIFF) + strlen(name) + 1));
118  if (tif == NULL) {
119  TIFFErrorExt(clientdata, module, "%s: Out of memory (TIFF structure)", name);
120  goto bad2;
121  }
122  _TIFFmemset(tif, 0, sizeof (*tif));
123  tif->tif_name = (char *)tif + sizeof (TIFF);
124  strcpy(tif->tif_name, name);
125  tif->tif_mode = m &~ (O_CREAT|O_TRUNC);
126  tif->tif_curdir = (uint16) -1; /* non-existent directory */
127  tif->tif_curoff = 0;
128  tif->tif_curstrip = (uint32) -1; /* invalid strip */
129  tif->tif_row = (uint32) -1; /* read/write pre-increment */
130  tif->tif_clientdata = clientdata;
131  if (!readproc || !writeproc || !seekproc || !closeproc || !sizeproc) {
132  TIFFErrorExt(clientdata, module,
133  "One of the client procedures is NULL pointer.");
134  _TIFFfree(tif);
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  * 'D' enable use of deferred strip/tile offset/bytecount array loading.
186  * 'O' on-demand loading of values instead of whole array loading (implies D)
187  *
188  * The use of the 'l' and 'b' flags is strongly discouraged.
189  * These flags are provided solely because numerous vendors,
190  * typically on the PC, do not correctly support TIFF; they
191  * only support the Intel little-endian byte order. This
192  * support is not configured by default because it supports
193  * the violation of the TIFF spec that says that readers *MUST*
194  * support both byte orders. It is strongly recommended that
195  * you not use this feature except to deal with busted apps
196  * that write invalid TIFF. And even in those cases you should
197  * bang on the vendors to fix their software.
198  *
199  * The 'L', 'B', and 'H' flags are intended for applications
200  * that can optimize operations on data by using a particular
201  * bit order. By default the library returns data in MSB2LSB
202  * bit order for compatibility with older versions of this
203  * library. Returning data in the bit order of the native CPU
204  * makes the most sense but also requires applications to check
205  * the value of the FillOrder tag; something they probably do
206  * not do right now.
207  *
208  * The 'M' and 'm' flags are provided because some virtual memory
209  * systems exhibit poor behaviour when large images are mapped.
210  * These options permit clients to control the use of memory-mapped
211  * files on a per-file basis.
212  *
213  * The 'C' and 'c' flags are provided because the library support
214  * for chopping up large strips into multiple smaller strips is not
215  * application-transparent and as such can cause problems. The 'c'
216  * option permits applications that only want to look at the tags,
217  * for example, to get the unadulterated TIFF tag information.
218  */
219  for (cp = mode; *cp; cp++)
220  switch (*cp) {
221  case 'b':
222  #ifndef WORDS_BIGENDIAN
223  if (m&O_CREAT)
224  tif->tif_flags |= TIFF_SWAB;
225  #endif
226  break;
227  case 'l':
228  #ifdef WORDS_BIGENDIAN
229  if ((m&O_CREAT))
230  tif->tif_flags |= TIFF_SWAB;
231  #endif
232  break;
233  case 'B':
234  tif->tif_flags = (tif->tif_flags &~ TIFF_FILLORDER) |
236  break;
237  case 'L':
238  tif->tif_flags = (tif->tif_flags &~ TIFF_FILLORDER) |
240  break;
241  case 'H':
242  tif->tif_flags = (tif->tif_flags &~ TIFF_FILLORDER) |
244  break;
245  case 'M':
246  if (m == O_RDONLY)
247  tif->tif_flags |= TIFF_MAPPED;
248  break;
249  case 'm':
250  if (m == O_RDONLY)
251  tif->tif_flags &= ~TIFF_MAPPED;
252  break;
253  case 'C':
254  if (m == O_RDONLY)
255  tif->tif_flags |= TIFF_STRIPCHOP;
256  break;
257  case 'c':
258  if (m == O_RDONLY)
259  tif->tif_flags &= ~TIFF_STRIPCHOP;
260  break;
261  case 'h':
262  tif->tif_flags |= TIFF_HEADERONLY;
263  break;
264  case '8':
265  if (m&O_CREAT)
266  tif->tif_flags |= TIFF_BIGTIFF;
267  break;
268  case 'D':
270  break;
271  case 'O':
272  if( m == O_RDONLY )
274  break;
275  }
276 
277 #ifdef DEFER_STRILE_LOAD
278  /* Compatibility with old DEFER_STRILE_LOAD compilation flag */
279  /* Probably unneeded, since to the best of my knowledge (E. Rouault) */
280  /* GDAL was the only user of this, and will now use the new 'D' flag */
282 #endif
283 
284  /*
285  * Read in TIFF header.
286  */
287  if ((m & O_TRUNC) ||
288  !ReadOK(tif, &tif->tif_header, sizeof (TIFFHeaderClassic))) {
289  if (tif->tif_mode == O_RDONLY) {
291  "Cannot read TIFF header");
292  goto bad;
293  }
294  /*
295  * Setup header and write.
296  */
297  #ifdef WORDS_BIGENDIAN
300  #else
303  #endif
304  if (!(tif->tif_flags&TIFF_BIGTIFF))
305  {
307  tif->tif_header.classic.tiff_diroff = 0;
308  if (tif->tif_flags & TIFF_SWAB)
310  tif->tif_header_size = sizeof(TIFFHeaderClassic);
311  }
312  else
313  {
315  tif->tif_header.big.tiff_offsetsize = 8;
316  tif->tif_header.big.tiff_unused = 0;
317  tif->tif_header.big.tiff_diroff = 0;
318  if (tif->tif_flags & TIFF_SWAB)
319  {
322  }
323  tif->tif_header_size = sizeof (TIFFHeaderBig);
324  }
325  /*
326  * The doc for "fopen" for some STD_C_LIBs says that if you
327  * open a file for modify ("+"), then you must fseek (or
328  * fflush?) between any freads and fwrites. This is not
329  * necessary on most systems, but has been shown to be needed
330  * on Solaris.
331  */
332  TIFFSeekFile( tif, 0, SEEK_SET );
333  if (!WriteOK(tif, &tif->tif_header, (tmsize_t)(tif->tif_header_size))) {
335  "Error writing TIFF header");
336  goto bad;
337  }
338  /*
339  * Setup the byte order handling.
340  */
342  #ifndef WORDS_BIGENDIAN
343  tif->tif_flags |= TIFF_SWAB;
344  #endif
345  } else {
346  #ifdef WORDS_BIGENDIAN
347  tif->tif_flags |= TIFF_SWAB;
348  #endif
349  }
350  /*
351  * Setup default directory.
352  */
353  if (!TIFFDefaultDirectory(tif))
354  goto bad;
355  tif->tif_diroff = 0;
356  tif->tif_dirlist = NULL;
357  tif->tif_dirlistsize = 0;
358  tif->tif_dirnumber = 0;
359  return (tif);
360  }
361  /*
362  * Setup the byte order handling.
363  */
366  #if MDI_SUPPORT
367  &&
368  #if HOST_BIGENDIAN
370  #else
372  #endif
373  ) {
375  "Not a TIFF or MDI file, bad magic number %d (0x%x)",
376  #else
377  ) {
379  "Not a TIFF file, bad magic number %d (0x%x)",
380  #endif
383  goto bad;
384  }
386  #ifndef WORDS_BIGENDIAN
387  tif->tif_flags |= TIFF_SWAB;
388  #endif
389  } else {
390  #ifdef WORDS_BIGENDIAN
391  tif->tif_flags |= TIFF_SWAB;
392  #endif
393  }
394  if (tif->tif_flags & TIFF_SWAB)
399  "Not a TIFF file, bad version number %d (0x%x)",
402  goto bad;
403  }
405  {
406  if (tif->tif_flags & TIFF_SWAB)
408  tif->tif_header_size = sizeof(TIFFHeaderClassic);
409  }
410  else
411  {
412  if (!ReadOK(tif, ((uint8*)(&tif->tif_header) + sizeof(TIFFHeaderClassic)), (sizeof(TIFFHeaderBig)-sizeof(TIFFHeaderClassic))))
413  {
415  "Cannot read TIFF header");
416  goto bad;
417  }
418  if (tif->tif_flags & TIFF_SWAB)
419  {
422  }
423  if (tif->tif_header.big.tiff_offsetsize != 8)
424  {
426  "Not a TIFF file, bad BigTIFF offsetsize %d (0x%x)",
429  goto bad;
430  }
431  if (tif->tif_header.big.tiff_unused != 0)
432  {
434  "Not a TIFF file, bad BigTIFF unused %d (0x%x)",
436  tif->tif_header.big.tiff_unused);
437  goto bad;
438  }
439  tif->tif_header_size = sizeof(TIFFHeaderBig);
440  tif->tif_flags |= TIFF_BIGTIFF;
441  }
442  tif->tif_flags |= TIFF_MYBUFFER;
443  tif->tif_rawcp = tif->tif_rawdata = 0;
444  tif->tif_rawdatasize = 0;
445  tif->tif_rawdataoff = 0;
446  tif->tif_rawdataloaded = 0;
447 
448  switch (mode[0]) {
449  case 'r':
450  if (!(tif->tif_flags&TIFF_BIGTIFF))
452  else
454  /*
455  * Try to use a memory-mapped file if the client
456  * has not explicitly suppressed usage with the
457  * 'm' flag in the open mode (see above).
458  */
459  if (tif->tif_flags & TIFF_MAPPED)
460  {
461  toff_t n;
462  if (TIFFMapFileContents(tif,(void**)(&tif->tif_base),&n))
463  {
464  tif->tif_size=(tmsize_t)n;
465  assert((toff_t)tif->tif_size==n);
466  }
467  else
468  tif->tif_flags &= ~TIFF_MAPPED;
469  }
470  /*
471  * Sometimes we do not want to read the first directory (for example,
472  * it may be broken) and want to proceed to other directories. I this
473  * case we use the TIFF_HEADERONLY flag to open file and return
474  * immediately after reading TIFF header.
475  */
476  if (tif->tif_flags & TIFF_HEADERONLY)
477  return (tif);
478 
479  /*
480  * Setup initial directory.
481  */
482  if (TIFFReadDirectory(tif)) {
483  tif->tif_rawcc = (tmsize_t)-1;
484  tif->tif_flags |= TIFF_BUFFERSETUP;
485  return (tif);
486  }
487  break;
488  case 'a':
489  /*
490  * New directories are automatically append
491  * to the end of the directory chain when they
492  * are written out (see TIFFWriteDirectory).
493  */
494  if (!TIFFDefaultDirectory(tif))
495  goto bad;
496  return (tif);
497  }
498 bad:
499  tif->tif_mode = O_RDONLY; /* XXX avoid flush */
500  TIFFCleanup(tif);
501 bad2:
502  return ((TIFF*)0);
503 }
unsigned long long uint64
Definition: platform.h:18
static int _tiffDummyMapProc(thandle_t fd, void **pbase, toff_t *psize)
Definition: tif_open.c:34
TIFFSeekProc tif_seekproc
Definition: tiffiop.h:210
uint8 * tif_rawcp
Definition: tiffiop.h:199
void _TIFFmemset(void *p, int v, tmsize_t c)
Definition: tif_unix.c:338
uint16 tif_header_size
Definition: tiffiop.h:158
int TIFFReadDirectory(TIFF *tif)
Definition: tif_dirread.c:3574
uint8 * tif_base
Definition: tiffiop.h:202
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define TIFF_STRIPCHOP
Definition: tiffiop.h:134
TIFFUnmapFileProc tif_unmapproc
Definition: tiffiop.h:205
#define WriteOK(tif, buf, size)
Definition: tiffiop.h:259
unsigned int uint32
Definition: types.h:32
#define TIFFSeekFile(tif, off, whence)
Definition: tiffiop.h:237
uint64 toff_t
Definition: tiffio.h:66
uint32 tif_curstrip
Definition: tiffiop.h:161
#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:195
uint64 tif_curoff
Definition: tiffiop.h:162
thandle_t tif_clientdata
Definition: tiffiop.h:207
tmsize_t tif_rawdataoff
Definition: tiffiop.h:197
#define STRIPCHOP_DEFAULT
Definition: tiffconf.h:124
long long int64
Definition: platform.h:13
union tiff::@3384 tif_header
tmsize_t tif_rawcc
Definition: tiffiop.h:200
uint16 tif_curdir
Definition: tiffiop.h:160
char * tif_name
Definition: tiffiop.h:116
const GLfloat * m
Definition: glext.h:10848
Definition: tiffiop.h:115
void TIFFCleanup(TIFF *tif)
Definition: tif_close.c:46
#define TIFF_HEADERONLY
Definition: tiffiop.h:135
TIFFHeaderCommon common
Definition: tiffiop.h:154
#define TIFF_BIGTIFF
Definition: tiffiop.h:138
#define TIFF_SWAB
Definition: tiffiop.h:126
static BOOL readproc(HANDLE proc, LPVOID address, PVOID target, DWORD size)
Definition: env.c:189
TIFF_SSIZE_T tmsize_t
Definition: tiffio.h:65
#define TIFF_LAZYSTRILELOAD
Definition: tiffiop.h:144
int tif_mode
Definition: tiffiop.h:118
uint32 tif_flags
Definition: tiffiop.h:119
smooth NULL
Definition: ftsmooth.c:416
uint64 tif_nextdiroff
Definition: tiffiop.h:147
void * _TIFFmalloc(tmsize_t s)
Definition: tif_unix.c:309
#define TIFFMapFileContents(tif, paddr, psize)
Definition: tiffiop.h:243
TIFFMapFileProc tif_mapproc
Definition: tiffiop.h:204
#define MDI_BIGENDIAN
Definition: tiff.h:54
#define SEEK_SET
Definition: jmemansi.c:26
#define TIFF_FILLORDER
Definition: tiffiop.h:120
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:41
tmsize_t tif_rawdatasize
Definition: tiffiop.h:196
tmsize_t tif_rawdataloaded
Definition: tiffiop.h:198
#define HOST_BIGENDIAN
Definition: tiffconf.h:86
uint64 * tif_dirlist
Definition: tiffiop.h:148
uint16 tif_dirnumber
Definition: tiffiop.h:150
uint64 tif_diroff
Definition: tiffiop.h:146
TIFFReadWriteProc tif_readproc
Definition: tiffiop.h:208
tmsize_t tif_size
Definition: tiffiop.h:203
#define TIFF_DEFERSTRILELOAD
Definition: tiffiop.h:143
#define O_TRUNC
Definition: acwin.h:112
TIFFSizeProc tif_sizeproc
Definition: tiffiop.h:212
void _TIFFSetDefaultCompressionState(TIFF *tif)
Definition: tif_compress.c:135
GLenum mode
Definition: glext.h:6217
#define MDI_SUPPORT
Definition: tiffconf.h:139
TIFFCloseProc tif_closeproc
Definition: tiffiop.h:211
#define TIFF_BUFFERSETUP
Definition: tiffiop.h:123
TIFFReadWriteProc tif_writeproc
Definition: tiffiop.h:209
TIFFHeaderBig big
Definition: tiffiop.h:156
#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:130
uint32 tif_row
Definition: tiffiop.h:159
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:47
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:1372
POINT cp
Definition: magnifier.c:59
Definition: name.c:38
long int32
Definition: platform.h:12
#define ReadOK(tif, buf, size)
Definition: tiffiop.h:252
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:155
#define MDI_LITTLEENDIAN
Definition: tiff.h:53
void _TIFFfree(void *p)
Definition: tif_unix.c:326
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:149
#define FILLORDER_MSB2LSB
Definition: tiff.h:216
#define TIFF_MYBUFFER
Definition: tiffiop.h:128
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:275
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:207
void TIFFCleanup(TIFF *tif)
Definition: tif_close.c:46
TIFFCloseProc tif_closeproc
Definition: tiffiop.h:211

◆ TIFFComputeStrip()

uint32 TIFFComputeStrip ( TIFF ,
uint32  ,
uint16   
)

Definition at line 36 of file tif_strip.c.

37 {
38  static const char module[] = "TIFFComputeStrip";
39  TIFFDirectory *td = &tif->tif_dir;
40  uint32 strip;
41 
42  strip = row / td->td_rowsperstrip;
44  if (sample >= td->td_samplesperpixel) {
45  TIFFErrorExt(tif->tif_clientdata, module,
46  "%lu: Sample out of range, max %lu",
47  (unsigned long) sample, (unsigned long) td->td_samplesperpixel);
48  return (0);
49  }
50  strip += (uint32)sample*td->td_stripsperimage;
51  }
52  return (strip);
53 }
unsigned int uint32
Definition: types.h:32
uint32 td_stripsperimage
Definition: tif_dir.h:99
uint16 td_planarconfig
Definition: tif_dir.h:89
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:83
uint16 td_samplesperpixel
Definition: tif_dir.h:82
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 36 of file tif_tile.c.

37 {
38  TIFFDirectory *td = &tif->tif_dir;
39  uint32 dx = td->td_tilewidth;
40  uint32 dy = td->td_tilelength;
41  uint32 dz = td->td_tiledepth;
42  uint32 tile = 1;
43 
44  if (td->td_imagedepth == 1)
45  z = 0;
46  if (dx == (uint32) -1)
47  dx = td->td_imagewidth;
48  if (dy == (uint32) -1)
49  dy = td->td_imagelength;
50  if (dz == (uint32) -1)
51  dz = td->td_imagedepth;
52  if (dx != 0 && dy != 0 && dz != 0) {
55  uint32 zpt = TIFFhowmany_32(td->td_imagedepth, dz);
56 
58  tile = (xpt*ypt*zpt)*s +
59  (xpt*ypt)*(z/dz) +
60  xpt*(y/dy) +
61  x/dx;
62  else
63  tile = (xpt*ypt)*(z/dz) + xpt*(y/dy) + x/dx;
64  }
65  return (tile);
66 }
uint32 td_tiledepth
Definition: tif_dir.h:73
#define TIFFhowmany_32(x, y)
Definition: tiffiop.h:264
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:72
uint32 td_tilelength
Definition: tif_dir.h:73
GLdouble GLdouble z
Definition: glext.h:5874
uint16 td_planarconfig
Definition: tif_dir.h:89
uint32 td_imagelength
Definition: tif_dir.h:72
uint32 td_tilewidth
Definition: tif_dir.h:73
#define PLANARCONFIG_SEPARATE
Definition: tiff.h:241
GLdouble s
Definition: gl.h:2039
TIFFDirectory tif_dir
Definition: tiffiop.h:151
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLint dx
Definition: linetemp.h:97
uint32 td_imagewidth
Definition: tif_dir.h:72

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

◆ TIFFCreateCustomDirectory()

int TIFFCreateCustomDirectory ( TIFF ,
const TIFFFieldArray  
)

Definition at line 1340 of file tif_dir.c.

1341 {
1342  TIFFDefaultDirectory(tif);
1343 
1344  /*
1345  * Reset the field definitions to match the application provided list.
1346  * Hopefully TIFFDefaultDirectory() won't have done anything irreversable
1347  * based on it's assumption this is an image directory.
1348  */
1349  _TIFFSetupFields(tif, infoarray);
1350 
1351  tif->tif_diroff = 0;
1352  tif->tif_nextdiroff = 0;
1353  tif->tif_curoff = 0;
1354  tif->tif_row = (uint32) -1;
1355  tif->tif_curstrip = (uint32) -1;
1356 
1357  return 0;
1358 }
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:1372

Referenced by TIFFCreateEXIFDirectory().

◆ TIFFCreateDirectory()

int TIFFCreateDirectory ( TIFF )

Definition at line 1327 of file tif_dir.c.

1328 {
1329  TIFFDefaultDirectory(tif);
1330  tif->tif_diroff = 0;
1331  tif->tif_nextdiroff = 0;
1332  tif->tif_curoff = 0;
1333  tif->tif_row = (uint32) -1;
1334  tif->tif_curstrip = (uint32) -1;
1335 
1336  return 0;
1337 }
unsigned int uint32
Definition: types.h:32
int TIFFDefaultDirectory(TIFF *tif)
Definition: tif_dir.c:1372

Referenced by TIFFWriteDirectorySec().

◆ TIFFCreateEXIFDirectory()

int TIFFCreateEXIFDirectory ( TIFF )

Definition at line 1361 of file tif_dir.c.

1362 {
1366 }
int TIFFCreateCustomDirectory(TIFF *tif, const TIFFFieldArray *infoarray)
Definition: tif_dir.c:1340
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 612 of file tif_open.c.

613 {
614  return (tif->tif_curdir);
615 }

◆ TIFFCurrentDirOffset()

uint64 TIFFCurrentDirOffset ( TIFF )

Definition at line 1666 of file tif_dir.c.

1667 {
1668  return (tif->tif_diroff);
1669 }

◆ TIFFCurrentRow()

uint32 TIFFCurrentRow ( TIFF )

Definition at line 603 of file tif_open.c.

604 {
605  return (tif->tif_row);
606 }

◆ TIFFCurrentStrip()

uint32 TIFFCurrentStrip ( TIFF )

Definition at line 621 of file tif_open.c.

622 {
623  return (tif->tif_curstrip);
624 }

◆ TIFFCurrentTile()

uint32 TIFFCurrentTile ( TIFF tif)

Definition at line 630 of file tif_open.c.

631 {
632  return (tif->tif_curtile);
633 }
uint32 tif_curtile
Definition: tiffiop.h:169

◆ 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 217 of file tif_strip.c.

218 {
219  return (*tif->tif_defstripsize)(tif, request);
220 }
Definition: tftpd.h:85
TIFFStripMethod tif_defstripsize
Definition: tiffiop.h:189

◆ TIFFDefaultTileSize()

void TIFFDefaultTileSize ( TIFF ,
uint32 ,
uint32  
)

Definition at line 272 of file tif_tile.c.

273 {
274  (*tif->tif_deftilesize)(tif, tw, th);
275 }

◆ TIFFDeferStrileArrayWriting()

int TIFFDeferStrileArrayWriting ( TIFF )

Definition at line 210 of file tif_dirwrite.c.

211 {
212  static const char module[] = "TIFFDeferStrileArrayWriting";
213  if (tif->tif_mode == O_RDONLY)
214  {
215  TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
216  "File opened in read-only mode");
217  return 0;
218  }
219  if( tif->tif_diroff != 0 )
220  {
221  TIFFErrorExt(tif->tif_clientdata, module,
222  "Directory has already been written");
223  return 0;
224  }
225 
226  tif->tif_dir.td_deferstrilearraywriting = TRUE;
227  return 1;
228 }
#define TRUE
Definition: types.h:120
void TIFFErrorExt(thandle_t fd, const char *module, const char *fmt,...)
Definition: tif_error.c:65
#define O_RDONLY
Definition: acwin.h:108

◆ 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:115
int tif_fd
Definition: tiffiop.h:117
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:71
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:38

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:307
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:307
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 533 of file tif_open.c.

534 {
535  return (tif->tif_fd);
536 }

◆ 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:251

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:307
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:41
#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  {
50  return 1;
51  }
52 
54  && !TIFFRewriteDirectory(tif))
55  return (0);
56 
57  return (1);
58 }
int TIFFRewriteDirectory(TIFF *tif)
Definition: tif_dirwrite.c:261
int TIFFForceStrileArrayWriting(TIFF *tif)
Definition: tif_flush.c:79
#define TIFF_DIRTYDIRECT
Definition: tiffiop.h:122
int TIFFFlushData(TIFF *tif)
Definition: tif_flush.c:156
int tif_mode
Definition: tiffiop.h:118
uint32 tif_flags
Definition: tiffiop.h:119
#define TIFF_DIRTYSTRIP
Definition: tiffiop.h:140
#define O_RDWR
Definition: fcntl.h:36
#define O_RDONLY
Definition: acwin.h:108

Referenced by TIFFCleanup().

◆ TIFFFlushData()

int TIFFFlushData ( TIFF tif)

Definition at line 156 of file tif_flush.c.

157 {
158  if ((tif->tif_flags & TIFF_BEENWRITING) == 0)
159  return (1);
160  if (tif->tif_flags & TIFF_POSTENCODE) {
161  tif->tif_flags &= ~TIFF_POSTENCODE;
162  if (!(*tif->tif_postencode)(tif))
163  return (0);
164  }
165  return (TIFFFlushData1(tif));
166 }
#define TIFF_BEENWRITING
Definition: tiffiop.h:125
uint32 tif_flags
Definition: tiffiop.h:119
#define TIFF_POSTENCODE
Definition: tiffiop.h:131
TIFFBoolMethod tif_postencode
Definition: tiffiop.h:179
int TIFFFlushData1(TIFF *tif)
Definition: tif_write.c:803

Referenced by TIFFFlush(), and TIFFWriteScanline().

◆ TIFFForceStrileArrayWriting()

int TIFFForceStrileArrayWriting ( TIFF )

Definition at line 79 of file tif_flush.c.

80 {
81  static const char module[] = "TIFFForceStrileArrayWriting";
82  const int isTiled = TIFFIsTiled(tif);
83 
84  if (tif->tif_mode == O_RDONLY)
85  {
86  TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
87  "File opened in read-only mode");
88  return 0;
89  }
90  if( tif->tif_diroff == 0 )
91  {
92  TIFFErrorExt(tif->tif_clientdata, module,
93  "Directory has not yet been written");
94  return 0;
95  }
96  if( (tif->tif_flags & TIFF_DIRTYDIRECT) != 0 )
97  {
98  TIFFErrorExt(tif->tif_clientdata, module,
99  "Directory has changes other than the strile arrays. "
100  "TIFFRewriteDirectory() should be called instead");
101  return 0;
102  }
103 
104  if( !(tif->tif_flags & TIFF_DIRTYSTRIP) )
105  {
106  if( !(tif->tif_dir.td_stripoffset_entry.tdir_tag != 0 &&
107  tif->tif_dir.td_stripoffset_entry.tdir_count == 0 &&
108  tif->tif_dir.td_stripoffset_entry.tdir_type == 0 &&
109  tif->tif_dir.td_stripoffset_entry.tdir_offset.toff_long8 == 0 &&
110  tif->tif_dir.td_stripbytecount_entry.tdir_tag != 0 &&
111  tif->tif_dir.td_stripbytecount_entry.tdir_count == 0 &&
112  tif->tif_dir.td_stripbytecount_entry.tdir_type == 0 &&
113  tif->tif_dir.td_stripbytecount_entry.tdir_offset.toff_long8 == 0) )
114  {
115  TIFFErrorExt(tif->tif_clientdata, module,
116  "Function not called together with "
117  "TIFFDeferStrileArrayWriting()");
118  return 0;
119  }
120 
121  if (tif->tif_dir.td_stripoffset_p == NULL && !TIFFSetupStrips(tif))
122  return 0;
123  }
124 
125  if( _TIFFRewriteField( tif,
128  TIFF_LONG8,
129  tif->tif_dir.td_nstrips,
130  tif->tif_dir.td_stripoffset_p )
131  && _TIFFRewriteField( tif,
134  TIFF_LONG8,
135  tif->tif_dir.td_nstrips,
136  tif->tif_dir.td_stripbytecount_p ) )
137  {
138  tif->tif_flags &= ~TIFF_DIRTYSTRIP;
139  tif->tif_flags &= ~TIFF_BEENWRITING;
140  return 1;
141  }
142 
143  return 0;
144 }
#define TIFF_BEENWRITING
Definition: tiffiop.h:125
int TIFFSetupStrips(TIFF *tif)
Definition: tif_write.c:523
#define TIFFTAG_STRIPBYTECOUNTS
Definition: tiff.h:234
#define TIFFTAG_STRIPOFFSETS
Definition: tiff.h:222
#define TIFF_DIRTYDIRECT
Definition: tiffiop.h:122
#define TIFFTAG_TILEBYTECOUNTS
Definition: tiff.h:289
smooth NULL
Definition: ftsmooth.c:416
#define TIFFTAG_TILEOFFSETS
Definition: tiff.h:288
void TIFFErrorExt(thandle_t fd, const char *module, const char *fmt,...)
Definition: tif_error.c:65
#define TIFF_DIRTYSTRIP
Definition: tiffiop.h:140
#define isTiled(tif)
Definition: tiffiop.h:229
int _TIFFRewriteField(TIFF *tif, uint16 tag, TIFFDataType in_datatype, tmsize_t count, void *data)
int TIFFIsTiled(TIFF *tif)
Definition: tif_open.c:594
#define O_RDONLY
Definition: acwin.h:108

Referenced by TIFFFlush(), and TIFFWriteCheck().

◆ TIFFFreeDirectory()

void TIFFFreeDirectory ( TIFF )

Definition at line 1268 of file tif_dir.c.

1269 {
1270  TIFFDirectory *td = &tif->tif_dir;
1271  int i;
1272 
1274  CleanupField(td_sminsamplevalue);
1275  CleanupField(td_smaxsamplevalue);
1276  CleanupField(td_colormap[0]);
1277  CleanupField(td_colormap[1]);
1278  CleanupField(td_colormap[2]);
1279  CleanupField(td_sampleinfo);
1280  CleanupField(td_subifd);
1281  CleanupField(td_inknames);
1282  CleanupField(td_refblackwhite);
1283  CleanupField(td_transferfunction[0]);
1284  CleanupField(td_transferfunction[1]);
1285  CleanupField(td_transferfunction[2]);
1286  CleanupField(td_stripoffset_p);
1287  CleanupField(td_stripbytecount_p);
1291 
1292  /* Cleanup custom tag values */
1293  for( i = 0; i < td->td_customValueCount; i++ ) {
1294  if (td->td_customValues[i].value)
1296  }
1297 
1298  td->td_customValueCount = 0;
1299  CleanupField(td_customValues);
1300 
1301  _TIFFmemset( &(td->td_stripoffset_entry), 0, sizeof(TIFFDirEntry));
1302  _TIFFmemset( &(td->td_stripbytecount_entry), 0, sizeof(TIFFDirEntry));
1303 }
void _TIFFmemset(void *p, int v, tmsize_t c)
Definition: tif_unix.c:338
#define TIFFClrFieldBit(tif, field)
Definition: tif_dir.h:198
TIFFTagValue * td_customValues
Definition: tif_dir.h:122
int td_customValueCount
Definition: tif_dir.h:121
#define FIELD_YCBCRSUBSAMPLING
Definition: tif_dir.h:171
#define FIELD_SETLONGS
Definition: tif_dir.h:68
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
TIFFDirEntry td_stripbytecount_entry
Definition: tif_dir.h:108
#define CleanupField(member)
Definition: tif_dir.c:1257
#define FIELD_YCBCRPOSITIONING
Definition: tif_dir.h:172
void * value
Definition: tif_dir.h:38
TIFFDirEntry td_stripoffset_entry
Definition: tif_dir.h:107
unsigned long td_fieldsset[FIELD_SETLONGS]
Definition: tif_dir.h:70
uint32 td_stripoffsetbyteallocsize
Definition: tif_dir.h:103
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:95
char * name
Definition: tiffiop.h:96
smooth NULL
Definition: ftsmooth.c:416
struct client_info * next
Definition: tiffiop.h:94
Definition: name.c:38
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469

◆ TIFFGetCloseProc()

TIFFCloseProc TIFFGetCloseProc ( TIFF )

Definition at line 702 of file tif_open.c.

703 {
704  return (tif->tif_closeproc);
705 }

◆ 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:251
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 1232 of file tif_dir.c.

1233 {
1234  int status;
1235  va_list ap;
1236 
1237  va_start(ap, tag);
1238  status = TIFFVGetField(tif, tag, ap);
1239  va_end(ap);
1240  return (status);
1241 }
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:1250
#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(), TIFFPrintDirectory(), TIFFRGBAImageBegin(), TIFFRGBAImageOK(), and TIFFWriteDirectorySec().

◆ TIFFGetFieldDefaulted()

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

Definition at line 345 of file tif_aux.c.

346 {
347  int ok;
348  va_list ap;
349 
350  va_start(ap, tag);
351  ok = TIFFVGetFieldDefaulted(tif, tag, ap);
352  va_end(ap);
353  return (ok);
354 }
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:209

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

◆ TIFFGetMapFileProc()

TIFFMapFileProc TIFFGetMapFileProc ( TIFF )

Definition at line 720 of file tif_open.c.

721 {
722  return (tif->tif_mapproc);
723 }

◆ TIFFGetMode()

int TIFFGetMode ( TIFF )

Definition at line 573 of file tif_open.c.

574 {
575  return (tif->tif_mode);
576 }

◆ TIFFGetReadProc()

TIFFReadWriteProc TIFFGetReadProc ( TIFF )

Definition at line 675 of file tif_open.c.

676 {
677  return (tif->tif_readproc);
678 }

◆ TIFFGetSeekProc()

TIFFSeekProc TIFFGetSeekProc ( TIFF )

Definition at line 693 of file tif_open.c.

694 {
695  return (tif->tif_seekproc);
696 }

◆ TIFFGetSizeProc()

TIFFSizeProc TIFFGetSizeProc ( TIFF )

Definition at line 711 of file tif_open.c.

712 {
713  return (tif->tif_sizeproc);
714 }

◆ TIFFGetStrileByteCount()

uint64 TIFFGetStrileByteCount ( TIFF tif,
uint32  strile 
)

◆ TIFFGetStrileByteCountWithErr()

uint64 TIFFGetStrileByteCountWithErr ( TIFF tif,
uint32  strile,
int pbErr 
)

Definition at line 6311 of file tif_dirread.c.

6312 {
6313  TIFFDirectory *td = &tif->tif_dir;
6314  return _TIFFGetStrileOffsetOrByteCountValue(tif, strile,
6315  &(td->td_stripbytecount_entry),
6316  &(td->td_stripbytecount_p), pbErr);
6317 }
uint64 * td_stripbytecount_p
Definition: tif_dir.h:102
static uint64 _TIFFGetStrileOffsetOrByteCountValue(TIFF *tif, uint32 strile, TIFFDirEntry *dirent, uint64 **parray, int *pbErr)
Definition: tif_dirread.c:6246
TIFFDirEntry td_stripbytecount_entry
Definition: tif_dir.h:108
TIFFDirectory tif_dir
Definition: tiffiop.h:151

Referenced by TIFFGetStrileByteCount().

◆ TIFFGetStrileOffset()

uint64 TIFFGetStrileOffset ( TIFF tif,
uint32  strile 
)

Definition at line 6290 of file tif_dirread.c.

6291 {
6292  return TIFFGetStrileOffsetWithErr(tif, strile, NULL);
6293 }
smooth NULL
Definition: ftsmooth.c:416
uint64 TIFFGetStrileOffsetWithErr(TIFF *tif, uint32 strile, int *pbErr)
Definition: tif_dirread.c:6296

Referenced by allocChoppedUpStripArrays(), ByteCountLooksBad(), TIFFFillStrip(), TIFFFillStripPartial(), TIFFFillTile(), TIFFPrintDirectory(), TIFFReadDirectory(), TIFFReadRawStrip1(), TIFFReadRawStripOrTile2(), TIFFReadRawTile1(), and TryChopUpUncompressedBigTiff().

◆ TIFFGetStrileOffsetWithErr()

uint64 TIFFGetStrileOffsetWithErr ( TIFF tif,
uint32  strile,
int pbErr 
)

Definition at line 6296 of file tif_dirread.c.

6297 {
6298  TIFFDirectory *td = &tif->tif_dir;
6299  return _TIFFGetStrileOffsetOrByteCountValue(tif, strile,
6300  &(td->td_stripoffset_entry),
6301  &(td->td_stripoffset_p), pbErr);
6302 }
static uint64 _TIFFGetStrileOffsetOrByteCountValue(TIFF *tif, uint32 strile, TIFFDirEntry *dirent, uint64 **parray, int *pbErr)
Definition: tif_dirread.c:6246
TIFFDirectory tif_dir
Definition: tiffiop.h:151
TIFFDirEntry td_stripoffset_entry
Definition: tif_dir.h:107
uint64 * td_stripoffset_p
Definition: tif_dir.h:101

Referenced by TIFFGetStrileOffset().

◆ 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:121

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:122
int td_customValueCount
Definition: tif_dir.h:121
const TIFFField * info
Definition: tif_dir.h:36
uint32 field_tag
Definition: tif_dir.h:283

Referenced by TIFFPrintDirectory().

◆ TIFFGetUnmapFileProc()

TIFFUnmapFileProc TIFFGetUnmapFileProc ( TIFF )

Definition at line 729 of file tif_open.c.

730 {
731  return (tif->tif_unmapproc);
732 }

◆ TIFFGetVersion()

const char* TIFFGetVersion ( void  )

Definition at line 29 of file tif_version.c.

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

◆ TIFFGetWriteProc()

TIFFReadWriteProc TIFFGetWriteProc ( TIFF )

Definition at line 684 of file tif_open.c.

685 {
686  return (tif->tif_writeproc);
687 }

◆ TIFFIsBigEndian()

int TIFFIsBigEndian ( TIFF )

Definition at line 666 of file tif_open.c.

667 {
668  return (tif->tif_header.common.tiff_magic == TIFF_BIGENDIAN);
669 }
#define TIFF_BIGENDIAN
Definition: tiff.h:51

◆ TIFFIsByteSwapped()

int TIFFIsByteSwapped ( TIFF )

Definition at line 639 of file tif_open.c.

640 {
641  return ((tif->tif_flags & TIFF_SWAB) != 0);
642 }
#define TIFF_SWAB
Definition: tiffiop.h:126

◆ 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:253

Referenced by TIFFGetConfiguredCODECs().

◆ TIFFIsMSB2LSB()

int TIFFIsMSB2LSB ( TIFF )

Definition at line 657 of file tif_open.c.

658 {
659  return (isFillOrder(tif, FILLORDER_MSB2LSB));
660 }
#define isFillOrder(tif, o)
Definition: tiffiop.h:231
#define FILLORDER_MSB2LSB
Definition: tiff.h:216

◆ TIFFIsTiled()

int TIFFIsTiled ( TIFF )

Definition at line 594 of file tif_open.c.

595 {
596  return (isTiled(tif));
597 }
#define isTiled(tif)
Definition: tiffiop.h:229

Referenced by PickContigCase(), PickSeparateCase(), TIFFForceStrileArrayWriting(), TIFFReadFromUserBuffer(), TIFFReadRGBAStripExt(), and TIFFReadRGBATileExt().

◆ TIFFIsUpSampled()

int TIFFIsUpSampled ( TIFF )

Definition at line 648 of file tif_open.c.

649 {
650  return (isUpSampled(tif));
651 }
#define isUpSampled(tif)
Definition: tiffiop.h:232

◆ TIFFLastDirectory()

int TIFFLastDirectory ( TIFF )

Definition at line 1676 of file tif_dir.c.

1677 {
1678  return (tif->tif_nextdiroff == 0);
1679 }

◆ 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:97
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:121
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:2930
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 1586 of file tif_dir.c.

1587 {
1588  static const char module[] = "TIFFNumberOfDirectories";
1589  uint64 nextdir;
1590  uint16 n;
1591  if (!(tif->tif_flags&TIFF_BIGTIFF))
1592  nextdir = tif->tif_header.classic.tiff_diroff;
1593  else
1594  nextdir = tif->tif_header.big.tiff_diroff;
1595  n = 0;
1596  while (nextdir != 0 && TIFFAdvanceDirectory(tif, &nextdir, NULL))
1597  {
1598  if (n != 65535) {
1599  ++n;
1600  }
1601  else
1602  {
1603  TIFFErrorExt(tif->tif_clientdata, module,
1604  "Directory count exceeded 65535 limit,"
1605  " giving up on counting.");
1606  return (65535);
1607  }
1608  }
1609  return (n);
1610 }
unsigned long long uint64
Definition: platform.h:18
GLdouble n
Definition: glext.h:7729
#define TIFF_BIGTIFF
Definition: tiffiop.h:138
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:1444
unsigned short uint16
Definition: types.h:30

◆ TIFFNumberOfStrips()

uint32 TIFFNumberOfStrips ( TIFF )

Definition at line 59 of file tif_strip.c.

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

Referenced by TIFFReadDirectory(), and TIFFSetupStrips().

◆ TIFFNumberOfTiles()

uint32 TIFFNumberOfTiles ( TIFF )

Definition at line 113 of file tif_tile.c.

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

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:115
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:47
#define O_BINARY
Definition: acwin.h:109
Definition: name.c:38

◆ TIFFPrintDirectory()

void TIFFPrintDirectory ( TIFF ,
FILE ,
long   
)

Definition at line 234 of file tif_print.c.

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

◆ TIFFRasterScanlineSize()

tmsize_t TIFFRasterScanlineSize ( TIFF tif)

Definition at line 344 of file tif_strip.c.

345 {
346  static const char module[] = "TIFFRasterScanlineSize";
347  uint64 m;
349  return _TIFFCastUInt64ToSSize(tif, m, module);
350 }
unsigned long long uint64
Definition: platform.h:18
uint64 TIFFRasterScanlineSize64(TIFF *tif)
Definition: tif_strip.c:329
const GLfloat * m
Definition: glext.h:10848
tmsize_t _TIFFCastUInt64ToSSize(TIFF *tif, uint64 val, const char *module)
Definition: tif_aux.c:83

◆ TIFFRasterScanlineSize64()

uint64 TIFFRasterScanlineSize64 ( TIFF tif)

Definition at line 329 of file tif_strip.c.

330 {
331  static const char module[] = "TIFFRasterScanlineSize64";
332  TIFFDirectory *td = &tif->tif_dir;
333  uint64 scanline;
334 
335  scanline = _TIFFMultiply64(tif, td->td_bitspersample, td->td_imagewidth, module);
337  scanline = _TIFFMultiply64(tif, scanline, td->td_samplesperpixel, module);
338  return (TIFFhowmany8_64(scanline));
339  } else
340  return (_TIFFMultiply64(tif, TIFFhowmany8_64(scanline),
341  td->td_samplesperpixel, module));
342 }