chromium/third_party/pdfium/third_party/libtiff/tif_dir.h

/*
 * Copyright (c) 1988-1997 Sam Leffler
 * Copyright (c) 1991-1997 Silicon Graphics, Inc.
 *
 * Permission to use, copy, modify, distribute, and sell this software and
 * its documentation for any purpose is hereby granted without fee, provided
 * that (i) the above copyright notices and this permission notice appear in
 * all copies of the software and related documentation, and (ii) the names of
 * Sam Leffler and Silicon Graphics may not be used in any advertising or
 * publicity relating to the software without the specific, prior written
 * permission of Sam Leffler and Silicon Graphics.
 *
 * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
 * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
 *
 * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
 * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
 * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
 * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
 * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
 * OF THIS SOFTWARE.
 */

#ifndef _TIFFDIR_
#define _TIFFDIR_

#include "tiff.h"
#include "tiffio.h"

/*
 * ``Library-private'' Directory-related Definitions.
 */

TIFFTagValue;

/*
 * TIFF Image File Directories are comprised of a table of field
 * descriptors of the form shown below.  The table is sorted in
 * ascending order by tag.  The values associated with each entry are
 * disjoint and may appear anywhere in the file (so long as they are
 * placed on a word boundary).
 *
 * If the value is 4 bytes or less, in ClassicTIFF, or 8 bytes or less in
 * BigTIFF, then it is placed in the offset field to save space. If so,
 * it is left-justified in the offset field.
 */
TIFFDirEntry;

/*
 * Internal format of a TIFF directory entry.
 */
TIFFDirectory;

/*
 * Field flags used to indicate fields that have been set in a directory, and
 * to reference fields when manipulating a directory.
 */

/*
 * FIELD_IGNORE is used to signify tags that are to be processed but otherwise
 * ignored.  This permits antiquated tags to be quietly read and discarded.
 * Note that a bit *is* allocated for ignored tags; this is understood by the
 * directory reading logic which uses this fact to avoid special-case handling
 */
#define FIELD_IGNORE

/* multi-item fields */
#define FIELD_IMAGEDIMENSIONS
#define FIELD_TILEDIMENSIONS
#define FIELD_RESOLUTION
#define FIELD_POSITION

/* single-item fields */
#define FIELD_SUBFILETYPE
#define FIELD_BITSPERSAMPLE
#define FIELD_COMPRESSION
#define FIELD_PHOTOMETRIC
#define FIELD_THRESHHOLDING
#define FIELD_FILLORDER
#define FIELD_ORIENTATION
#define FIELD_SAMPLESPERPIXEL
#define FIELD_ROWSPERSTRIP
#define FIELD_MINSAMPLEVALUE
#define FIELD_MAXSAMPLEVALUE
#define FIELD_PLANARCONFIG
#define FIELD_RESOLUTIONUNIT
#define FIELD_PAGENUMBER
#define FIELD_STRIPBYTECOUNTS
#define FIELD_STRIPOFFSETS
#define FIELD_COLORMAP
#define FIELD_EXTRASAMPLES
#define FIELD_SAMPLEFORMAT
#define FIELD_SMINSAMPLEVALUE
#define FIELD_SMAXSAMPLEVALUE
#define FIELD_IMAGEDEPTH
#define FIELD_TILEDEPTH
#define FIELD_HALFTONEHINTS
#define FIELD_YCBCRSUBSAMPLING
#define FIELD_YCBCRPOSITIONING
#define FIELD_REFBLACKWHITE
#define FIELD_TRANSFERFUNCTION
#define FIELD_INKNAMES
#define FIELD_SUBIFD
#define FIELD_NUMBEROFINKS
/*      FIELD_CUSTOM (see tiffio.h)    65 */
/* end of support for well-known tags; codec-private tags follow */
#define FIELD_CODEC

/*
 * Pseudo-tags don't normally need field bits since they are not written to an
 * output file (by definition). The library also has express logic to always
 * query a codec for a pseudo-tag so allocating a field bit for one is a
 * waste.   If codec wants to promote the notion of a pseudo-tag being ``set''
 * or ``unset'' then it can do using internal state flags without polluting
 * the field bit space defined for real tags.
 */
#define FIELD_PSEUDO

#define FIELD_LAST

#define BITn(n)
#define BITFIELDn(tif, n)
#define TIFFFieldSet(tif, field)
#define TIFFSetFieldBit(tif, field)
#define TIFFClrFieldBit(tif, field)

#define FieldSet(fields, f)
#define ResetFieldBit(fields, f)

TIFFSetGetFieldType;

#if defined(__cplusplus)
extern "C"
{
#endif

    extern const TIFFFieldArray *_TIFFGetFields(void);
    extern const TIFFFieldArray *_TIFFGetExifFields(void);
    extern const TIFFFieldArray *_TIFFGetGpsFields(void);
    extern void _TIFFSetupFields(TIFF *tif, const TIFFFieldArray *infoarray);
    extern void _TIFFPrintFieldInfo(TIFF *, FILE *);

    extern int _TIFFFillStriles(TIFF *);

    TIFFFieldArrayType;

    struct _TIFFFieldArray
    {};

    struct _TIFFField
    {};

    extern int _TIFFMergeFields(TIFF *, const TIFFField[], uint32_t);
    extern const TIFFField *_TIFFFindOrRegisterField(TIFF *, uint32_t,
                                                     TIFFDataType);
    extern TIFFField *_TIFFCreateAnonField(TIFF *, uint32_t, TIFFDataType);
    extern int _TIFFCheckFieldIsValidForCodec(TIFF *tif, ttag_t tag);
    extern int _TIFFCheckDirNumberAndOffset(TIFF *tif, tdir_t dirn,
                                            uint64_t diroff);
    extern int _TIFFGetDirNumberFromOffset(TIFF *tif, uint64_t diroff,
                                           tdir_t *dirn);
    extern int _TIFFGetOffsetFromDirNumber(TIFF *tif, tdir_t dirn,
                                           uint64_t *diroff);
    extern int _TIFFRemoveEntryFromDirectoryListByOffset(TIFF *tif,
                                                         uint64_t diroff);

#if defined(__cplusplus)
}
#endif
#endif /* _TIFFDIR_ */