LibTIFF 4.7.2
TIFF library public API and implementation reference
Loading...
Searching...
No Matches
Macros | Functions | Variables
tif_dir.c File Reference

Implement directory operations and shared owned-array copy helpers. More...

#include "tiffiop.h"
#include <float.h>
#include <limits.h>
#include <math.h>
Include dependency graph for tif_dir.c:

Go to the source code of this file.

Macros

#define DATATYPE_VOID   0 /* !untyped data */
 Identify legacy DataType untyped samples.
 
#define DATATYPE_INT   1 /* !signed integer data */
 Identify legacy DataType signed integer samples.
 
#define DATATYPE_UINT   2 /* !unsigned integer data */
 Identify legacy DataType unsigned integer samples.
 
#define DATATYPE_IEEEFP   3 /* !IEEE floating point data */
 Identify legacy DataType IEEE floating-point samples.
 
#define EXTRASAMPLE_COREL_UNASSALPHA   999
 Recognise Corel's nonstandard unassociated-alpha code.
 
#define CleanupField(member)
 Release and clear one directory-owned allocation.
 

Functions

static void setByteArray (TIFF *tif, void **vpp, const void *vp, size_t nmemb, size_t elem_size)
 Discard an old allocation and copy a replacement byte product.
 
void _TIFFsetByteArray (void **vpp, const void *vp, uint32_t n)
 Replace an owned byte array with a copied array.
 
void _TIFFsetByteArrayExt (TIFF *tif, void **vpp, const void *vp, uint32_t n)
 Replace an owned byte array with a copied array.
 
static void _TIFFsetNString (TIFF *tif, char **cpp, const char *cp, uint32_t n)
 Replace an owned string byte sequence with a copy.
 
void _TIFFsetShortArray (uint16_t **wpp, const uint16_t *wp, uint32_t n)
 Replace an owned short array with a copied array.
 
void _TIFFsetShortArrayExt (TIFF *tif, uint16_t **wpp, const uint16_t *wp, uint32_t n)
 Replace an owned short array with a copied array.
 
void _TIFFsetLongArray (uint32_t **lpp, const uint32_t *lp, uint32_t n)
 Replace an owned long array with a copied array.
 
void _TIFFsetLongArrayExt (TIFF *tif, uint32_t **lpp, const uint32_t *lp, uint32_t n)
 Replace an owned long array with a copied array.
 
static void _TIFFsetLong8Array (TIFF *tif, uint64_t **lpp, const uint64_t *lp, uint32_t n)
 Replace an owned 64-bit integer array with a copy.
 
void _TIFFsetFloatArray (float **fpp, const float *fp, uint32_t n)
 Replace an owned float array with a copied array.
 
void _TIFFsetFloatArrayExt (TIFF *tif, float **fpp, const float *fp, uint32_t n)
 Replace an owned float array with a copied array.
 
void _TIFFsetDoubleArray (double **dpp, const double *dp, uint32_t n)
 Replace an owned double array with a copied array.
 
void _TIFFsetDoubleArrayExt (TIFF *tif, double **dpp, const double *dp, uint32_t n)
 Replace an owned double array with a copied array.
 
static void setDoubleArrayOneValue (TIFF *tif, double **vpp, double value, size_t nmemb)
 Replace an owned double array with one repeated value.
 
static int setShortArrayWithCount (TIFF *tif, uint16_t **wpp, uint32_t *countp, const uint16_t *wp, uint32_t n)
 Install a short array together with the number of elements it holds.
 
static void cancelColorMap (TIFF *tif)
 Drop a ColorMap that no longer describes the directory it belongs to.
 
static void cancelTransferFunction (TIFF *tif)
 Drop a TransferFunction that no longer describes the directory it belongs to.
 
static int setColorMap (TIFF *tif, va_list ap, uint32_t count)
 Install the ColorMap arrays.
 
static int setTransferFunction (TIFF *tif, va_list ap, uint32_t count)
 Install the TransferFunction curves.
 
static int setExtraSamples (TIFF *tif, va_list ap, uint32_t *v)
 Validate and install extra-sample interpretations.
 
static uint16_t countInkNamesString (TIFF *tif, uint32_t slen, const char *s)
 Count terminated ink names within a byte extent.
 
static void removeCustomValue (TIFFDirectory *td, int i)
 Remove a custom tag entry whose value could not be set.
 
static int _TIFFVSetField (TIFF *tif, uint32_t tag, va_list ap)
 Implement core and generic custom-tag storage.
 
static int OkToChangeTag (TIFF *tif, uint32_t tag)
 Check registration and tag mutability during writing.
 
int TIFFSetField (TIFF *tif, uint32_t tag,...)
 Set a tag value in the current in-memory directory.
 
int TIFFUnsetField (TIFF *tif, uint32_t tag)
 Clear tag presence or remove a stored custom value.
 
int TIFFVSetField (TIFF *tif, uint32_t tag, va_list ap)
 Set a tag value in the current in-memory directory.
 
static int _TIFFVGetField (TIFF *tif, uint32_t tag, va_list ap)
 Implement core and generic custom-tag queries.
 
int TIFFGetField (TIFF *tif, uint32_t tag,...)
 Query a present tag in the current directory.
 
int TIFFVGetField (TIFF *tif, uint32_t tag, va_list ap)
 Query a present tag in the current directory.
 
void _TIFFResetTifDirAndInitStrileCounters (TIFFDirectory *td)
 Zero directory storage and initialise traversal sentinels.
 
void TIFFFreeDirectory (TIFF *tif)
 Release the current directory's owned values and codec state.
 
TIFFExtendProc TIFFSetTagExtender (TIFFExtendProc extender)
 Replace the process-wide image-directory extension callback.
 
int TIFFCreateDirectory (TIFF *tif)
 Replace current values with a fresh in-memory image directory.
 
int TIFFCreateCustomDirectory (TIFF *tif, const TIFFFieldArray *infoarray)
 Replace current values with a fresh custom metadata directory.
 
int TIFFCreateEXIFDirectory (TIFF *tif)
 Create a fresh in-memory EXIF metadata directory.
 
int TIFFCreateGPSDirectory (TIFF *tif)
 Create a fresh in-memory EXIF GPS metadata directory.
 
int TIFFDefaultDirectory (TIFF *tif)
 Install the image schema, default values, and core tag methods.
 
static int TIFFAdvanceDirectory (TIFF *tif, uint64_t *nextdiroff, uint64_t *off, tdir_t *nextdirnum)
 Read one chain link and update traversal/map bookkeeping.
 
tdir_t TIFFNumberOfDirectories (TIFF *tif)
 Count reachable main-chain directories from the cached file header.
 
int TIFFSetDirectory (TIFF *tif, tdir_t dirn)
 Select and read an image directory by its main-chain index.
 
int TIFFSetSubDirectory (TIFF *tif, uint64_t diroff)
 Select and read an image directory at a file offset.
 
uint64_t TIFFCurrentDirOffset (TIFF *tif)
 Read the cached file offset of the current directory.
 
int TIFFLastDirectory (TIFF *tif)
 Test whether the cached next-directory link is zero.
 
int TIFFUnlinkDirectory (TIFF *tif, tdir_t dirn)
 Remove an image directory from the on-file main chain.
 

Variables

static TIFFExtendProc _TIFFextender = (TIFFExtendProc)NULL
 Store the process-wide borrowed directory-extension callback.
 

Detailed Description

Implement directory operations and shared owned-array copy helpers.

Definition in file tif_dir.c.