Blame src/tiffimage_int.cpp

Packit Service 21b5d1
#include "tiffimage_int.hpp"
Packit Service 21b5d1
Packit Service 21b5d1
#include "error.hpp"
Packit Service 21b5d1
#include "makernote_int.hpp"
Packit Service 21b5d1
#include "sonymn_int.hpp"
Packit Service 21b5d1
#include "tiffvisitor_int.hpp"
Packit Service 21b5d1
#include "i18n.h"                // NLS support.
Packit Service 21b5d1
Packit Service 21b5d1
// Shortcuts for the newTiffBinaryArray templates.
Packit Service 21b5d1
#define EXV_BINARY_ARRAY(arrayCfg, arrayDef) (newTiffBinaryArray0<&arrayCfg, EXV_COUNTOF(arrayDef), arrayDef>)
Packit Service 21b5d1
#define EXV_SIMPLE_BINARY_ARRAY(arrayCfg) (newTiffBinaryArray1<&arrayCfg>)
Packit Service 21b5d1
#define EXV_COMPLEX_BINARY_ARRAY(arraySet, cfgSelFct) (newTiffBinaryArray2<arraySet, EXV_COUNTOF(arraySet), cfgSelFct>)
Packit Service 21b5d1
Packit Service 21b5d1
namespace Exiv2 {
Packit Service 21b5d1
    namespace Internal {
Packit Service 21b5d1
Packit Service 21b5d1
    //! Constant for non-encrypted binary arrays
Packit Service 21b5d1
    const CryptFct notEncrypted = 0;
Packit Service 21b5d1
Packit Service 21b5d1
    //! Canon Camera Settings binary array - configuration
Packit Service 21b5d1
    extern const ArrayCfg canonCsCfg = {
Packit Service 21b5d1
        canonCsId,        // Group for the elements
Packit Service 21b5d1
        invalidByteOrder, // Use byte order from parent
Packit Service 21b5d1
        ttUnsignedShort,  // Type for array entry and size element
Packit Service 21b5d1
        notEncrypted,     // Not encrypted
Packit Service 21b5d1
        true,             // With size element
Packit Service 21b5d1
        false,            // No fillers
Packit Service 21b5d1
        false,            // Don't concatenate gaps
Packit Service 21b5d1
        { 0, ttUnsignedShort, 1 }
Packit Service 21b5d1
    };
Packit Service 21b5d1
    //! Canon Camera Settings binary array - definition
Packit Service 21b5d1
    extern const ArrayDef canonCsDef[] = {
Packit Service 21b5d1
        { 46, ttUnsignedShort, 3 } // Exif.CanonCs.Lens
Packit Service 21b5d1
    };
Packit Service 21b5d1
Packit Service 21b5d1
    //! Canon Shot Info binary array - configuration
Packit Service 21b5d1
    extern const ArrayCfg canonSiCfg = {
Packit Service 21b5d1
        canonSiId,        // Group for the elements
Packit Service 21b5d1
        invalidByteOrder, // Use byte order from parent
Packit Service 21b5d1
        ttUnsignedShort,  // Type for array entry and size element
Packit Service 21b5d1
        notEncrypted,     // Not encrypted
Packit Service 21b5d1
        true,             // With size element
Packit Service 21b5d1
        false,            // No fillers
Packit Service 21b5d1
        false,            // Don't concatenate gaps
Packit Service 21b5d1
        { 0, ttUnsignedShort, 1 }
Packit Service 21b5d1
    };
Packit Service 21b5d1
Packit Service 21b5d1
    //! Canon Panorama binary array - configuration
Packit Service 21b5d1
    extern const ArrayCfg canonPaCfg = {
Packit Service 21b5d1
        canonPaId,        // Group for the elements
Packit Service 21b5d1
        invalidByteOrder, // Use byte order from parent
Packit Service 21b5d1
        ttUnsignedShort,  // Type for array entry and size element
Packit Service 21b5d1
        notEncrypted,     // Not encrypted
Packit Service 21b5d1
        false,            // No size element
Packit Service 21b5d1
        false,            // No fillers
Packit Service 21b5d1
        false,            // Don't concatenate gaps
Packit Service 21b5d1
        { 0, ttUnsignedShort, 1 }
Packit Service 21b5d1
    };
Packit Service 21b5d1
Packit Service 21b5d1
    //! Canon Custom Function binary array - configuration
Packit Service 21b5d1
    extern const ArrayCfg canonCfCfg = {
Packit Service 21b5d1
        canonCfId,        // Group for the elements
Packit Service 21b5d1
        invalidByteOrder, // Use byte order from parent
Packit Service 21b5d1
        ttUnsignedShort,  // Type for array entry and size element
Packit Service 21b5d1
        notEncrypted,     // Not encrypted
Packit Service 21b5d1
        true,             // With size element
Packit Service 21b5d1
        false,            // No fillers
Packit Service 21b5d1
        false,            // Don't concatenate gaps
Packit Service 21b5d1
        { 0, ttUnsignedShort, 1 }
Packit Service 21b5d1
    };
Packit Service 21b5d1
Packit Service 21b5d1
    //! Canon Picture Info binary array - configuration
Packit Service 21b5d1
    extern const ArrayCfg canonPiCfg = {
Packit Service 21b5d1
        canonPiId,        // Group for the elements
Packit Service 21b5d1
        invalidByteOrder, // Use byte order from parent
Packit Service 21b5d1
        ttUnsignedShort,  // Type for array entry and size element
Packit Service 21b5d1
        notEncrypted,     // Not encrypted
Packit Service 21b5d1
        false,            // No size element
Packit Service 21b5d1
        false,            // No fillers
Packit Service 21b5d1
        false,            // Don't concatenate gaps
Packit Service 21b5d1
        { 0, ttUnsignedShort, 1 }
Packit Service 21b5d1
    };
Packit Service 21b5d1
Packit Service 21b5d1
    //! Canon Time Info binary array - configuration
Packit Service 21b5d1
    extern const ArrayCfg canonTiCfg = {
Packit Service 21b5d1
        canonTiId,        // Group for the elements
Packit Service 21b5d1
        invalidByteOrder, // Use byte order from parent
Packit Service 21b5d1
        ttSignedLong,     // Type for array entry and size element
Packit Service 21b5d1
        notEncrypted,     // Not encrypted
Packit Service 21b5d1
        true,             // With size element
Packit Service 21b5d1
        false,            // No fillers
Packit Service 21b5d1
        false,            // Don't concatenate gaps
Packit Service 21b5d1
        { 0, ttSignedLong, 1 }
Packit Service 21b5d1
    };
Packit Service 21b5d1
Packit Service 21b5d1
    //! Canon File Info binary array - configuration
Packit Service 21b5d1
    extern const ArrayCfg canonFiCfg = {
Packit Service 21b5d1
        canonFiId,        // Group for the elements
Packit Service 21b5d1
        invalidByteOrder, // Use byte order from parent
Packit Service 21b5d1
        ttUnsignedShort,  // Type for array entry and size element
Packit Service 21b5d1
        notEncrypted,     // Not encrypted
Packit Service 21b5d1
        true,             // Has a size element
Packit Service 21b5d1
        false,            // No fillers
Packit Service 21b5d1
        false,            // Don't concatenate gaps
Packit Service 21b5d1
        { 0, ttSignedShort, 1 }
Packit Service 21b5d1
    };
Packit Service 21b5d1
    //! Canon File Info binary array - definition
Packit Service 21b5d1
    extern const ArrayDef canonFiDef[] = {
Packit Service 21b5d1
        { 2, ttUnsignedLong, 1 }
Packit Service 21b5d1
    };
Packit Service 21b5d1
Packit Service 21b5d1
    //! Canon Processing Info binary array - configuration
Packit Service 21b5d1
    extern const ArrayCfg canonPrCfg = {
Packit Service 21b5d1
        canonPrId,        // Group for the elements
Packit Service 21b5d1
        invalidByteOrder, // Use byte order from parent
Packit Service 21b5d1
        ttUnsignedShort,  // Type for array entry and size element
Packit Service 21b5d1
        notEncrypted,     // Not encrypted
Packit Service 21b5d1
        true,             // Has a size element
Packit Service 21b5d1
        false,            // No fillers
Packit Service 21b5d1
        false,            // Don't concatenate gaps
Packit Service 21b5d1
        { 0, ttSignedShort, 1 }
Packit Service 21b5d1
    };
Packit Service 21b5d1
Packit Service 21b5d1
    //! Nikon Vibration Reduction binary array - configuration
Packit Service 21b5d1
    extern const ArrayCfg nikonVrCfg = {
Packit Service 21b5d1
        nikonVrId,        // Group for the elements
Packit Service 21b5d1
        invalidByteOrder, // Use byte order from parent
Packit Service 21b5d1
        ttUndefined,      // Type for array entry
Packit Service 21b5d1
        notEncrypted,     // Not encrypted
Packit Service 21b5d1
        false,            // No size element
Packit Service 21b5d1
        true,             // Write all tags
Packit Service 21b5d1
        true,             // Concatenate gaps
Packit Service 21b5d1
        { 0, ttUnsignedByte,  1 }
Packit Service 21b5d1
    };
Packit Service 21b5d1
    //! Nikon Vibration Reduction binary array - definition
Packit Service 21b5d1
    extern const ArrayDef nikonVrDef[] = {
Packit Service 21b5d1
        { 0, ttUndefined,     4 }, // Version
Packit Service 21b5d1
        { 7, ttUnsignedByte,  1 }  // The array contains 8 bytes
Packit Service 21b5d1
    };
Packit Service 21b5d1
Packit Service 21b5d1
    //! Nikon Picture Control binary array - configuration
Packit Service 21b5d1
    extern const ArrayCfg nikonPcCfg = {
Packit Service 21b5d1
        nikonPcId,        // Group for the elements
Packit Service 21b5d1
        invalidByteOrder, // Use byte order from parent
Packit Service 21b5d1
        ttUndefined,      // Type for array entry
Packit Service 21b5d1
        notEncrypted,     // Not encrypted
Packit Service 21b5d1
        false,            // No size element
Packit Service 21b5d1
        true,             // Write all tags
Packit Service 21b5d1
        true,             // Concatenate gaps
Packit Service 21b5d1
        { 0, ttUnsignedByte,  1 }
Packit Service 21b5d1
    };
Packit Service 21b5d1
    //! Nikon Picture Control binary array - definition
Packit Service 21b5d1
    extern const ArrayDef nikonPcDef[] = {
Packit Service 21b5d1
        {  0, ttUndefined,     4 }, // Version
Packit Service 21b5d1
        {  4, ttAsciiString,  20 },
Packit Service 21b5d1
        { 24, ttAsciiString,  20 },
Packit Service 21b5d1
        { 48, ttUnsignedByte,  1 },
Packit Service 21b5d1
        { 49, ttUnsignedByte,  1 },
Packit Service 21b5d1
        { 50, ttUnsignedByte,  1 },
Packit Service 21b5d1
        { 51, ttUnsignedByte,  1 },
Packit Service 21b5d1
        { 52, ttUnsignedByte,  1 },
Packit Service 21b5d1
        { 53, ttUnsignedByte,  1 },
Packit Service 21b5d1
        { 54, ttUnsignedByte,  1 },
Packit Service 21b5d1
        { 55, ttUnsignedByte,  1 },
Packit Service 21b5d1
        { 56, ttUnsignedByte,  1 },
Packit Service 21b5d1
        { 57, ttUnsignedByte,  1 }  // The array contains 58 bytes
Packit Service 21b5d1
    };
Packit Service 21b5d1
Packit Service 21b5d1
    //! Nikon World Time binary array - configuration
Packit Service 21b5d1
    extern const ArrayCfg nikonWtCfg = {
Packit Service 21b5d1
        nikonWtId,        // Group for the elements
Packit Service 21b5d1
        invalidByteOrder, // Use byte order from parent
Packit Service 21b5d1
        ttUndefined,      // Type for array entry
Packit Service 21b5d1
        notEncrypted,     // Not encrypted
Packit Service 21b5d1
        false,            // No size element
Packit Service 21b5d1
        true,             // Write all tags
Packit Service 21b5d1
        true,             // Concatenate gaps
Packit Service 21b5d1
        { 0, ttUnsignedByte,  1 }
Packit Service 21b5d1
    };
Packit Service 21b5d1
    //! Nikon World Time binary array - definition
Packit Service 21b5d1
    extern const ArrayDef nikonWtDef[] = {
Packit Service 21b5d1
        { 0, ttSignedShort,   1 },
Packit Service 21b5d1
        { 2, ttUnsignedByte,  1 },
Packit Service 21b5d1
        { 3, ttUnsignedByte,  1 }
Packit Service 21b5d1
    };
Packit Service 21b5d1
Packit Service 21b5d1
    //! Nikon ISO info binary array - configuration
Packit Service 21b5d1
    extern const ArrayCfg nikonIiCfg = {
Packit Service 21b5d1
        nikonIiId,        // Group for the elements
Packit Service 21b5d1
        bigEndian,        // Byte order
Packit Service 21b5d1
        ttUndefined,      // Type for array entry
Packit Service 21b5d1
        notEncrypted,     // Not encrypted
Packit Service 21b5d1
        false,            // No size element
Packit Service 21b5d1
        true,             // Write all tags
Packit Service 21b5d1
        true,             // Concatenate gaps
Packit Service 21b5d1
        { 0, ttUnsignedByte,  1 }
Packit Service 21b5d1
    };
Packit Service 21b5d1
    //! Nikon ISO info binary array - definition
Packit Service 21b5d1
    extern const ArrayDef nikonIiDef[] = {
Packit Service 21b5d1
        {  0, ttUnsignedByte,  1 },
Packit Service 21b5d1
        {  4, ttUnsignedShort, 1 },
Packit Service 21b5d1
        {  6, ttUnsignedByte,  1 },
Packit Service 21b5d1
        { 10, ttUnsignedShort, 1 },
Packit Service 21b5d1
        { 13, ttUnsignedByte,  1 }  // The array contains 14 bytes
Packit Service 21b5d1
    };
Packit Service 21b5d1
Packit Service 21b5d1
    //! Nikon Auto Focus binary array - configuration
Packit Service 21b5d1
    extern const ArrayCfg nikonAfCfg = {
Packit Service 21b5d1
        nikonAfId,        // Group for the elements
Packit Service 21b5d1
        invalidByteOrder, // Use byte order from parent
Packit Service 21b5d1
        ttUndefined,      // Type for array entry
Packit Service 21b5d1
        notEncrypted,     // Not encrypted
Packit Service 21b5d1
        false,            // No size element
Packit Service 21b5d1
        true,             // Write all tags
Packit Service 21b5d1
        true,             // Concatenate gaps
Packit Service 21b5d1
        { 0, ttUnsignedByte,  1 }
Packit Service 21b5d1
    };
Packit Service 21b5d1
    //! Nikon Auto Focus binary array - definition
Packit Service 21b5d1
    extern const ArrayDef nikonAfDef[] = {
Packit Service 21b5d1
        { 0, ttUnsignedByte,  1 },
Packit Service 21b5d1
        { 1, ttUnsignedByte,  1 },
Packit Service 21b5d1
        { 2, ttUnsignedShort, 1 } // The array contains 4 bytes
Packit Service 21b5d1
    };
Packit Service 21b5d1
Packit Service 21b5d1
    //! Nikon Auto Focus 21 binary array - configuration
Packit Service 21b5d1
    extern const ArrayCfg nikonAf21Cfg = {
Packit Service 21b5d1
        nikonAf21Id,      // Group for the elements
Packit Service 21b5d1
        invalidByteOrder, // Use byte order from parent
Packit Service 21b5d1
        ttUndefined,      // Type for array entry
Packit Service 21b5d1
        notEncrypted,     // Not encrypted
Packit Service 21b5d1
        false,            // No size element
Packit Service 21b5d1
        true,             // Write all tags
Packit Service 21b5d1
        true,             // Concatenate gaps
Packit Service 21b5d1
        { 0, ttUnsignedByte,  1 }
Packit Service 21b5d1
    };
Packit Service 21b5d1
    //! Nikon Auto Focus 21 binary array - definition
Packit Service 21b5d1
    extern const ArrayDef nikonAf21Def[] = {
Packit Service 21b5d1
        {  0, ttUndefined,     4 }, // Version
Packit Service 21b5d1
        {  4, ttUnsignedByte,  1 }, // ContrastDetectAF
Packit Service 21b5d1
        {  5, ttUnsignedByte,  1 }, // AFAreaMode
Packit Service 21b5d1
        {  6, ttUnsignedByte,  1 }, // PhaseDetectAF
Packit Service 21b5d1
        {  7, ttUnsignedByte,  1 }, // PrimaryAFPoint
Packit Service 21b5d1
        {  8, ttUnsignedByte,  7 }, // AFPointsUsed
Packit Service 21b5d1
        { 16, ttUnsignedShort, 1 }, // AFImageWidth
Packit Service 21b5d1
        { 18, ttUnsignedShort, 1 }, // AFImageHeight
Packit Service 21b5d1
        { 20, ttUnsignedShort, 1 }, // AFAreaXPosition
Packit Service 21b5d1
        { 22, ttUnsignedShort, 1 }, // AFAreaYPosition
Packit Service 21b5d1
        { 24, ttUnsignedShort, 1 }, // AFAreaWidth
Packit Service 21b5d1
        { 26, ttUnsignedShort, 1 }, // AFAreaHeight
Packit Service 21b5d1
        { 28, ttUnsignedShort, 1 }, // ContrastDetectAFInFocus
Packit Service 21b5d1
    };
Packit Service 21b5d1
    //! Nikon Auto Focus 22 binary array - configuration
Packit Service 21b5d1
    extern const ArrayCfg nikonAf22Cfg = {
Packit Service 21b5d1
        nikonAf22Id,      // Group for the elements
Packit Service 21b5d1
        invalidByteOrder, // Byte order
Packit Service 21b5d1
        ttUndefined,      // Type for array entry
Packit Service 21b5d1
        notEncrypted,     // Not encrypted
Packit Service 21b5d1
        false,            // No size element
Packit Service 21b5d1
        true,             // Write all tags
Packit Service 21b5d1
        true,            // Concatenate gaps
Packit Service 21b5d1
        { 0, ttUnsignedByte,  1 }
Packit Service 21b5d1
    };
Packit Service 21b5d1
    //! Nikon Auto Focus 22 binary array - definition
Packit Service 21b5d1
    extern const ArrayDef nikonAf22Def[] = {
Packit Service 21b5d1
        {  0, ttUndefined,     4 }, // Version
Packit Service 21b5d1
        {  4, ttUnsignedByte,  1 }, // ContrastDetectAF
Packit Service 21b5d1
        {  5, ttUnsignedByte,  1 }, // AFAreaMode
Packit Service 21b5d1
        {  6, ttUnsignedByte,  1 }, // PhaseDetectAF
Packit Service 21b5d1
        {  7, ttUnsignedByte,  1 }, // PrimaryAFPoint
Packit Service 21b5d1
        {  8, ttUnsignedByte,  7 }, // AFPointsUsed
Packit Service 21b5d1
        { 70, ttUnsignedShort, 1 }, // AFImageWidth
Packit Service 21b5d1
        { 72, ttUnsignedShort, 1 }, // AFImageHeight
Packit Service 21b5d1
        { 74, ttUnsignedShort, 1 }, // AFAreaXPosition
Packit Service 21b5d1
        { 76, ttUnsignedShort, 1 }, // AFAreaYPosition
Packit Service 21b5d1
        { 78, ttUnsignedShort, 1 }, // AFAreaWidth
Packit Service 21b5d1
        { 80, ttUnsignedShort, 1 }, // AFAreaHeight
Packit Service 21b5d1
    };
Packit Service 21b5d1
Packit Service 21b5d1
    //! Nikon AF2 configuration and definitions
Packit Service 21b5d1
    //  https://github.com/Exiv2/exiv2/issues/646
Packit Service 21b5d1
    extern const ArraySet nikonAf2Set[] = {
Packit Service 21b5d1
        { nikonAf21Cfg, nikonAf21Def, EXV_COUNTOF(nikonAf21Def) },
Packit Service 21b5d1
        { nikonAf22Cfg, nikonAf22Def, EXV_COUNTOF(nikonAf22Def) },
Packit Service 21b5d1
    };
Packit Service 21b5d1
Packit Service 21b5d1
    //! Nikon AF Fine Tune binary array - configuration
Packit Service 21b5d1
    extern const ArrayCfg nikonAFTCfg = {
Packit Service 21b5d1
        nikonAFTId,       // Group for the elements
Packit Service 21b5d1
        invalidByteOrder, // Use byte order from parent
Packit Service 21b5d1
        ttUndefined,      // Type for array entry
Packit Service 21b5d1
        notEncrypted,     // Not encrypted
Packit Service 21b5d1
        false,            // No size element
Packit Service 21b5d1
        true,             // Write all tags
Packit Service 21b5d1
        true,             // Concatenate gaps
Packit Service 21b5d1
        { 0, ttUnsignedByte,  1 }
Packit Service 21b5d1
    };
Packit Service 21b5d1
    //! Nikon AF Fine Tune binary array - definition
Packit Service 21b5d1
    extern const ArrayDef nikonAFTDef[] = {
Packit Service 21b5d1
        {  0, ttUnsignedByte,  1 }, // AF Fine Tune on/off
Packit Service 21b5d1
        {  1, ttUnsignedByte,  1 }, // AF Fine Tune index
Packit Service 21b5d1
        {  2, ttUnsignedByte,  1 }  // AF Fine Tune value
Packit Service 21b5d1
    };
Packit Service 21b5d1
Packit Service 21b5d1
    //! Nikon File Info binary array - configuration
Packit Service 21b5d1
    extern const ArrayCfg nikonFiCfg = {
Packit Service 21b5d1
        nikonFiId,        // Group for the elements
Packit Service 21b5d1
        invalidByteOrder, // Use byte order from parent
Packit Service 21b5d1
        ttUndefined,      // Type for array entry
Packit Service 21b5d1
        notEncrypted,     // Not encrypted
Packit Service 21b5d1
        false,            // No size element
Packit Service 21b5d1
        true,             // Write all tags
Packit Service 21b5d1
        true,             // Concatenate gaps
Packit Service 21b5d1
        { 0, ttUnsignedByte,  1 }
Packit Service 21b5d1
    };
Packit Service 21b5d1
    //! Nikon File Info binary array - definition
Packit Service 21b5d1
    extern const ArrayDef nikonFiDef[] = {
Packit Service 21b5d1
        { 0, ttUndefined,     4 }, // Version
Packit Service 21b5d1
        { 6, ttUnsignedShort, 1 }, // Directory Number
Packit Service 21b5d1
        { 8, ttUnsignedShort, 1 }  // File Number
Packit Service 21b5d1
    };
Packit Service 21b5d1
Packit Service 21b5d1
    //! Nikon Multi Exposure binary array - configuration
Packit Service 21b5d1
    extern const ArrayCfg nikonMeCfg = {
Packit Service 21b5d1
        nikonMeId,        // Group for the elements
Packit Service 21b5d1
        invalidByteOrder, // Use byte order from parent
Packit Service 21b5d1
        ttUndefined,      // Type for array entry
Packit Service 21b5d1
        notEncrypted,     // Not encrypted
Packit Service 21b5d1
        false,            // No size element
Packit Service 21b5d1
        true,             // Write all tags
Packit Service 21b5d1
        true,             // Concatenate gaps
Packit Service 21b5d1
        { 0, ttUnsignedByte,  1 }
Packit Service 21b5d1
    };
Packit Service 21b5d1
    //! Nikon Multi Exposure binary array - definition
Packit Service 21b5d1
    extern const ArrayDef nikonMeDef[] = {
Packit Service 21b5d1
        {  0, ttUndefined,     4 }, // Version
Packit Service 21b5d1
        {  4, ttUnsignedLong,  1 }, // MultiExposureMode
Packit Service 21b5d1
        {  8, ttUnsignedLong,  1 }, // MultiExposureShots
Packit Service 21b5d1
        { 12, ttUnsignedLong,  1 }  // MultiExposureAutoGain
Packit Service 21b5d1
    };
Packit Service 21b5d1
Packit Service 21b5d1
    //! Nikon Flash Info binary array - configuration 1
Packit Service 21b5d1
    extern const ArrayCfg nikonFl1Cfg = {
Packit Service 21b5d1
        nikonFl1Id,       // Group for the elements
Packit Service 21b5d1
        invalidByteOrder, // Use byte order from parent
Packit Service 21b5d1
        ttUndefined,      // Type for array entry
Packit Service 21b5d1
        notEncrypted,     // Not encrypted
Packit Service 21b5d1
        false,            // No size element
Packit Service 21b5d1
        true,             // Write all tags
Packit Service 21b5d1
        true,             // Concatenate gaps
Packit Service 21b5d1
        { 0, ttUnsignedByte,  1 }
Packit Service 21b5d1
    };
Packit Service 21b5d1
    //! Nikon Flash Info binary array - definition 1
Packit Service 21b5d1
    extern const ArrayDef nikonFl1Def[] = {
Packit Service 21b5d1
        {  0, ttUndefined,     4 }, // Version
Packit Service 21b5d1
        {  4, ttUnsignedByte,  1 }, // FlashSource
Packit Service 21b5d1
        {  6, ttUnsignedShort, 1 }, // ExternalFlashFirmware
Packit Service 21b5d1
        {  8, ttUnsignedByte,  1 }, // ExternalFlashFlags
Packit Service 21b5d1
        { 11, ttUnsignedByte,  1 }, // FlashFocalLength
Packit Service 21b5d1
        { 12, ttUnsignedByte,  1 }, // RepeatingFlashRate
Packit Service 21b5d1
        { 13, ttUnsignedByte,  1 }, // RepeatingFlashCount
Packit Service 21b5d1
        { 14, ttUnsignedByte,  1 }, // FlashGNDistance
Packit Service 21b5d1
        { 15, ttUnsignedByte,  1 }, // FlashGroupAControlMode
Packit Service 21b5d1
        { 16, ttUnsignedByte,  1 }  // FlashGroupBControlMode
Packit Service 21b5d1
    };
Packit Service 21b5d1
    //! Nikon Flash Info binary array - configuration 2
Packit Service 21b5d1
    extern const ArrayCfg nikonFl2Cfg = {
Packit Service 21b5d1
        nikonFl2Id,       // Group for the elements
Packit Service 21b5d1
        invalidByteOrder, // Use byte order from parent
Packit Service 21b5d1
        ttUndefined,      // Type for array entry
Packit Service 21b5d1
        notEncrypted,     // Not encrypted
Packit Service 21b5d1
        false,            // No size element
Packit Service 21b5d1
        true,             // Write all tags
Packit Service 21b5d1
        true,             // Concatenate gaps
Packit Service 21b5d1
        { 0, ttUnsignedByte,  1 }
Packit Service 21b5d1
    };
Packit Service 21b5d1
    //! Nikon Flash Info binary array - definition 2
Packit Service 21b5d1
    extern const ArrayDef nikonFl2Def[] = {
Packit Service 21b5d1
        {  0, ttUndefined,     4 }, // Version
Packit Service 21b5d1
        {  4, ttUnsignedByte,  1 }, // FlashSource
Packit Service 21b5d1
        {  6, ttUnsignedShort, 1 }, // ExternalFlashFirmware
Packit Service 21b5d1
        {  8, ttUnsignedByte,  1 }, // ExternalFlashFlags
Packit Service 21b5d1
        { 12, ttUnsignedByte,  1 }, // FlashFocalLength
Packit Service 21b5d1
        { 13, ttUnsignedByte,  1 }, // RepeatingFlashRate
Packit Service 21b5d1
        { 14, ttUnsignedByte,  1 }, // RepeatingFlashCount
Packit Service 21b5d1
        { 15, ttUnsignedByte,  1 }, // FlashGNDistance
Packit Service 21b5d1
    };
Packit Service 21b5d1
    //! Nikon Flash Info binary array - configuration 3
Packit Service 21b5d1
    extern const ArrayCfg nikonFl3Cfg = {
Packit Service 21b5d1
        nikonFl3Id,       // Group for the elements
Packit Service 21b5d1
        invalidByteOrder, // Use byte order from parent
Packit Service 21b5d1
        ttUndefined,      // Type for array entry
Packit Service 21b5d1
        notEncrypted,     // Not encrypted
Packit Service 21b5d1
        false,            // No size element
Packit Service 21b5d1
        true,             // Write all tags
Packit Service 21b5d1
        true,             // Concatenate gaps
Packit Service 21b5d1
        { 0, ttUnsignedByte,  1 }
Packit Service 21b5d1
    };
Packit Service 21b5d1
    //! Nikon Flash Info binary array - definition
Packit Service 21b5d1
    extern const ArrayDef nikonFl3Def[] = {
Packit Service 21b5d1
        {  0, ttUndefined,     4 }, // Version
Packit Service 21b5d1
        {  4, ttUnsignedByte,  1 }, // FlashSource
Packit Service 21b5d1
        {  6, ttUnsignedShort, 1 }, // ExternalFlashFirmware
Packit Service 21b5d1
        {  8, ttUnsignedByte,  1 }, // ExternalFlashFlags
Packit Service 21b5d1
        { 12, ttUnsignedByte,  1 }, // FlashFocalLength
Packit Service 21b5d1
        { 13, ttUnsignedByte,  1 }, // RepeatingFlashRate
Packit Service 21b5d1
        { 14, ttUnsignedByte,  1 }, // RepeatingFlashCount
Packit Service 21b5d1
        { 15, ttUnsignedByte,  1 }, // FlashGNDistance
Packit Service 21b5d1
        { 16, ttUnsignedByte,  1 }, // FlashColorFilter
Packit Service 21b5d1
    };
Packit Service 21b5d1
    //! Nikon Lens Data configurations and definitions
Packit Service 21b5d1
    extern const ArraySet nikonFlSet[] = {
Packit Service 21b5d1
        { nikonFl1Cfg, nikonFl1Def, EXV_COUNTOF(nikonFl1Def) },
Packit Service 21b5d1
        { nikonFl2Cfg, nikonFl2Def, EXV_COUNTOF(nikonFl2Def) },
Packit Service 21b5d1
        { nikonFl3Cfg, nikonFl3Def, EXV_COUNTOF(nikonFl3Def) }
Packit Service 21b5d1
    };
Packit Service 21b5d1
Packit Service 21b5d1
    //! Nikon Shot Info binary array - configuration 1 (D80)
Packit Service 21b5d1
    extern const ArrayCfg nikonSi1Cfg = {
Packit Service 21b5d1
        nikonSi1Id,       // Group for the elements
Packit Service 21b5d1
        bigEndian,        // Use byte order from parent
Packit Service 21b5d1
        ttUndefined,      // Type for array entry
Packit Service 21b5d1
        nikonCrypt,       // Encryption function
Packit Service 21b5d1
        false,            // No size element
Packit Service 21b5d1
        true,             // Write all tags
Packit Service 21b5d1
        true,             // Concatenate gaps
Packit Service 21b5d1
        { 0, ttUnsignedByte,  1 }
Packit Service 21b5d1
    };
Packit Service 21b5d1
    //! Nikon Shot Info binary array - definition 1 (D80)
Packit Service 21b5d1
    extern const ArrayDef nikonSi1Def[] = {
Packit Service 21b5d1
        {    0, ttUndefined,    4 }, // Version
Packit Service 21b5d1
        {  586, ttUnsignedLong, 1 }, // ShutterCount
Packit Service 21b5d1
        { 1155, ttUnsignedByte, 1 }  // The array contains 1156 bytes
Packit Service 21b5d1
    };
Packit Service 21b5d1
    //! Nikon Shot Info binary array - configuration 2 (D40)
Packit Service 21b5d1
    extern const ArrayCfg nikonSi2Cfg = {
Packit Service 21b5d1
        nikonSi2Id,       // Group for the elements
Packit Service 21b5d1
        bigEndian,        // Use byte order from parent
Packit Service 21b5d1
        ttUndefined,      // Type for array entry
Packit Service 21b5d1
        nikonCrypt,       // Encryption function
Packit Service 21b5d1
        false,            // No size element
Packit Service 21b5d1
        true,             // Write all tags
Packit Service 21b5d1
        true,             // Concatenate gaps
Packit Service 21b5d1
        { 0, ttUnsignedByte,  1 }
Packit Service 21b5d1
    };
Packit Service 21b5d1
    //! Nikon Shot Info binary array - definition 2 (D40)
Packit Service 21b5d1
    extern const ArrayDef nikonSi2Def[] = {
Packit Service 21b5d1
        {    0, ttUndefined,    4 }, // Version
Packit Service 21b5d1
        {  582, ttUnsignedLong, 1 }, // ShutterCount
Packit Service 21b5d1
        {  738, ttUnsignedByte, 1 },
Packit Service 21b5d1
        { 1112, ttUnsignedByte, 1 }  // The array contains 1113 bytes
Packit Service 21b5d1
    };
Packit Service 21b5d1
    //! Nikon Shot Info binary array - configuration 3 (D300a)
Packit Service 21b5d1
    extern const ArrayCfg nikonSi3Cfg = {
Packit Service 21b5d1
        nikonSi3Id,       // Group for the elements
Packit Service 21b5d1
        bigEndian,        // Use byte order from parent
Packit Service 21b5d1
        ttUndefined,      // Type for array entry
Packit Service 21b5d1
        nikonCrypt,       // Encryption function
Packit Service 21b5d1
        false,            // No size element
Packit Service 21b5d1
        true,             // Write all tags
Packit Service 21b5d1
        true,             // Concatenate gaps
Packit Service 21b5d1
        { 0, ttUnsignedByte,  1 }
Packit Service 21b5d1
    };
Packit Service 21b5d1
    //! Nikon Shot Info binary array - definition 3 (D300a)
Packit Service 21b5d1
    extern const ArrayDef nikonSi3Def[] = {
Packit Service 21b5d1
        {    0, ttUndefined,     4 }, // Version
Packit Service 21b5d1
        {  604, ttUnsignedByte,  1 }, // ISO
Packit Service 21b5d1
        {  633, ttUnsignedLong,  1 }, // ShutterCount
Packit Service 21b5d1
        {  721, ttUnsignedShort, 1 }, // AFFineTuneAdj
Packit Service 21b5d1
        {  814, ttUndefined,  4478 }  // The array contains 5291 bytes
Packit Service 21b5d1
    };
Packit Service 21b5d1
    //! Nikon Shot Info binary array - configuration 4 (D300b)
Packit Service 21b5d1
    extern const ArrayCfg nikonSi4Cfg = {
Packit Service 21b5d1
        nikonSi4Id,       // Group for the elements
Packit Service 21b5d1
        bigEndian,        // Use byte order from parent
Packit Service 21b5d1
        ttUndefined,      // Type for array entry
Packit Service 21b5d1
        nikonCrypt,       // Encryption function
Packit Service 21b5d1
        false,            // No size element
Packit Service 21b5d1
        true,             // Write all tags
Packit Service 21b5d1
        true,             // Concatenate gaps
Packit Service 21b5d1
        { 0, ttUnsignedByte,  1 }
Packit Service 21b5d1
    };
Packit Service 21b5d1
    //! Nikon Shot Info binary array - definition 4 (D300b)
Packit Service 21b5d1
    extern const ArrayDef nikonSi4Def[] = {
Packit Service 21b5d1
        {    0, ttUndefined,     4 }, // Version
Packit Service 21b5d1
        {  644, ttUnsignedLong,  1 }, // ShutterCount
Packit Service 21b5d1
        {  732, ttUnsignedShort, 1 }, // AFFineTuneAdj
Packit Service 21b5d1
        {  826, ttUndefined,  4478 }  // The array contains 5303 bytes
Packit Service 21b5d1
    };
Packit Service 21b5d1
    //! Nikon Shot Info binary array - configuration 5 (ver 02.xx)
Packit Service 21b5d1
    extern const ArrayCfg nikonSi5Cfg = {
Packit Service 21b5d1
        nikonSi5Id,       // Group for the elements
Packit Service 21b5d1
        bigEndian,        // Use byte order from parent
Packit Service 21b5d1
        ttUndefined,      // Type for array entry
Packit Service 21b5d1
        nikonCrypt,       // Encryption function
Packit Service 21b5d1
        false,            // No size element
Packit Service 21b5d1
        false,            // Write all tags (don't know how many)
Packit Service 21b5d1
        true,             // Concatenate gaps
Packit Service 21b5d1
        { 0, ttUnsignedByte,  1 }
Packit Service 21b5d1
    };
Packit Service 21b5d1
    //! Nikon Shot Info binary array - definition 5 (ver 01.xx and ver 02.xx)
Packit Service 21b5d1
    extern const ArrayDef nikonSi5Def[] = {
Packit Service 21b5d1
        {    0, ttUndefined,     4 }, // Version
Packit Service 21b5d1
        {  106, ttUnsignedLong,  1 }, // ShutterCount1
Packit Service 21b5d1
        {  110, ttUnsignedLong,  1 }, // DeletedImageCount
Packit Service 21b5d1
        {  117, ttUnsignedByte,  1 }, // VibrationReduction
Packit Service 21b5d1
        {  130, ttUnsignedByte,  1 }, // VibrationReduction1
Packit Service 21b5d1
        {  343, ttUndefined,     2 }, // ShutterCount
Packit Service 21b5d1
        {  430, ttUnsignedByte,  1 }, // VibrationReduction2
Packit Service 21b5d1
        {  598, ttUnsignedByte,  1 }, // ISO
Packit Service 21b5d1
        {  630, ttUnsignedLong,  1 }  // ShutterCount
Packit Service 21b5d1
    };
Packit Service 21b5d1
    //! Nikon Shot Info binary array - configuration 6 (ver 01.xx)
Packit Service 21b5d1
    extern const ArrayCfg nikonSi6Cfg = {
Packit Service 21b5d1
        nikonSi6Id,       // Group for the elements
Packit Service 21b5d1
        bigEndian,        // Use byte order from parent
Packit Service 21b5d1
        ttUndefined,      // Type for array entry
Packit Service 21b5d1
        notEncrypted,     // Encryption function
Packit Service 21b5d1
        false,            // No size element
Packit Service 21b5d1
        false,            // Write all tags (don't know how many)
Packit Service 21b5d1
        true,             // Concatenate gaps
Packit Service 21b5d1
        { 0, ttUnsignedByte,  1 }
Packit Service 21b5d1
    };
Packit Service 21b5d1
    //! Nikon Lens Data configurations and definitions
Packit Service 21b5d1
    extern const ArraySet nikonSiSet[] = {
Packit Service 21b5d1
        { nikonSi1Cfg, nikonSi1Def, EXV_COUNTOF(nikonSi1Def) },
Packit Service 21b5d1
        { nikonSi2Cfg, nikonSi2Def, EXV_COUNTOF(nikonSi2Def) },
Packit Service 21b5d1
        { nikonSi3Cfg, nikonSi3Def, EXV_COUNTOF(nikonSi3Def) },
Packit Service 21b5d1
        { nikonSi4Cfg, nikonSi4Def, EXV_COUNTOF(nikonSi4Def) },
Packit Service 21b5d1
        { nikonSi5Cfg, nikonSi5Def, EXV_COUNTOF(nikonSi5Def) },
Packit Service 21b5d1
        { nikonSi6Cfg, nikonSi5Def, EXV_COUNTOF(nikonSi5Def) }  // uses nikonSi5Def
Packit Service 21b5d1
    };
Packit Service 21b5d1
Packit Service 21b5d1
    //! Nikon Lens Data binary array - configuration 1
Packit Service 21b5d1
    extern const ArrayCfg nikonLd1Cfg = {
Packit Service 21b5d1
        nikonLd1Id,       // Group for the elements
Packit Service 21b5d1
        invalidByteOrder, // Use byte order from parent
Packit Service 21b5d1
        ttUndefined,      // Type for array entry
Packit Service 21b5d1
        notEncrypted,     // Encryption function
Packit Service 21b5d1
        false,            // No size element
Packit Service 21b5d1
        true,             // Write all tags
Packit Service 21b5d1
        false,            // Concatenate gaps
Packit Service 21b5d1
        { 0, ttUnsignedByte,  1 }
Packit Service 21b5d1
    };
Packit Service 21b5d1
    //! Nikon Lens Data binary array - configuration 2
Packit Service 21b5d1
    extern const ArrayCfg nikonLd2Cfg = {
Packit Service 21b5d1
        nikonLd2Id,       // Group for the elements
Packit Service 21b5d1
        invalidByteOrder, // Use byte order from parent
Packit Service 21b5d1
        ttUndefined,      // Type for array entry
Packit Service 21b5d1
        nikonCrypt,       // Encryption function
Packit Service 21b5d1
        false,            // No size element
Packit Service 21b5d1
        true,             // Write all tags
Packit Service 21b5d1
        false,            // Concatenate gaps
Packit Service 21b5d1
        { 0, ttUnsignedByte,  1 }
Packit Service 21b5d1
    };
Packit Service 21b5d1
    //! Nikon Lens Data binary array - configuration 3
Packit Service 21b5d1
    extern const ArrayCfg nikonLd3Cfg = {
Packit Service 21b5d1
        nikonLd3Id,       // Group for the elements
Packit Service 21b5d1
        invalidByteOrder, // Use byte order from parent
Packit Service 21b5d1
        ttUndefined,      // Type for array entry
Packit Service 21b5d1
        nikonCrypt,       // Encryption function
Packit Service 21b5d1
        false,            // No size element
Packit Service 21b5d1
        true,             // Write all tags
Packit Service 21b5d1
        false,            // Don't concatenate gaps
Packit Service 21b5d1
        { 0, ttUnsignedByte,  1 }
Packit Service 21b5d1
    };
Packit Service 21b5d1
    //! Nikon Lens Data binary array - definition
Packit Service 21b5d1
    extern const ArrayDef nikonLdDef[] = {
Packit Service 21b5d1
        { 0, ttUndefined, 4 } // Version
Packit Service 21b5d1
    };
Packit Service 21b5d1
    //! Nikon Lens Data configurations and definitions
Packit Service 21b5d1
    extern const ArraySet nikonLdSet[] = {
Packit Service 21b5d1
        { nikonLd1Cfg, nikonLdDef, EXV_COUNTOF(nikonLdDef) },
Packit Service 21b5d1
        { nikonLd2Cfg, nikonLdDef, EXV_COUNTOF(nikonLdDef) },
Packit Service 21b5d1
        { nikonLd3Cfg, nikonLdDef, EXV_COUNTOF(nikonLdDef) }
Packit Service 21b5d1
    };
Packit Service 21b5d1
Packit Service 21b5d1
    //! Nikon Color Balance binary array - configuration 1
Packit Service 21b5d1
    extern const ArrayCfg nikonCb1Cfg = {
Packit Service 21b5d1
        nikonCb1Id,       // Group for the elements
Packit Service 21b5d1
        invalidByteOrder, // Use byte order from parent
Packit Service 21b5d1
        ttUndefined,      // Type for array entry
Packit Service 21b5d1
        notEncrypted,     // Encryption function
Packit Service 21b5d1
        false,            // No size element
Packit Service 21b5d1
        false,            // Write all tags
Packit Service 21b5d1
        true,             // Concatenate gaps
Packit Service 21b5d1
        { 0, ttUnsignedShort, 1 }
Packit Service 21b5d1
    };
Packit Service 21b5d1
    //! Nikon Color Balance binary array - configuration 2
Packit Service 21b5d1
    extern const ArrayCfg nikonCb2Cfg = {
Packit Service 21b5d1
        nikonCb2Id,       // Group for the elements
Packit Service 21b5d1
        invalidByteOrder, // Use byte order from parent
Packit Service 21b5d1
        ttUndefined,      // Type for array entry
Packit Service 21b5d1
        nikonCrypt,       // Encryption function
Packit Service 21b5d1
        false,            // No size element
Packit Service 21b5d1
        false,            // Write all tags
Packit Service 21b5d1
        true,             // Concatenate gaps
Packit Service 21b5d1
        { 0, ttUnsignedShort, 1 }
Packit Service 21b5d1
    };
Packit Service 21b5d1
    //! Nikon Color Balance binary array - configuration 2a
Packit Service 21b5d1
    extern const ArrayCfg nikonCb2aCfg = {
Packit Service 21b5d1
        nikonCb2aId,      // Group for the elements
Packit Service 21b5d1
        invalidByteOrder, // Use byte order from parent
Packit Service 21b5d1
        ttUndefined,      // Type for array entry
Packit Service 21b5d1
        nikonCrypt,       // Encryption function
Packit Service 21b5d1
        false,            // No size element
Packit Service 21b5d1
        false,            // Write all tags
Packit Service 21b5d1
        true,             // Concatenate gaps
Packit Service 21b5d1
        { 0, ttUnsignedShort, 1 }
Packit Service 21b5d1
    };
Packit Service 21b5d1
    //! Nikon Color Balance binary array - configuration 2b
Packit Service 21b5d1
    extern const ArrayCfg nikonCb2bCfg = {
Packit Service 21b5d1
        nikonCb2bId,      // Group for the elements
Packit Service 21b5d1
        invalidByteOrder, // Use byte order from parent
Packit Service 21b5d1
        ttUndefined,      // Type for array entry
Packit Service 21b5d1
        nikonCrypt,       // Encryption function
Packit Service 21b5d1
        false,            // No size element
Packit Service 21b5d1
        false,            // Write all tags
Packit Service 21b5d1
        true,             // Concatenate gaps
Packit Service 21b5d1
        { 0, ttUnsignedShort, 1 }
Packit Service 21b5d1
    };
Packit Service 21b5d1
    //! Nikon Color Balance binary array - configuration 3
Packit Service 21b5d1
    extern const ArrayCfg nikonCb3Cfg = {
Packit Service 21b5d1
        nikonCb3Id,       // Group for the elements
Packit Service 21b5d1
        invalidByteOrder, // Use byte order from parent
Packit Service 21b5d1
        ttUndefined,      // Type for array entry
Packit Service 21b5d1
        notEncrypted,     // Encryption function
Packit Service 21b5d1
        false,            // No size element
Packit Service 21b5d1
        false,            // Write all tags
Packit Service 21b5d1
        true,             // Concatenate gaps
Packit Service 21b5d1
        { 0, ttUnsignedShort, 1 }
Packit Service 21b5d1
    };
Packit Service 21b5d1
    //! Nikon Color Balance binary array - configuration 4
Packit Service 21b5d1
    extern const ArrayCfg nikonCb4Cfg = {
Packit Service 21b5d1
        nikonCb4Id,       // Group for the elements
Packit Service 21b5d1
        invalidByteOrder, // Use byte order from parent
Packit Service 21b5d1
        ttUndefined,      // Type for array entry
Packit Service 21b5d1
        nikonCrypt,       // Encryption function
Packit Service 21b5d1
        false,            // No size element
Packit Service 21b5d1
        false,            // Write all tags
Packit Service 21b5d1
        true,             // Concatenate gaps
Packit Service 21b5d1
        { 0, ttUnsignedShort, 1 }
Packit Service 21b5d1
    };
Packit Service 21b5d1
    //! Nikon Color Balance binary array - definition 1 (D100)
Packit Service 21b5d1
    extern const ArrayDef nikonCb1Def[] = {
Packit Service 21b5d1
        {  0, ttUndefined,        4 }, // Version
Packit Service 21b5d1
        { 72, ttUnsignedShort,    4 }  // Color balance levels
Packit Service 21b5d1
    };
Packit Service 21b5d1
    //! Nikon Color Balance binary array - definition 2 (D2H)
Packit Service 21b5d1
    extern const ArrayDef nikonCb2Def[] = {
Packit Service 21b5d1
        {  0, ttUndefined,        4 }, // Version
Packit Service 21b5d1
        { 10, ttUnsignedShort,    4 }  // Color balance levels
Packit Service 21b5d1
    };
Packit Service 21b5d1
    //! Nikon Color Balance binary array - definition 2a (D50)
Packit Service 21b5d1
    extern const ArrayDef nikonCb2aDef[] = {
Packit Service 21b5d1
        {  0, ttUndefined,        4 }, // Version
Packit Service 21b5d1
        { 18, ttUnsignedShort,    4 }  // Color balance levels
Packit Service 21b5d1
    };
Packit Service 21b5d1
    //! Nikon Color Balance binary array - definition 2b (D2X=0204,D2Hs=0206,D200=0207,D40=0208)
Packit Service 21b5d1
    extern const ArrayDef nikonCb2bDef[] = {
Packit Service 21b5d1
        {  0, ttUndefined,        4 }, // Version
Packit Service 21b5d1
        {  4, ttUnsignedShort,  140 }, // Unknown
Packit Service 21b5d1
        {284, ttUnsignedShort,    3 }, // Unknown (encrypted)
Packit Service 21b5d1
        {290, ttUnsignedShort,    4 }  // Color balance levels
Packit Service 21b5d1
    };
Packit Service 21b5d1
    //! Nikon Color Balance binary array - definition 3 (D70)
Packit Service 21b5d1
    extern const ArrayDef nikonCb3Def[] = {
Packit Service 21b5d1
        {  0, ttUndefined,        4 }, // Version
Packit Service 21b5d1
        { 20, ttUnsignedShort,    4 }  // Color balance levels
Packit Service 21b5d1
    };
Packit Service 21b5d1
    //! Nikon Color Balance binary array - definition 4 (D3)
Packit Service 21b5d1
    extern const ArrayDef nikonCb4Def[] = {
Packit Service 21b5d1
        {  0, ttUndefined,        4 }, // Version
Packit Service 21b5d1
        {  4, ttUnsignedShort,  140 }, // Unknown
Packit Service 21b5d1
        {284, ttUnsignedShort,    5 }, // Unknown (encrypted)
Packit Service 21b5d1
        {294, ttUnsignedShort,    4 }  // Color balance levels
Packit Service 21b5d1
    };
Packit Service 21b5d1
    //! Nikon Color Balance configurations and definitions
Packit Service 21b5d1
    extern const ArraySet nikonCbSet[] = {
Packit Service 21b5d1
        { nikonCb1Cfg,  nikonCb1Def,  EXV_COUNTOF(nikonCb1Def)  },
Packit Service 21b5d1
        { nikonCb2Cfg,  nikonCb2Def,  EXV_COUNTOF(nikonCb2Def)  },
Packit Service 21b5d1
        { nikonCb2aCfg, nikonCb2aDef, EXV_COUNTOF(nikonCb2aDef) },
Packit Service 21b5d1
        { nikonCb2bCfg, nikonCb2bDef, EXV_COUNTOF(nikonCb2bDef) },
Packit Service 21b5d1
        { nikonCb3Cfg,  nikonCb3Def,  EXV_COUNTOF(nikonCb3Def)  },
Packit Service 21b5d1
        { nikonCb4Cfg,  nikonCb4Def,  EXV_COUNTOF(nikonCb4Def)  }
Packit Service 21b5d1
    };
Packit Service 21b5d1
Packit Service 21b5d1
    //! Minolta Camera Settings (old) binary array - configuration
Packit Service 21b5d1
    extern const ArrayCfg minoCsoCfg = {
Packit Service 21b5d1
        minoltaCsOldId,   // Group for the elements
Packit Service 21b5d1
        bigEndian,        // Big endian
Packit Service 21b5d1
        ttUndefined,      // Type for array entry and size element
Packit Service 21b5d1
        notEncrypted,     // Not encrypted
Packit Service 21b5d1
        false,            // No size element
Packit Service 21b5d1
        false,            // No fillers
Packit Service 21b5d1
        false,            // Don't concatenate gaps
Packit Service 21b5d1
        { 0, ttUnsignedLong, 1 }
Packit Service 21b5d1
    };
Packit Service 21b5d1
Packit Service 21b5d1
    //! Minolta Camera Settings (new) binary array - configuration
Packit Service 21b5d1
    extern const ArrayCfg minoCsnCfg = {
Packit Service 21b5d1
        minoltaCsNewId,   // Group for the elements
Packit Service 21b5d1
        bigEndian,        // Big endian
Packit Service 21b5d1
        ttUndefined,      // Type for array entry and size element
Packit Service 21b5d1
        notEncrypted,     // Not encrypted
Packit Service 21b5d1
        false,            // No size element
Packit Service 21b5d1
        false,            // No fillers
Packit Service 21b5d1
        false,            // Don't concatenate gaps
Packit Service 21b5d1
        { 0, ttUnsignedLong, 1 }
Packit Service 21b5d1
    };
Packit Service 21b5d1
Packit Service 21b5d1
    //! Minolta 7D Camera Settings binary array - configuration
Packit Service 21b5d1
    extern const ArrayCfg minoCs7Cfg = {
Packit Service 21b5d1
        minoltaCs7DId,    // Group for the elements
Packit Service 21b5d1
        bigEndian,        // Big endian
Packit Service 21b5d1
        ttUndefined,      // Type for array entry and size element
Packit Service 21b5d1
        notEncrypted,     // Not encrypted
Packit Service 21b5d1
        false,            // No size element
Packit Service 21b5d1
        false,            // No fillers
Packit Service 21b5d1
        false,            // Don't concatenate gaps
Packit Service 21b5d1
        { 0, ttUnsignedShort, 1 }
Packit Service 21b5d1
    };
Packit Service 21b5d1
    //! Minolta 7D Camera Settings binary array - definition
Packit Service 21b5d1
    extern const ArrayDef minoCs7Def[] = {
Packit Service 21b5d1
        {  60, ttSignedShort, 1 }, // Exif.MinoltaCs7D.ExposureCompensation
Packit Service 21b5d1
        { 126, ttSignedShort, 1 }  // Exif.MinoltaCs7D.ColorTemperature
Packit Service 21b5d1
    };
Packit Service 21b5d1
Packit Service 21b5d1
    //! Minolta 5D Camera Settings binary array - configuration
Packit Service 21b5d1
    extern const ArrayCfg minoCs5Cfg = {
Packit Service 21b5d1
        minoltaCs5DId,    // Group for the elements
Packit Service 21b5d1
        bigEndian,        // Big endian
Packit Service 21b5d1
        ttUndefined,      // Type for array entry and size element
Packit Service 21b5d1
        notEncrypted,     // Not encrypted
Packit Service 21b5d1
        false,            // No size element
Packit Service 21b5d1
        false,            // No fillers
Packit Service 21b5d1
        false,            // Don't concatenate gaps
Packit Service 21b5d1
        { 0, ttUnsignedShort, 1 }
Packit Service 21b5d1
    };
Packit Service 21b5d1
    //! Minolta 5D Camera Settings binary array - definition
Packit Service 21b5d1
    extern const ArrayDef minoCs5Def[] = {
Packit Service 21b5d1
        { 146, ttSignedShort, 1 } // Exif.MinoltaCs5D.ColorTemperature
Packit Service 21b5d1
    };
Packit Service 21b5d1
Packit Service 21b5d1
    // Todo: Performance of the handling of Sony Camera Settings can be
Packit Service 21b5d1
    //       improved by defining all known array elements in the definitions
Packit Service 21b5d1
    //       sonyCsDef and sonyCs2Def below and enabling the 'concatenate gaps'
Packit Service 21b5d1
    //       setting in all four configurations.
Packit Service 21b5d1
Packit Service 21b5d1
    //! Sony1 Camera Settings binary array - configuration
Packit Service 21b5d1
    extern const ArrayCfg sony1CsCfg = {
Packit Service 21b5d1
        sony1CsId,        // Group for the elements
Packit Service 21b5d1
        bigEndian,        // Big endian
Packit Service 21b5d1
        ttUndefined,      // Type for array entry and size element
Packit Service 21b5d1
        notEncrypted,     // Not encrypted
Packit Service 21b5d1
        false,            // No size element
Packit Service 21b5d1
        false,            // No fillers
Packit Service 21b5d1
        false,            // Don't concatenate gaps
Packit Service 21b5d1
        { 0, ttUnsignedShort, 1 }
Packit Service 21b5d1
    };
Packit Service 21b5d1
    //! Sony1 Camera Settings 2 binary array - configuration
Packit Service 21b5d1
    extern const ArrayCfg sony1Cs2Cfg = {
Packit Service 21b5d1
        sony1Cs2Id,       // Group for the elements
Packit Service 21b5d1
        bigEndian,        // Big endian
Packit Service 21b5d1
        ttUndefined,      // Type for array entry and size element
Packit Service 21b5d1
        notEncrypted,     // Not encrypted
Packit Service 21b5d1
        false,            // No size element
Packit Service 21b5d1
        false,            // No fillers
Packit Service 21b5d1
        false,            // Don't concatenate gaps
Packit Service 21b5d1
        { 0, ttUnsignedShort, 1 }
Packit Service 21b5d1
    };
Packit Service 21b5d1
Packit Service 21b5d1
    extern const ArrayCfg sony2FpCfg = {
Packit Service 21b5d1
        sony2FpId,        // Group for the elements
Packit Service 21b5d1
        bigEndian,        // Big endian
Packit Service 21b5d1
        ttUnsignedByte,   // Type for array entry and size element
Packit Service 21b5d1
        sonyTagDecipher,  // (uint16_t, const byte*, uint32_t, TiffComponent* const);
Packit Service 21b5d1
        false,            // No size element
Packit Service 21b5d1
        false,            // No fillers
Packit Service 21b5d1
        false,            // Don't concatenate gaps
Packit Service 21b5d1
        { 0, ttUnsignedByte, 1 }
Packit Service 21b5d1
    };
Packit Service 21b5d1
    extern const ArrayDef sony2FpDef[] = {
Packit Service 21b5d1
        {  0x4, ttSignedByte  , 1 }, // Exif.Sony2Fp.AmbientTemperature
Packit Service 21b5d1
        { 0x16, ttUnsignedByte, 1 }, // Exif.Sony2Fp.FocusMode
Packit Service 21b5d1
        { 0x17, ttUnsignedByte, 1 }, // Exif.Sony2Fp.AFAreaMode
Packit Service 21b5d1
        { 0x2d, ttUnsignedByte, 1 }  // Exif.Sony2Fp.FocusPosition2
Packit Service 21b5d1
    };
Packit Service 21b5d1
Packit Service 21b5d1
    //! Sony[12] Camera Settings binary array - definition
Packit Service 21b5d1
    extern const ArrayDef sonyCsDef[] = {
Packit Service 21b5d1
        {  12, ttSignedShort,   1 }  // Exif.Sony[12]Cs.WhiteBalanceFineTune
Packit Service 21b5d1
    };
Packit Service 21b5d1
    //! Sony2 Camera Settings binary array - configuration
Packit Service 21b5d1
    extern const ArrayCfg sony2CsCfg = {
Packit Service 21b5d1
        sony2CsId,        // Group for the elements
Packit Service 21b5d1
        bigEndian,        // Big endian
Packit Service 21b5d1
        ttUndefined,      // Type for array entry and size element
Packit Service 21b5d1
        notEncrypted,     // Not encrypted
Packit Service 21b5d1
        false,            // No size element
Packit Service 21b5d1
        false,            // No fillers
Packit Service 21b5d1
        false,            // Don't concatenate gaps
Packit Service 21b5d1
        { 0, ttUnsignedShort, 1 }
Packit Service 21b5d1
    };
Packit Service 21b5d1
    //! Sony2 Camera Settings 2 binary array - configuration
Packit Service 21b5d1
    extern const ArrayCfg sony2Cs2Cfg = {
Packit Service 21b5d1
        sony2Cs2Id,       // Group for the elements
Packit Service 21b5d1
        bigEndian,        // Big endian
Packit Service 21b5d1
        ttUndefined,      // Type for array entry and size element
Packit Service 21b5d1
        notEncrypted,     // Not encrypted
Packit Service 21b5d1
        false,            // No size element
Packit Service 21b5d1
        false,            // No fillers
Packit Service 21b5d1
        false,            // Don't concatenate gaps
Packit Service 21b5d1
        { 0, ttUnsignedShort, 1 }
Packit Service 21b5d1
    };
Packit Service 21b5d1
    //! Sony[12] Camera Settings 2 binary array - definition
Packit Service 21b5d1
    extern const ArrayDef sonyCs2Def[] = {
Packit Service 21b5d1
        {  44, ttUnsignedShort, 1 } // Exif.Sony[12]Cs2.FocusMode
Packit Service 21b5d1
    };
Packit Service 21b5d1
    //! Sony1 Camera Settings configurations and definitions
Packit Service 21b5d1
    extern const ArraySet sony1CsSet[] = {
Packit Service 21b5d1
        { sony1CsCfg,  sonyCsDef,  EXV_COUNTOF(sonyCsDef)  },
Packit Service 21b5d1
        { sony1Cs2Cfg, sonyCs2Def, EXV_COUNTOF(sonyCs2Def) }
Packit Service 21b5d1
    };
Packit Service 21b5d1
    //! Sony2 Camera Settings configurations and definitions
Packit Service 21b5d1
    extern const ArraySet sony2CsSet[] = {
Packit Service 21b5d1
        { sony2CsCfg,  sonyCsDef,  EXV_COUNTOF(sonyCsDef)  },
Packit Service 21b5d1
        { sony2Cs2Cfg, sonyCs2Def, EXV_COUNTOF(sonyCs2Def) }
Packit Service 21b5d1
    };
Packit Service 21b5d1
Packit Service 21b5d1
    //! Sony Minolta Camera Settings (old) binary array - configuration
Packit Service 21b5d1
    extern const ArrayCfg sony1MCsoCfg = {
Packit Service 21b5d1
        sony1MltCsOldId,  // Group for the elements
Packit Service 21b5d1
        bigEndian,        // Big endian
Packit Service 21b5d1
        ttUndefined,      // Type for array entry and size element
Packit Service 21b5d1
        notEncrypted,     // Not encrypted
Packit Service 21b5d1
        false,            // No size element
Packit Service 21b5d1
        false,            // No fillers
Packit Service 21b5d1
        false,            // Don't concatenate gaps
Packit Service 21b5d1
        { 0, ttUnsignedLong, 1 }
Packit Service 21b5d1
    };
Packit Service 21b5d1
Packit Service 21b5d1
    //! Sony Minolta Camera Settings (new) binary array - configuration
Packit Service 21b5d1
    extern const ArrayCfg sony1MCsnCfg = {
Packit Service 21b5d1
        sony1MltCsNewId,  // Group for the elements
Packit Service 21b5d1
        bigEndian,        // Big endian
Packit Service 21b5d1
        ttUndefined,      // Type for array entry and size element
Packit Service 21b5d1
        notEncrypted,     // Not encrypted
Packit Service 21b5d1
        false,            // No size element
Packit Service 21b5d1
        false,            // No fillers
Packit Service 21b5d1
        false,            // Don't concatenate gaps
Packit Service 21b5d1
        { 0, ttUnsignedLong, 1 }
Packit Service 21b5d1
    };
Packit Service 21b5d1
Packit Service 21b5d1
    //! Sony Minolta 7D Camera Settings binary array - configuration
Packit Service 21b5d1
    extern const ArrayCfg sony1MCs7Cfg = {
Packit Service 21b5d1
        sony1MltCs7DId,   // Group for the elements
Packit Service 21b5d1
        bigEndian,        // Big endian
Packit Service 21b5d1
        ttUndefined,      // Type for array entry and size element
Packit Service 21b5d1
        notEncrypted,     // Not encrypted
Packit Service 21b5d1
        false,            // No size element
Packit Service 21b5d1
        false,            // No fillers
Packit Service 21b5d1
        false,            // Don't concatenate gaps
Packit Service 21b5d1
        { 0, ttUnsignedShort, 1 }
Packit Service 21b5d1
    };
Packit Service 21b5d1
Packit Service 21b5d1
    //! Sony Minolta A100 Camera Settings binary array - configuration
Packit Service 21b5d1
    extern const ArrayCfg sony1MCsA100Cfg = {
Packit Service 21b5d1
        sony1MltCsA100Id, // Group for the elements
Packit Service 21b5d1
        bigEndian,        // Big endian
Packit Service 21b5d1
        ttUndefined,      // Type for array entry and size element
Packit Service 21b5d1
        notEncrypted,     // Not encrypted
Packit Service 21b5d1
        false,            // No size element
Packit Service 21b5d1
        false,            // No fillers
Packit Service 21b5d1
        false,            // Don't concatenate gaps
Packit Service 21b5d1
        { 0, ttUnsignedShort, 1 }
Packit Service 21b5d1
    };
Packit Service 21b5d1
    //! Sony Minolta A100 Camera Settings binary array - definition
Packit Service 21b5d1
    extern const ArrayDef sony1MCsA100Def[] = {
Packit Service 21b5d1
        { 112, ttSignedShort, 1 }, // Exif.Sony1MltCsA100.WhiteBalanceFineTune
Packit Service 21b5d1
        { 116, ttSignedShort, 1 }, // Exif.Sony1MltCsA100.ColorCompensationFilter
Packit Service 21b5d1
        { 190, ttSignedShort, 1 }  // Exif.Sony1MltCsA100.ColorCompensationFilter2
Packit Service 21b5d1
    };
Packit Service 21b5d1
Packit Service 21b5d1
    //! Samsung PictureWizard binary array - configuration
Packit Service 21b5d1
    extern const ArrayCfg samsungPwCfg = {
Packit Service 21b5d1
        samsungPwId,      // Group for the elements
Packit Service 21b5d1
        invalidByteOrder, // Use byte order from parent
Packit Service 21b5d1
        ttUnsignedShort,  // Type for array entry
Packit Service 21b5d1
        notEncrypted,     // Not encrypted
Packit Service 21b5d1
        false,            // No size element
Packit Service 21b5d1
        true,             // Write all tags
Packit Service 21b5d1
        true,             // Concatenate gaps
Packit Service 21b5d1
        { 0, ttUnsignedShort, 1 }
Packit Service 21b5d1
    };
Packit Service 21b5d1
    //! Samsung PictureWizard binary array - definition
Packit Service 21b5d1
    extern const ArrayDef samsungPwDef[] = {
Packit Service 21b5d1
        {  0, ttUnsignedShort, 1 }, // Mode
Packit Service 21b5d1
        {  2, ttUnsignedShort, 1 }, // Color
Packit Service 21b5d1
        {  4, ttUnsignedShort, 1 }, // Saturation
Packit Service 21b5d1
        {  6, ttUnsignedShort, 1 }, // Sharpness
Packit Service 21b5d1
        {  8, ttUnsignedShort, 1 }  // Contrast
Packit Service 21b5d1
    };
Packit Service 21b5d1
Packit Service 21b5d1
    /*
Packit Service 21b5d1
      This table lists for each group in a tree, its parent group and tag.
Packit Service 21b5d1
      Root identifies the root of a TIFF tree, as there is a need for multiple
Packit Service 21b5d1
      trees. Groups are the nodes of a TIFF tree. A group is an IFD or any
Packit Service 21b5d1
      other composite component.
Packit Service 21b5d1
Packit Service 21b5d1
      With this table, it is possible, for a given group (and tag) to find a
Packit Service 21b5d1
      path, i.e., a list of groups and tags, from the root to that group (tag).
Packit Service 21b5d1
    */
Packit Service 21b5d1
    const TiffTreeStruct TiffCreator::tiffTreeStruct_[] = {
Packit Service 21b5d1
        // root      group             parent group      parent tag
Packit Service 21b5d1
        //---------  ----------------- ----------------- ----------
Packit Service 21b5d1
        { Tag::root, ifdIdNotSet,      ifdIdNotSet,      Tag::root },
Packit Service 21b5d1
        { Tag::root, ifd0Id,           ifdIdNotSet,      Tag::root },
Packit Service 21b5d1
        { Tag::root, subImage1Id,      ifd0Id,           0x014a    },
Packit Service 21b5d1
        { Tag::root, subImage2Id,      ifd0Id,           0x014a    },
Packit Service 21b5d1
        { Tag::root, subImage3Id,      ifd0Id,           0x014a    },
Packit Service 21b5d1
        { Tag::root, subImage4Id,      ifd0Id,           0x014a    },
Packit Service 21b5d1
        { Tag::root, subImage5Id,      ifd0Id,           0x014a    },
Packit Service 21b5d1
        { Tag::root, subImage6Id,      ifd0Id,           0x014a    },
Packit Service 21b5d1
        { Tag::root, subImage7Id,      ifd0Id,           0x014a    },
Packit Service 21b5d1
        { Tag::root, subImage8Id,      ifd0Id,           0x014a    },
Packit Service 21b5d1
        { Tag::root, subImage9Id,      ifd0Id,           0x014a    },
Packit Service 21b5d1
        { Tag::root, exifId,           ifd0Id,           0x8769    },
Packit Service 21b5d1
        { Tag::root, gpsId,            ifd0Id,           0x8825    },
Packit Service 21b5d1
        { Tag::root, iopId,            exifId,           0xa005    },
Packit Service 21b5d1
        { Tag::root, ifd1Id,           ifd0Id,           Tag::next },
Packit Service 21b5d1
        { Tag::root, ifd2Id,           ifd1Id,           Tag::next },
Packit Service 21b5d1
        { Tag::root, ifd3Id,           ifd2Id,           Tag::next },
Packit Service 21b5d1
        { Tag::root, olympusId,        exifId,           0x927c    },
Packit Service 21b5d1
        { Tag::root, olympus2Id,       exifId,           0x927c    },
Packit Service 21b5d1
        { Tag::root, subThumb1Id,      ifd1Id,           0x014a    },
Packit Service 21b5d1
        { Tag::root, olympusEqId,      olympus2Id,       0x2010    },
Packit Service 21b5d1
        { Tag::root, olympusCsId,      olympus2Id,       0x2020    },
Packit Service 21b5d1
        { Tag::root, olympusRdId,      olympus2Id,       0x2030    },
Packit Service 21b5d1
        { Tag::root, olympusRd2Id,     olympus2Id,       0x2031    },
Packit Service 21b5d1
        { Tag::root, olympusIpId,      olympus2Id,       0x2040    },
Packit Service 21b5d1
        { Tag::root, olympusFiId,      olympus2Id,       0x2050    },
Packit Service 21b5d1
        { Tag::root, olympusFe1Id,     olympus2Id,       0x2100    },
Packit Service 21b5d1
        { Tag::root, olympusFe2Id,     olympus2Id,       0x2200    },
Packit Service 21b5d1
        { Tag::root, olympusFe3Id,     olympus2Id,       0x2300    },
Packit Service 21b5d1
        { Tag::root, olympusFe4Id,     olympus2Id,       0x2400    },
Packit Service 21b5d1
        { Tag::root, olympusFe5Id,     olympus2Id,       0x2500    },
Packit Service 21b5d1
        { Tag::root, olympusFe6Id,     olympus2Id,       0x2600    },
Packit Service 21b5d1
        { Tag::root, olympusFe7Id,     olympus2Id,       0x2700    },
Packit Service 21b5d1
        { Tag::root, olympusFe8Id,     olympus2Id,       0x2800    },
Packit Service 21b5d1
        { Tag::root, olympusFe9Id,     olympus2Id,       0x2900    },
Packit Service 21b5d1
        { Tag::root, olympusRiId,      olympus2Id,       0x3000    },
Packit Service 21b5d1
        { Tag::root, fujiId,           exifId,           0x927c    },
Packit Service 21b5d1
        { Tag::root, canonId,          exifId,           0x927c    },
Packit Service 21b5d1
        { Tag::root, canonCsId,        canonId,          0x0001    },
Packit Service 21b5d1
        { Tag::root, canonSiId,        canonId,          0x0004    },
Packit Service 21b5d1
        { Tag::root, canonPaId,        canonId,          0x0005    },
Packit Service 21b5d1
        { Tag::root, canonCfId,        canonId,          0x000f    },
Packit Service 21b5d1
        { Tag::root, canonPiId,        canonId,          0x0012    },
Packit Service 21b5d1
        { Tag::root, canonTiId,        canonId,          0x0035    },
Packit Service 21b5d1
        { Tag::root, canonFiId,        canonId,          0x0093    },
Packit Service 21b5d1
        { Tag::root, canonPrId,        canonId,          0x00a0    },
Packit Service 21b5d1
        { Tag::root, nikon1Id,         exifId,           0x927c    },
Packit Service 21b5d1
        { Tag::root, nikon2Id,         exifId,           0x927c    },
Packit Service 21b5d1
        { Tag::root, nikon3Id,         exifId,           0x927c    },
Packit Service 21b5d1
        { Tag::root, nikonPvId,        nikon3Id,         0x0011    },
Packit Service 21b5d1
        { Tag::root, nikonVrId,        nikon3Id,         0x001f    },
Packit Service 21b5d1
        { Tag::root, nikonPcId,        nikon3Id,         0x0023    },
Packit Service 21b5d1
        { Tag::root, nikonWtId,        nikon3Id,         0x0024    },
Packit Service 21b5d1
        { Tag::root, nikonIiId,        nikon3Id,         0x0025    },
Packit Service 21b5d1
        { Tag::root, nikonAfId,        nikon3Id,         0x0088    },
Packit Service 21b5d1
        { Tag::root, nikonSi1Id,       nikon3Id,         0x0091    },
Packit Service 21b5d1
        { Tag::root, nikonSi2Id,       nikon3Id,         0x0091    },
Packit Service 21b5d1
        { Tag::root, nikonSi3Id,       nikon3Id,         0x0091    },
Packit Service 21b5d1
        { Tag::root, nikonSi4Id,       nikon3Id,         0x0091    },
Packit Service 21b5d1
        { Tag::root, nikonSi5Id,       nikon3Id,         0x0091    },
Packit Service 21b5d1
        { Tag::root, nikonSi6Id,       nikon3Id,         0x0091    },
Packit Service 21b5d1
        { Tag::root, nikonCb1Id,       nikon3Id,         0x0097    },
Packit Service 21b5d1
        { Tag::root, nikonCb2Id,       nikon3Id,         0x0097    },
Packit Service 21b5d1
        { Tag::root, nikonCb2aId,      nikon3Id,         0x0097    },
Packit Service 21b5d1
        { Tag::root, nikonCb2bId,      nikon3Id,         0x0097    },
Packit Service 21b5d1
        { Tag::root, nikonCb3Id,       nikon3Id,         0x0097    },
Packit Service 21b5d1
        { Tag::root, nikonCb4Id,       nikon3Id,         0x0097    },
Packit Service 21b5d1
        { Tag::root, nikonLd1Id,       nikon3Id,         0x0098    },
Packit Service 21b5d1
        { Tag::root, nikonLd2Id,       nikon3Id,         0x0098    },
Packit Service 21b5d1
        { Tag::root, nikonLd3Id,       nikon3Id,         0x0098    },
Packit Service 21b5d1
        { Tag::root, nikonMeId,        nikon3Id,         0x00b0    },
Packit Service 21b5d1
        { Tag::root, nikonAf21Id,      nikon3Id,         0x00b7    },
Packit Service 21b5d1
        { Tag::root, nikonAf22Id,      nikon3Id,         0x00b7    },
Packit Service 21b5d1
        { Tag::root, nikonFiId,        nikon3Id,         0x00b8    },
Packit Service 21b5d1
        { Tag::root, nikonAFTId,       nikon3Id,         0x00b9    },
Packit Service 21b5d1
        { Tag::root, nikonFl1Id,       nikon3Id,         0x00a8    },
Packit Service 21b5d1
        { Tag::root, nikonFl2Id,       nikon3Id,         0x00a8    },
Packit Service 21b5d1
        { Tag::root, nikonFl3Id,       nikon3Id,         0x00a8    },
Packit Service 21b5d1
        { Tag::root, panasonicId,      exifId,           0x927c    },
Packit Service 21b5d1
        { Tag::root, pentaxId,         exifId,           0x927c    },
Packit Service 21b5d1
        { Tag::root, pentaxDngId,      ifd0Id,           0xc634    },
Packit Service 21b5d1
        { Tag::root, samsung2Id,       exifId,           0x927c    },
Packit Service 21b5d1
        { Tag::root, samsungPwId,      samsung2Id,       0x0021    },
Packit Service 21b5d1
        { Tag::root, samsungPvId,      samsung2Id,       0x0035    },
Packit Service 21b5d1
        { Tag::root, sigmaId,          exifId,           0x927c    },
Packit Service 21b5d1
        { Tag::root, sony1Id,          exifId,           0x927c    },
Packit Service 21b5d1
        { Tag::root, sony1CsId,        sony1Id,          0x0114    },
Packit Service 21b5d1
        { Tag::root, sony1Cs2Id,       sony1Id,          0x0114    },
Packit Service 21b5d1
        { Tag::root, sonyMltId,        sony1Id,          0xb028    },
Packit Service 21b5d1
        { Tag::root, sony1MltCsOldId,  sonyMltId,        0x0001    },
Packit Service 21b5d1
        { Tag::root, sony1MltCsNewId,  sonyMltId,        0x0003    },
Packit Service 21b5d1
        { Tag::root, sony1MltCs7DId,   sonyMltId,        0x0004    },
Packit Service 21b5d1
        { Tag::root, sony1MltCsA100Id, sonyMltId,        0x0114    },
Packit Service 21b5d1
        { Tag::root, sony2Id,          exifId,           0x927c    },
Packit Service 21b5d1
        { Tag::root, sony2FpId,        sony2Id,          0x9402    },
Packit Service 21b5d1
        { Tag::root, sony2CsId,        sony2Id,          0x0114    },
Packit Service 21b5d1
        { Tag::root, sony2Cs2Id,       sony2Id,          0x0114    },
Packit Service 21b5d1
        { Tag::root, minoltaId,        exifId,           0x927c    },
Packit Service 21b5d1
        { Tag::root, minoltaCsOldId,   minoltaId,        0x0001    },
Packit Service 21b5d1
        { Tag::root, minoltaCsNewId,   minoltaId,        0x0003    },
Packit Service 21b5d1
        { Tag::root, minoltaCs7DId,    minoltaId,        0x0004    },
Packit Service 21b5d1
        { Tag::root, minoltaCs5DId,    minoltaId,        0x0114    },
Packit Service 21b5d1
        { Tag::root, casioId,          exifId,           0x927c    },
Packit Service 21b5d1
        { Tag::root, casio2Id,         exifId,           0x927c    },
Packit Service 21b5d1
        // ---------------------------------------------------------
Packit Service 21b5d1
        // Panasonic RW2 raw images
Packit Service 21b5d1
        { Tag::pana, ifdIdNotSet,      ifdIdNotSet,      Tag::pana },
Packit Service 21b5d1
        { Tag::pana, panaRawId,        ifdIdNotSet,      Tag::pana },
Packit Service 21b5d1
        { Tag::pana, exifId,           panaRawId,        0x8769    },
Packit Service 21b5d1
        { Tag::pana, gpsId,            panaRawId,        0x8825    }
Packit Service 21b5d1
    };
Packit Service 21b5d1
Packit Service 21b5d1
    /*
Packit Service 21b5d1
      This table describes the layout of each known TIFF group (including
Packit Service 21b5d1
      non-standard structures and IFDs only seen in RAW images).
Packit Service 21b5d1
Packit Service 21b5d1
      The key of the table consists of the first two attributes, (extended) tag
Packit Service 21b5d1
      and group. Tag is the TIFF tag or one of a few extended tags, group
Packit Service 21b5d1
      identifies the IFD or any other composite component.
Packit Service 21b5d1
Packit Service 21b5d1
      Each entry of the table defines for a particular tag and group combination
Packit Service 21b5d1
      the corresponding TIFF component create function.
Packit Service 21b5d1
     */
Packit Service 21b5d1
#define ignoreTiffComponent 0
Packit Service 21b5d1
    const TiffGroupStruct TiffCreator::tiffGroupStruct_[] = {
Packit Service 21b5d1
        // ext. tag  group             create function
Packit Service 21b5d1
        //---------  ----------------- -----------------------------------------
Packit Service 21b5d1
        // Root directory
Packit Service 21b5d1
        { Tag::root, ifdIdNotSet,      newTiffDirectory<ifd0Id>                  },
Packit Service 21b5d1
Packit Service 21b5d1
        // IFD0
Packit Service 21b5d1
        {    0x8769, ifd0Id,           newTiffSubIfd<exifId>                     },
Packit Service 21b5d1
        {    0x8825, ifd0Id,           newTiffSubIfd<gpsId>                      },
Packit Service 21b5d1
        {    0x0111, ifd0Id,           newTiffImageData<0x0117, ifd0Id>          },
Packit Service 21b5d1
        {    0x0117, ifd0Id,           newTiffImageSize<0x0111, ifd0Id>          },
Packit Service 21b5d1
        {    0x0144, ifd0Id,           newTiffImageData<0x0145, ifd0Id>          },
Packit Service 21b5d1
        {    0x0145, ifd0Id,           newTiffImageSize<0x0144, ifd0Id>          },
Packit Service 21b5d1
        {    0x0201, ifd0Id,           newTiffImageData<0x0202, ifd0Id>          },
Packit Service 21b5d1
        {    0x0202, ifd0Id,           newTiffImageSize<0x0201, ifd0Id>          },
Packit Service 21b5d1
        {    0x014a, ifd0Id,           newTiffSubIfd<subImage1Id>                },
Packit Service 21b5d1
        {    0xc634, ifd0Id,           newTiffMnEntry                            },
Packit Service 21b5d1
        { Tag::next, ifd0Id,           newTiffDirectory<ifd1Id>                  },
Packit Service 21b5d1
        {  Tag::all, ifd0Id,           newTiffEntry                              },
Packit Service 21b5d1
Packit Service 21b5d1
        // Subdir subImage1
Packit Service 21b5d1
        {    0x0111, subImage1Id,      newTiffImageData<0x0117, subImage1Id>     },
Packit Service 21b5d1
        {    0x0117, subImage1Id,      newTiffImageSize<0x0111, subImage1Id>     },
Packit Service 21b5d1
        {    0x0144, subImage1Id,      newTiffImageData<0x0145, subImage1Id>     },
Packit Service 21b5d1
        {    0x0145, subImage1Id,      newTiffImageSize<0x0144, subImage1Id>     },
Packit Service 21b5d1
        {    0x0201, subImage1Id,      newTiffImageData<0x0202, subImage1Id>     },
Packit Service 21b5d1
        {    0x0202, subImage1Id,      newTiffImageSize<0x0201, subImage1Id>     },
Packit Service 21b5d1
        { Tag::next, subImage1Id,      ignoreTiffComponent                       },
Packit Service 21b5d1
        {  Tag::all, subImage1Id,      newTiffEntry                              },
Packit Service 21b5d1
Packit Service 21b5d1
        // Subdir subImage2
Packit Service 21b5d1
        {    0x0111, subImage2Id,      newTiffImageData<0x0117, subImage2Id>     },
Packit Service 21b5d1
        {    0x0117, subImage2Id,      newTiffImageSize<0x0111, subImage2Id>     },
Packit Service 21b5d1
        {    0x0144, subImage2Id,      newTiffImageData<0x0145, subImage2Id>     },
Packit Service 21b5d1
        {    0x0145, subImage2Id,      newTiffImageSize<0x0144, subImage2Id>     },
Packit Service 21b5d1
        {    0x0201, subImage2Id,      newTiffImageData<0x0202, subImage2Id>     },
Packit Service 21b5d1
        {    0x0202, subImage2Id,      newTiffImageSize<0x0201, subImage2Id>     },
Packit Service 21b5d1
        { Tag::next, subImage2Id,      ignoreTiffComponent                       },
Packit Service 21b5d1
        {  Tag::all, subImage2Id,      newTiffEntry                              },
Packit Service 21b5d1
Packit Service 21b5d1
        // Subdir subImage3
Packit Service 21b5d1
        {    0x0111, subImage3Id,      newTiffImageData<0x0117, subImage3Id>     },
Packit Service 21b5d1
        {    0x0117, subImage3Id,      newTiffImageSize<0x0111, subImage3Id>     },
Packit Service 21b5d1
        {    0x0144, subImage3Id,      newTiffImageData<0x0145, subImage3Id>     },
Packit Service 21b5d1
        {    0x0145, subImage3Id,      newTiffImageSize<0x0144, subImage3Id>     },
Packit Service 21b5d1
        {    0x0201, subImage3Id,      newTiffImageData<0x0202, subImage3Id>     },
Packit Service 21b5d1
        {    0x0202, subImage3Id,      newTiffImageSize<0x0201, subImage3Id>     },
Packit Service 21b5d1
        { Tag::next, subImage3Id,      ignoreTiffComponent                       },
Packit Service 21b5d1
        {  Tag::all, subImage3Id,      newTiffEntry                              },
Packit Service 21b5d1
Packit Service 21b5d1
        // Subdir subImage4
Packit Service 21b5d1
        {    0x0111, subImage4Id,      newTiffImageData<0x0117, subImage4Id>     },
Packit Service 21b5d1
        {    0x0117, subImage4Id,      newTiffImageSize<0x0111, subImage4Id>     },
Packit Service 21b5d1
        {    0x0144, subImage4Id,      newTiffImageData<0x0145, subImage4Id>     },
Packit Service 21b5d1
        {    0x0145, subImage4Id,      newTiffImageSize<0x0144, subImage4Id>     },
Packit Service 21b5d1
        {    0x0201, subImage4Id,      newTiffImageData<0x0202, subImage4Id>     },
Packit Service 21b5d1
        {    0x0202, subImage4Id,      newTiffImageSize<0x0201, subImage4Id>     },
Packit Service 21b5d1
        { Tag::next, subImage4Id,      ignoreTiffComponent                       },
Packit Service 21b5d1
        {  Tag::all, subImage4Id,      newTiffEntry                              },
Packit Service 21b5d1
Packit Service 21b5d1
        // Subdir subImage5
Packit Service 21b5d1
        {    0x0111, subImage5Id,      newTiffImageData<0x0117, subImage5Id>     },
Packit Service 21b5d1
        {    0x0117, subImage5Id,      newTiffImageSize<0x0111, subImage5Id>     },
Packit Service 21b5d1
        {    0x0144, subImage5Id,      newTiffImageData<0x0145, subImage5Id>     },
Packit Service 21b5d1
        {    0x0145, subImage5Id,      newTiffImageSize<0x0144, subImage5Id>     },
Packit Service 21b5d1
        {    0x0201, subImage5Id,      newTiffImageData<0x0202, subImage5Id>     },
Packit Service 21b5d1
        {    0x0202, subImage5Id,      newTiffImageSize<0x0201, subImage5Id>     },
Packit Service 21b5d1
        { Tag::next, subImage5Id,      ignoreTiffComponent                       },
Packit Service 21b5d1
        {  Tag::all, subImage5Id,      newTiffEntry                              },
Packit Service 21b5d1
Packit Service 21b5d1
        // Subdir subImage6
Packit Service 21b5d1
        {    0x0111, subImage6Id,      newTiffImageData<0x0117, subImage6Id>     },
Packit Service 21b5d1
        {    0x0117, subImage6Id,      newTiffImageSize<0x0111, subImage6Id>     },
Packit Service 21b5d1
        {    0x0144, subImage6Id,      newTiffImageData<0x0145, subImage6Id>     },
Packit Service 21b5d1
        {    0x0145, subImage6Id,      newTiffImageSize<0x0144, subImage6Id>     },
Packit Service 21b5d1
        {    0x0201, subImage6Id,      newTiffImageData<0x0202, subImage6Id>     },
Packit Service 21b5d1
        {    0x0202, subImage6Id,      newTiffImageSize<0x0201, subImage6Id>     },
Packit Service 21b5d1
        { Tag::next, subImage6Id,      ignoreTiffComponent                       },
Packit Service 21b5d1
        {  Tag::all, subImage6Id,      newTiffEntry                              },
Packit Service 21b5d1
Packit Service 21b5d1
        // Subdir subImage7
Packit Service 21b5d1
        {    0x0111, subImage7Id,      newTiffImageData<0x0117, subImage7Id>     },
Packit Service 21b5d1
        {    0x0117, subImage7Id,      newTiffImageSize<0x0111, subImage7Id>     },
Packit Service 21b5d1
        {    0x0144, subImage7Id,      newTiffImageData<0x0145, subImage7Id>     },
Packit Service 21b5d1
        {    0x0145, subImage7Id,      newTiffImageSize<0x0144, subImage7Id>     },
Packit Service 21b5d1
        {    0x0201, subImage7Id,      newTiffImageData<0x0202, subImage7Id>     },
Packit Service 21b5d1
        {    0x0202, subImage7Id,      newTiffImageSize<0x0201, subImage7Id>     },
Packit Service 21b5d1
        { Tag::next, subImage7Id,      ignoreTiffComponent                       },
Packit Service 21b5d1
        {  Tag::all, subImage7Id,      newTiffEntry                              },
Packit Service 21b5d1
Packit Service 21b5d1
        // Subdir subImage8
Packit Service 21b5d1
        {    0x0111, subImage8Id,      newTiffImageData<0x0117, subImage8Id>     },
Packit Service 21b5d1
        {    0x0117, subImage8Id,      newTiffImageSize<0x0111, subImage8Id>     },
Packit Service 21b5d1
        {    0x0144, subImage8Id,      newTiffImageData<0x0145, subImage8Id>     },
Packit Service 21b5d1
        {    0x0145, subImage8Id,      newTiffImageSize<0x0144, subImage8Id>     },
Packit Service 21b5d1
        {    0x0201, subImage8Id,      newTiffImageData<0x0202, subImage8Id>     },
Packit Service 21b5d1
        {    0x0202, subImage8Id,      newTiffImageSize<0x0201, subImage8Id>     },
Packit Service 21b5d1
        { Tag::next, subImage8Id,      ignoreTiffComponent                       },
Packit Service 21b5d1
        {  Tag::all, subImage8Id,      newTiffEntry                              },
Packit Service 21b5d1
Packit Service 21b5d1
        // Subdir subImage9
Packit Service 21b5d1
        {    0x0111, subImage9Id,      newTiffImageData<0x0117, subImage9Id>     },
Packit Service 21b5d1
        {    0x0117, subImage9Id,      newTiffImageSize<0x0111, subImage9Id>     },
Packit Service 21b5d1
        {    0x0144, subImage9Id,      newTiffImageData<0x0145, subImage9Id>     },
Packit Service 21b5d1
        {    0x0145, subImage9Id,      newTiffImageSize<0x0144, subImage9Id>     },
Packit Service 21b5d1
        {    0x0201, subImage9Id,      newTiffImageData<0x0202, subImage9Id>     },
Packit Service 21b5d1
        {    0x0202, subImage9Id,      newTiffImageSize<0x0201, subImage9Id>     },
Packit Service 21b5d1
        { Tag::next, subImage9Id,      ignoreTiffComponent                       },
Packit Service 21b5d1
        {  Tag::all, subImage9Id,      newTiffEntry                              },
Packit Service 21b5d1
Packit Service 21b5d1
        // Exif subdir
Packit Service 21b5d1
        {    0xa005, exifId,           newTiffSubIfd<iopId>                      },
Packit Service 21b5d1
        {    0x927c, exifId,           newTiffMnEntry                            },
Packit Service 21b5d1
        { Tag::next, exifId,           ignoreTiffComponent                       },
Packit Service 21b5d1
        {  Tag::all, exifId,           newTiffEntry                              },
Packit Service 21b5d1
Packit Service 21b5d1
        // GPS subdir
Packit Service 21b5d1
        { Tag::next, gpsId,            ignoreTiffComponent                       },
Packit Service 21b5d1
        {  Tag::all, gpsId,            newTiffEntry                              },
Packit Service 21b5d1
Packit Service 21b5d1
        // IOP subdir
Packit Service 21b5d1
        { Tag::next, iopId,            ignoreTiffComponent                       },
Packit Service 21b5d1
        {  Tag::all, iopId,            newTiffEntry                              },
Packit Service 21b5d1
Packit Service 21b5d1
        // IFD1
Packit Service 21b5d1
        {    0x0111, ifd1Id,           newTiffThumbData<0x0117, ifd1Id>          },
Packit Service 21b5d1
        {    0x0117, ifd1Id,           newTiffThumbSize<0x0111, ifd1Id>          },
Packit Service 21b5d1
        {    0x0144, ifd1Id,           newTiffImageData<0x0145, ifd1Id>          },
Packit Service 21b5d1
        {    0x0145, ifd1Id,           newTiffImageSize<0x0144, ifd1Id>          },
Packit Service 21b5d1
        {    0x014a, ifd1Id,           newTiffSubIfd<subThumb1Id>                },
Packit Service 21b5d1
        {    0x0201, ifd1Id,           newTiffThumbData<0x0202, ifd1Id>          },
Packit Service 21b5d1
        {    0x0202, ifd1Id,           newTiffThumbSize<0x0201, ifd1Id>          },
Packit Service 21b5d1
        { Tag::next, ifd1Id,           newTiffDirectory<ifd2Id>                  },
Packit Service 21b5d1
        {  Tag::all, ifd1Id,           newTiffEntry                              },
Packit Service 21b5d1
Packit Service 21b5d1
        // Subdir subThumb1
Packit Service 21b5d1
        {    0x0111, subThumb1Id,      newTiffImageData<0x0117, subThumb1Id>     },
Packit Service 21b5d1
        {    0x0117, subThumb1Id,      newTiffImageSize<0x0111, subThumb1Id>     },
Packit Service 21b5d1
        {    0x0144, subThumb1Id,      newTiffImageData<0x0145, subThumb1Id>     },
Packit Service 21b5d1
        {    0x0145, subThumb1Id,      newTiffImageSize<0x0144, subThumb1Id>     },
Packit Service 21b5d1
        {    0x0201, subThumb1Id,      newTiffImageData<0x0202, subThumb1Id>     },
Packit Service 21b5d1
        {    0x0202, subThumb1Id,      newTiffImageSize<0x0201, subThumb1Id>     },
Packit Service 21b5d1
        { Tag::next, subThumb1Id,      ignoreTiffComponent                       },
Packit Service 21b5d1
        {  Tag::all, subThumb1Id,      newTiffEntry                              },
Packit Service 21b5d1
Packit Service 21b5d1
        // IFD2 (eg, in Pentax PEF and Canon CR2 files)
Packit Service 21b5d1
        {    0x0111, ifd2Id,           newTiffImageData<0x0117, ifd2Id>          },
Packit Service 21b5d1
        {    0x0117, ifd2Id,           newTiffImageSize<0x0111, ifd2Id>          },
Packit Service 21b5d1
        {    0x0144, ifd1Id,           newTiffImageData<0x0145, ifd2Id>          },
Packit Service 21b5d1
        {    0x0145, ifd1Id,           newTiffImageSize<0x0144, ifd2Id>          },
Packit Service 21b5d1
        {    0x0201, ifd2Id,           newTiffImageData<0x0202, ifd2Id>          },
Packit Service 21b5d1
        {    0x0202, ifd2Id,           newTiffImageSize<0x0201, ifd2Id>          },
Packit Service 21b5d1
        { Tag::next, ifd2Id,           newTiffDirectory<ifd3Id>                  },
Packit Service 21b5d1
        {  Tag::all, ifd2Id,           newTiffEntry                              },
Packit Service 21b5d1
Packit Service 21b5d1
        // IFD3 (eg, in Canon CR2 files)
Packit Service 21b5d1
        {    0x0111, ifd3Id,           newTiffImageData<0x0117, ifd3Id>          },
Packit Service 21b5d1
        {    0x0117, ifd3Id,           newTiffImageSize<0x0111, ifd3Id>          },
Packit Service 21b5d1
        {    0x0144, ifd1Id,           newTiffImageData<0x0145, ifd3Id>          },
Packit Service 21b5d1
        {    0x0145, ifd1Id,           newTiffImageSize<0x0144, ifd3Id>          },
Packit Service 21b5d1
        {    0x0201, ifd3Id,           newTiffImageData<0x0202, ifd3Id>          },
Packit Service 21b5d1
        {    0x0202, ifd3Id,           newTiffImageSize<0x0201, ifd3Id>          },
Packit Service 21b5d1
        { Tag::next, ifd3Id,           ignoreTiffComponent                       },
Packit Service 21b5d1
        {  Tag::all, ifd3Id,           newTiffEntry                              },
Packit Service 21b5d1
Packit Service 21b5d1
        // Olympus makernote - some Olympus cameras use Minolta structures
Packit Service 21b5d1
        // Todo: Adding such tags will not work (maybe result in a Minolta makernote), need separate groups
Packit Service 21b5d1
        {    0x0001, olympusId,        EXV_SIMPLE_BINARY_ARRAY(minoCsoCfg)       },
Packit Service 21b5d1
        {    0x0003, olympusId,        EXV_SIMPLE_BINARY_ARRAY(minoCsnCfg)       },
Packit Service 21b5d1
        { Tag::next, olympusId,        ignoreTiffComponent                       },
Packit Service 21b5d1
        {  Tag::all, olympusId,        newTiffEntry                              },
Packit Service 21b5d1
Packit Service 21b5d1
        // Olympus2 makernote
Packit Service 21b5d1
        {    0x0001, olympus2Id,       EXV_SIMPLE_BINARY_ARRAY(minoCsoCfg)       },
Packit Service 21b5d1
        {    0x0003, olympus2Id,       EXV_SIMPLE_BINARY_ARRAY(minoCsnCfg)       },
Packit Service 21b5d1
        {    0x2010, olympus2Id,       newTiffSubIfd<olympusEqId>                },
Packit Service 21b5d1
        {    0x2020, olympus2Id,       newTiffSubIfd<olympusCsId>                },
Packit Service 21b5d1
        {    0x2030, olympus2Id,       newTiffSubIfd<olympusRdId>                },
Packit Service 21b5d1
        {    0x2031, olympus2Id,       newTiffSubIfd<olympusRd2Id>               },
Packit Service 21b5d1
        {    0x2040, olympus2Id,       newTiffSubIfd<olympusIpId>                },
Packit Service 21b5d1
        {    0x2050, olympus2Id,       newTiffSubIfd<olympusFiId>                },
Packit Service 21b5d1
        {    0x2100, olympus2Id,       newTiffSubIfd<olympusFe1Id>               },
Packit Service 21b5d1
        {    0x2200, olympus2Id,       newTiffSubIfd<olympusFe2Id>               },
Packit Service 21b5d1
        {    0x2300, olympus2Id,       newTiffSubIfd<olympusFe3Id>               },
Packit Service 21b5d1
        {    0x2400, olympus2Id,       newTiffSubIfd<olympusFe4Id>               },
Packit Service 21b5d1
        {    0x2500, olympus2Id,       newTiffSubIfd<olympusFe5Id>               },
Packit Service 21b5d1
        {    0x2600, olympus2Id,       newTiffSubIfd<olympusFe6Id>               },
Packit Service 21b5d1
        {    0x2700, olympus2Id,       newTiffSubIfd<olympusFe7Id>               },
Packit Service 21b5d1
        {    0x2800, olympus2Id,       newTiffSubIfd<olympusFe8Id>               },
Packit Service 21b5d1
        {    0x2900, olympus2Id,       newTiffSubIfd<olympusFe9Id>               },
Packit Service 21b5d1
        {    0x3000, olympus2Id,       newTiffSubIfd<olympusRiId>                },
Packit Service 21b5d1
        { Tag::next, olympus2Id,       ignoreTiffComponent                       },
Packit Service 21b5d1
        {  Tag::all, olympus2Id,       newTiffEntry                              },
Packit Service 21b5d1
Packit Service 21b5d1
        // Olympus2 equipment subdir
Packit Service 21b5d1
        {  Tag::all, olympusEqId,        newTiffEntry                            },
Packit Service 21b5d1
Packit Service 21b5d1
        // Olympus2 camera settings subdir
Packit Service 21b5d1
        {    0x0101, olympusCsId,        newTiffImageData<0x0102, olympusCsId>   },
Packit Service 21b5d1
        {    0x0102, olympusCsId,        newTiffImageSize<0x0101, olympusCsId>   },
Packit Service 21b5d1
        {  Tag::all, olympusCsId,        newTiffEntry                            },
Packit Service 21b5d1
Packit Service 21b5d1
        // Olympus2 raw development subdir
Packit Service 21b5d1
        {  Tag::all, olympusRdId,        newTiffEntry                            },
Packit Service 21b5d1
Packit Service 21b5d1
        // Olympus2 raw development 2 subdir
Packit Service 21b5d1
        {  Tag::all, olympusRd2Id,       newTiffEntry                            },
Packit Service 21b5d1
Packit Service 21b5d1
        // Olympus2 image processing subdir
Packit Service 21b5d1
        {  Tag::all, olympusIpId,        newTiffEntry                            },
Packit Service 21b5d1
Packit Service 21b5d1
        // Olympus2 focus info subdir
Packit Service 21b5d1
        {  Tag::all, olympusFiId,        newTiffEntry                            },
Packit Service 21b5d1
Packit Service 21b5d1
        // Olympus2 FE 1 subdir
Packit Service 21b5d1
        {  Tag::all, olympusFe1Id,       newTiffEntry                            },
Packit Service 21b5d1
Packit Service 21b5d1
        // Olympus2 FE 2 subdir
Packit Service 21b5d1
        {  Tag::all, olympusFe2Id,       newTiffEntry                            },
Packit Service 21b5d1
Packit Service 21b5d1
        // Olympus2 FE 3 subdir
Packit Service 21b5d1
        {  Tag::all, olympusFe3Id,       newTiffEntry                            },
Packit Service 21b5d1
Packit Service 21b5d1
        // Olympus2 FE 4 subdir
Packit Service 21b5d1
        {  Tag::all, olympusFe4Id,       newTiffEntry                            },
Packit Service 21b5d1
Packit Service 21b5d1
        // Olympus2 FE 5 subdir
Packit Service 21b5d1
        {  Tag::all, olympusFe5Id,       newTiffEntry                            },
Packit Service 21b5d1
Packit Service 21b5d1
        // Olympus2 FE 6 subdir
Packit Service 21b5d1
        {  Tag::all, olympusFe6Id,       newTiffEntry                            },
Packit Service 21b5d1
Packit Service 21b5d1
        // Olympus2 FE 7 subdir
Packit Service 21b5d1
        {  Tag::all, olympusFe7Id,       newTiffEntry                            },
Packit Service 21b5d1
Packit Service 21b5d1
        // Olympus2 FE 8 subdir
Packit Service 21b5d1
        {  Tag::all, olympusFe8Id,       newTiffEntry                            },
Packit Service 21b5d1
Packit Service 21b5d1
        // Olympus2 FE 9 subdir
Packit Service 21b5d1
        {  Tag::all, olympusFe9Id,       newTiffEntry                            },
Packit Service 21b5d1
Packit Service 21b5d1
        // Olympus2 Raw Info subdir
Packit Service 21b5d1
        {  Tag::all, olympusRiId,        newTiffEntry                            },
Packit Service 21b5d1
Packit Service 21b5d1
        // Fujifilm makernote
Packit Service 21b5d1
        { Tag::next, fujiId,           ignoreTiffComponent                       },
Packit Service 21b5d1
        {  Tag::all, fujiId,           newTiffEntry                              },
Packit Service 21b5d1
Packit Service 21b5d1
        // Canon makernote
Packit Service 21b5d1
        {    0x0001, canonId,          EXV_BINARY_ARRAY(canonCsCfg, canonCsDef)  },
Packit Service 21b5d1
        {    0x0004, canonId,          EXV_SIMPLE_BINARY_ARRAY(canonSiCfg)       },
Packit Service 21b5d1
        {    0x0005, canonId,          EXV_SIMPLE_BINARY_ARRAY(canonPaCfg)       },
Packit Service 21b5d1
        {    0x000f, canonId,          EXV_SIMPLE_BINARY_ARRAY(canonCfCfg)       },
Packit Service 21b5d1
        {    0x0012, canonId,          EXV_SIMPLE_BINARY_ARRAY(canonPiCfg)       },
Packit Service 21b5d1
        {    0x0035, canonId,          EXV_SIMPLE_BINARY_ARRAY(canonTiCfg)       },
Packit Service 21b5d1
        {    0x0093, canonId,          EXV_BINARY_ARRAY(canonFiCfg, canonFiDef)  },
Packit Service 21b5d1
        {    0x00a0, canonId,          EXV_SIMPLE_BINARY_ARRAY(canonPrCfg)  },
Packit Service 21b5d1
        { Tag::next, canonId,          ignoreTiffComponent                       },
Packit Service 21b5d1
        {  Tag::all, canonId,          newTiffEntry                              },
Packit Service 21b5d1
Packit Service 21b5d1
        // Canon makernote composite tags
Packit Service 21b5d1
        {  Tag::all, canonCsId,        newTiffBinaryElement                      },
Packit Service 21b5d1
        {  Tag::all, canonSiId,        newTiffBinaryElement                      },
Packit Service 21b5d1
        {  Tag::all, canonPaId,        newTiffBinaryElement                      },
Packit Service 21b5d1
        {  Tag::all, canonCfId,        newTiffBinaryElement                      },
Packit Service 21b5d1
        {  Tag::all, canonPiId,        newTiffBinaryElement                      },
Packit Service 21b5d1
        {  Tag::all, canonTiId,        newTiffBinaryElement                      },
Packit Service 21b5d1
        {  Tag::all, canonFiId,        newTiffBinaryElement                      },
Packit Service 21b5d1
        {  Tag::all, canonPrId,        newTiffBinaryElement                      },
Packit Service 21b5d1
Packit Service 21b5d1
        // Nikon1 makernote
Packit Service 21b5d1
        { Tag::next, nikon1Id,         ignoreTiffComponent                       },
Packit Service 21b5d1
        {  Tag::all, nikon1Id,         newTiffEntry                              },
Packit Service 21b5d1
Packit Service 21b5d1
        // Nikon2 makernote
Packit Service 21b5d1
        { Tag::next, nikon2Id,         ignoreTiffComponent                       },
Packit Service 21b5d1
        {  Tag::all, nikon2Id,         newTiffEntry                              },
Packit Service 21b5d1
Packit Service 21b5d1
        // Nikon3 makernote
Packit Service 21b5d1
        { Tag::next, nikon3Id,         ignoreTiffComponent                       },
Packit Service 21b5d1
        {    0x0011, nikon3Id,         newTiffSubIfd<nikonPvId>                  },
Packit Service 21b5d1
        {    0x001f, nikon3Id,         EXV_BINARY_ARRAY(nikonVrCfg, nikonVrDef)  },
Packit Service 21b5d1
        {    0x0023, nikon3Id,         EXV_BINARY_ARRAY(nikonPcCfg, nikonPcDef)  },
Packit Service 21b5d1
        {    0x0024, nikon3Id,         EXV_BINARY_ARRAY(nikonWtCfg, nikonWtDef)  },
Packit Service 21b5d1
        {    0x0025, nikon3Id,         EXV_BINARY_ARRAY(nikonIiCfg, nikonIiDef)  },
Packit Service 21b5d1
        {    0x0088, nikon3Id,         EXV_BINARY_ARRAY(nikonAfCfg, nikonAfDef)  },
Packit Service 21b5d1
        {    0x0091, nikon3Id,         EXV_COMPLEX_BINARY_ARRAY(nikonSiSet, nikonSelector) },
Packit Service 21b5d1
        {    0x0097, nikon3Id,         EXV_COMPLEX_BINARY_ARRAY(nikonCbSet, nikonSelector) },
Packit Service 21b5d1
        {    0x0098, nikon3Id,         EXV_COMPLEX_BINARY_ARRAY(nikonLdSet, nikonSelector) },
Packit Service 21b5d1
        {    0x00a8, nikon3Id,         EXV_COMPLEX_BINARY_ARRAY(nikonFlSet, nikonSelector) },
Packit Service 21b5d1
        {    0x00b0, nikon3Id,         EXV_BINARY_ARRAY(nikonMeCfg, nikonMeDef)  },
Packit Service 21b5d1
        {    0x00b7, nikon3Id,         EXV_COMPLEX_BINARY_ARRAY(nikonAf2Set, nikonAf2Selector) },
Packit Service 21b5d1
        {    0x00b8, nikon3Id,         EXV_BINARY_ARRAY(nikonFiCfg, nikonFiDef)  },
Packit Service 21b5d1
        {    0x00b9, nikon3Id,         EXV_BINARY_ARRAY(nikonAFTCfg, nikonAFTDef)  },
Packit Service 21b5d1
        {  Tag::all, nikon3Id,         newTiffEntry                              },
Packit Service 21b5d1
Packit Service 21b5d1
        // Nikon3 makernote preview subdir
Packit Service 21b5d1
        {    0x0201, nikonPvId,        newTiffThumbData<0x0202, nikonPvId>       },
Packit Service 21b5d1
        {    0x0202, nikonPvId,        newTiffThumbSize<0x0201, nikonPvId>       },
Packit Service 21b5d1
        { Tag::next, nikonPvId,        ignoreTiffComponent                       },
Packit Service 21b5d1
        {  Tag::all, nikonPvId,        newTiffEntry                              },
Packit Service 21b5d1
Packit Service 21b5d1
        // Nikon3 vibration reduction
Packit Service 21b5d1
        {  Tag::all, nikonVrId,        newTiffBinaryElement                      },
Packit Service 21b5d1
Packit Service 21b5d1
        // Nikon3 picture control
Packit Service 21b5d1
        {  Tag::all, nikonPcId,        newTiffBinaryElement                      },
Packit Service 21b5d1
Packit Service 21b5d1
        // Nikon3 world time
Packit Service 21b5d1
        {  Tag::all, nikonWtId,        newTiffBinaryElement                      },
Packit Service 21b5d1
Packit Service 21b5d1
        // Nikon3 ISO info
Packit Service 21b5d1
        {  Tag::all, nikonIiId,        newTiffBinaryElement                      },
Packit Service 21b5d1
Packit Service 21b5d1
        // Nikon3 auto focus
Packit Service 21b5d1
        {  Tag::all, nikonAfId,        newTiffBinaryElement                      },
Packit Service 21b5d1
Packit Service 21b5d1
        // Nikon3 auto focus 2
Packit Service 21b5d1
        {  Tag::all, nikonAf21Id,      newTiffBinaryElement                      },
Packit Service 21b5d1
        {  Tag::all, nikonAf22Id,      newTiffBinaryElement                      },
Packit Service 21b5d1
Packit Service 21b5d1
        // Nikon3 AF Fine Tune
Packit Service 21b5d1
        {  Tag::all, nikonAFTId,       newTiffBinaryElement                      },
Packit Service 21b5d1
Packit Service 21b5d1
        // Nikon3 file info
Packit Service 21b5d1
        {  Tag::all, nikonFiId,        newTiffBinaryElement                      },
Packit Service 21b5d1
Packit Service 21b5d1
        // Nikon3 multi exposure
Packit Service 21b5d1
        {  Tag::all, nikonMeId,        newTiffBinaryElement                      },
Packit Service 21b5d1
Packit Service 21b5d1
        // Nikon3 flash info
Packit Service 21b5d1
        {  Tag::all, nikonFl1Id,       newTiffBinaryElement                      },
Packit Service 21b5d1
        {  Tag::all, nikonFl2Id,       newTiffBinaryElement                      },
Packit Service 21b5d1
        {  Tag::all, nikonFl3Id,       newTiffBinaryElement                      },
Packit Service 21b5d1
Packit Service 21b5d1
        // Nikon3 shot info
Packit Service 21b5d1
        {  Tag::all, nikonSi1Id,       newTiffBinaryElement                      },
Packit Service 21b5d1
        {  Tag::all, nikonSi2Id,       newTiffBinaryElement                      },
Packit Service 21b5d1
        {  Tag::all, nikonSi3Id,       newTiffBinaryElement                      },
Packit Service 21b5d1
        {  Tag::all, nikonSi4Id,       newTiffBinaryElement                      },
Packit Service 21b5d1
        {  Tag::all, nikonSi5Id,       newTiffBinaryElement                      },
Packit Service 21b5d1
        {  Tag::all, nikonSi6Id,       newTiffBinaryElement                      },
Packit Service 21b5d1
Packit Service 21b5d1
        // Nikon3 color balance
Packit Service 21b5d1
        {  Tag::all, nikonCb1Id,       newTiffBinaryElement                      },
Packit Service 21b5d1
        {  Tag::all, nikonCb2Id,       newTiffBinaryElement                      },
Packit Service 21b5d1
        {  Tag::all, nikonCb2aId,      newTiffBinaryElement                      },
Packit Service 21b5d1
        {  Tag::all, nikonCb2bId,      newTiffBinaryElement                      },
Packit Service 21b5d1
        {  Tag::all, nikonCb3Id,       newTiffBinaryElement                      },
Packit Service 21b5d1
        {  Tag::all, nikonCb4Id,       newTiffBinaryElement                      },
Packit Service 21b5d1
Packit Service 21b5d1
        // Nikon3 lens data
Packit Service 21b5d1
        {  Tag::all, nikonLd1Id,       newTiffBinaryElement                      },
Packit Service 21b5d1
        {  Tag::all, nikonLd2Id,       newTiffBinaryElement                      },
Packit Service 21b5d1
        {  Tag::all, nikonLd3Id,       newTiffBinaryElement                      },
Packit Service 21b5d1
Packit Service 21b5d1
        // Panasonic makernote
Packit Service 21b5d1
        { Tag::next, panasonicId,      ignoreTiffComponent                       },
Packit Service 21b5d1
        {  Tag::all, panasonicId,      newTiffEntry                              },
Packit Service 21b5d1
Packit Service 21b5d1
        // Pentax DNG makernote
Packit Service 21b5d1
        {    0x0003, pentaxDngId,      newTiffThumbSize<0x0004, pentaxDngId>     },
Packit Service 21b5d1
        {    0x0004, pentaxDngId,      newTiffThumbData<0x0003, pentaxDngId>     },
Packit Service 21b5d1
        { Tag::next, pentaxDngId,      ignoreTiffComponent                       },
Packit Service 21b5d1
        {  Tag::all, pentaxDngId,      newTiffEntry                              },
Packit Service 21b5d1
Packit Service 21b5d1
        // Pentax makernote
Packit Service 21b5d1
        {    0x0003, pentaxId,         newTiffThumbSize<0x0004, pentaxId>        },
Packit Service 21b5d1
        {    0x0004, pentaxId,         newTiffThumbData<0x0003, pentaxId>        },
Packit Service 21b5d1
        { Tag::next, pentaxId,         ignoreTiffComponent                       },
Packit Service 21b5d1
        {  Tag::all, pentaxId,         newTiffEntry                              },
Packit Service 21b5d1
Packit Service 21b5d1
        // Samsung2 makernote
Packit Service 21b5d1
        {    0x0021, samsung2Id,       EXV_BINARY_ARRAY(samsungPwCfg, samsungPwDef) },
Packit Service 21b5d1
        {    0x0035, samsung2Id,       newTiffSubIfd<samsungPvId>                },
Packit Service 21b5d1
        { Tag::next, samsung2Id,       ignoreTiffComponent                       },
Packit Service 21b5d1
        {  Tag::all, samsung2Id,       newTiffEntry                              },
Packit Service 21b5d1
Packit Service 21b5d1
        // Samsung PictureWizard binary array
Packit Service 21b5d1
        {  Tag::all, samsungPwId,      newTiffBinaryElement                      },
Packit Service 21b5d1
Packit Service 21b5d1
        // Samsung2 makernote preview subdir
Packit Service 21b5d1
        {    0x0201, samsungPvId,      newTiffThumbData<0x0202, samsungPvId>     },
Packit Service 21b5d1
        {    0x0202, samsungPvId,      newTiffThumbSize<0x0201, samsungPvId>     },
Packit Service 21b5d1
        { Tag::next, samsungPvId,      ignoreTiffComponent                       },
Packit Service 21b5d1
        {  Tag::all, samsungPvId,      newTiffEntry                              },
Packit Service 21b5d1
Packit Service 21b5d1
        // Sigma/Foveon makernote
Packit Service 21b5d1
        { Tag::next, sigmaId,          ignoreTiffComponent                       },
Packit Service 21b5d1
        {  Tag::all, sigmaId,          newTiffEntry                              },
Packit Service 21b5d1
Packit Service 21b5d1
        // Sony1 makernote
Packit Service 21b5d1
        {    0x0114, sony1Id,          EXV_COMPLEX_BINARY_ARRAY(sony1CsSet, sonyCsSelector) },
Packit Service 21b5d1
        {    0xb028, sony1Id,          newTiffSubIfd<sonyMltId>                  },
Packit Service 21b5d1
        { Tag::next, sony1Id,          ignoreTiffComponent                       },
Packit Service 21b5d1
        {  Tag::all, sony1Id,          newTiffEntry                              },
Packit Service 21b5d1
Packit Service 21b5d1
        // Sony1 camera settings
Packit Service 21b5d1
        {  Tag::all, sony1CsId,        newTiffBinaryElement                      },
Packit Service 21b5d1
        {  Tag::all, sony1Cs2Id,       newTiffBinaryElement                      },
Packit Service 21b5d1
Packit Service 21b5d1
        // Tag 0x9402 Sony2Fp Focus Position
Packit Service 21b5d1
        {  Tag::all, sony2FpId,        newTiffBinaryElement                      },
Packit Service 21b5d1
        {    0x9402, sony2Id,          EXV_BINARY_ARRAY(sony2FpCfg, sony2FpDef)  },
Packit Service 21b5d1
Packit Service 21b5d1
        // Sony2 makernote
Packit Service 21b5d1
        {    0x0114, sony2Id,          EXV_COMPLEX_BINARY_ARRAY(sony2CsSet, sonyCsSelector) },
Packit Service 21b5d1
        { Tag::next, sony2Id,          ignoreTiffComponent                       },
Packit Service 21b5d1
        {  Tag::all, sony2Id,          newTiffEntry                              },
Packit Service 21b5d1
Packit Service 21b5d1
        // Sony2 camera settings
Packit Service 21b5d1
        {  Tag::all, sony2CsId,        newTiffBinaryElement                      },
Packit Service 21b5d1
        {  Tag::all, sony2Cs2Id,       newTiffBinaryElement                      },
Packit Service 21b5d1
Packit Service 21b5d1
        // Sony1 Minolta makernote
Packit Service 21b5d1
        {    0x0001, sonyMltId,        EXV_SIMPLE_BINARY_ARRAY(sony1MCsoCfg)     },
Packit Service 21b5d1
        {    0x0003, sonyMltId,        EXV_SIMPLE_BINARY_ARRAY(sony1MCsnCfg)     },
Packit Service 21b5d1
        {    0x0004, sonyMltId,        EXV_BINARY_ARRAY(sony1MCs7Cfg, minoCs7Def)}, // minoCs7Def [sic]
Packit Service 21b5d1
        {    0x0088, sonyMltId,        newTiffThumbData<0x0089, sonyMltId>       },
Packit Service 21b5d1
        {    0x0089, sonyMltId,        newTiffThumbSize<0x0088, sonyMltId>       },
Packit Service 21b5d1
        {    0x0114, sonyMltId,        EXV_BINARY_ARRAY(sony1MCsA100Cfg, sony1MCsA100Def)},
Packit Service 21b5d1
        { Tag::next, sonyMltId,        ignoreTiffComponent                       },
Packit Service 21b5d1
        {  Tag::all, sonyMltId,        newTiffEntry                              },
Packit Service 21b5d1
Packit Service 21b5d1
        // Sony1 Minolta makernote composite tags
Packit Service 21b5d1
        {  Tag::all, sony1MltCsOldId,  newTiffBinaryElement                      },
Packit Service 21b5d1
        {  Tag::all, sony1MltCsNewId,  newTiffBinaryElement                      },
Packit Service 21b5d1
        {  Tag::all, sony1MltCs7DId,   newTiffBinaryElement                      },
Packit Service 21b5d1
        {  Tag::all, sony1MltCsA100Id, newTiffBinaryElement                      },
Packit Service 21b5d1
Packit Service 21b5d1
        // Minolta makernote
Packit Service 21b5d1
        {    0x0001, minoltaId,        EXV_SIMPLE_BINARY_ARRAY(minoCsoCfg)       },
Packit Service 21b5d1
        {    0x0003, minoltaId,        EXV_SIMPLE_BINARY_ARRAY(minoCsnCfg)       },
Packit Service 21b5d1
        {    0x0004, minoltaId,        EXV_BINARY_ARRAY(minoCs7Cfg, minoCs7Def)  },
Packit Service 21b5d1
        {    0x0088, minoltaId,        newTiffThumbData<0x0089, minoltaId>       },
Packit Service 21b5d1
        {    0x0089, minoltaId,        newTiffThumbSize<0x0088, minoltaId>       },
Packit Service 21b5d1
        {    0x0114, minoltaId,        EXV_BINARY_ARRAY(minoCs5Cfg, minoCs5Def)  },
Packit Service 21b5d1
        { Tag::next, minoltaId,        ignoreTiffComponent                       },
Packit Service 21b5d1
        {  Tag::all, minoltaId,        newTiffEntry                              },
Packit Service 21b5d1
Packit Service 21b5d1
        // Minolta makernote composite tags
Packit Service 21b5d1
        {  Tag::all, minoltaCsOldId,   newTiffBinaryElement                      },
Packit Service 21b5d1
        {  Tag::all, minoltaCsNewId,   newTiffBinaryElement                      },
Packit Service 21b5d1
        {  Tag::all, minoltaCs7DId,    newTiffBinaryElement                      },
Packit Service 21b5d1
        {  Tag::all, minoltaCs5DId,    newTiffBinaryElement                      },
Packit Service 21b5d1
Packit Service 21b5d1
        // -----------------------------------------------------------------------
Packit Service 21b5d1
        // Root directory of Panasonic RAW images
Packit Service 21b5d1
        { Tag::pana, ifdIdNotSet,      newTiffDirectory<panaRawId>               },
Packit Service 21b5d1
Packit Service 21b5d1
        // IFD0 of Panasonic RAW images
Packit Service 21b5d1
        {    0x8769, panaRawId,        newTiffSubIfd<exifId>                     },
Packit Service 21b5d1
        {    0x8825, panaRawId,        newTiffSubIfd<gpsId>                      },
Packit Service 21b5d1
//        {    0x0111, panaRawId,        newTiffImageData<0x0117, panaRawId>       },
Packit Service 21b5d1
//        {    0x0117, panaRawId,        newTiffImageSize<0x0111, panaRawId>       },
Packit Service 21b5d1
        { Tag::next, panaRawId,        ignoreTiffComponent                       },
Packit Service 21b5d1
        {  Tag::all, panaRawId,        newTiffEntry                              },
Packit Service 21b5d1
Packit Service 21b5d1
        // Casio makernote
Packit Service 21b5d1
        { Tag::next, casioId,          ignoreTiffComponent                       },
Packit Service 21b5d1
        {  Tag::all, casioId,          newTiffEntry                              },
Packit Service 21b5d1
Packit Service 21b5d1
        // Casio2 makernote
Packit Service 21b5d1
        { Tag::next, casio2Id,          ignoreTiffComponent                       },
Packit Service 21b5d1
        {  Tag::all, casio2Id,          newTiffEntry                              },
Packit Service 21b5d1
Packit Service 21b5d1
        // -----------------------------------------------------------------------
Packit Service 21b5d1
        // Tags which are not de/encoded
Packit Service 21b5d1
        { Tag::next, ignoreId,           ignoreTiffComponent                     },
Packit Service 21b5d1
        {  Tag::all, ignoreId,           newTiffEntry                            }
Packit Service 21b5d1
    };
Packit Service 21b5d1
Packit Service 21b5d1
    // TIFF mapping table for special decoding and encoding requirements
Packit Service 21b5d1
    const TiffMappingInfo TiffMapping::tiffMappingInfo_[] = {
Packit Service 21b5d1
        { "*",       Tag::all, ignoreId,  0, 0 }, // Do not decode tags with group == ignoreId
Packit Service 21b5d1
        { "*",         0x02bc, ifd0Id,    &TiffDecoder::decodeXmp,          0 /*done before the tree is traversed*/ },
Packit Service 21b5d1
        { "*",         0x83bb, ifd0Id,    &TiffDecoder::decodeIptc,         0 /*done before the tree is traversed*/ },
Packit Service 21b5d1
        { "*",         0x8649, ifd0Id,    &TiffDecoder::decodeIptc,         0 /*done before the tree is traversed*/ }
Packit Service 21b5d1
    };
Packit Service 21b5d1
Packit Service 21b5d1
    DecoderFct TiffMapping::findDecoder(const std::string& make,
Packit Service 21b5d1
                                              uint32_t     extendedTag,
Packit Service 21b5d1
                                              IfdId        group)
Packit Service 21b5d1
    {
Packit Service 21b5d1
        DecoderFct decoderFct = &TiffDecoder::decodeStdTiffEntry;
Packit Service 21b5d1
        const TiffMappingInfo* td = find(tiffMappingInfo_,
Packit Service 21b5d1
                                         TiffMappingInfo::Key(make, extendedTag, group));
Packit Service 21b5d1
        if (td) {
Packit Service 21b5d1
            // This may set decoderFct to 0, meaning that the tag should not be decoded
Packit Service 21b5d1
            decoderFct = td->decoderFct_;
Packit Service 21b5d1
        }
Packit Service 21b5d1
        return decoderFct;
Packit Service 21b5d1
    }
Packit Service 21b5d1
Packit Service 21b5d1
    EncoderFct TiffMapping::findEncoder(
Packit Service 21b5d1
        const std::string& make,
Packit Service 21b5d1
              uint32_t     extendedTag,
Packit Service 21b5d1
              IfdId        group
Packit Service 21b5d1
    )
Packit Service 21b5d1
    {
Packit Service 21b5d1
        EncoderFct encoderFct = 0;
Packit Service 21b5d1
        const TiffMappingInfo* td = find(tiffMappingInfo_,
Packit Service 21b5d1
                                         TiffMappingInfo::Key(make, extendedTag, group));
Packit Service 21b5d1
        if (td) {
Packit Service 21b5d1
            // Returns 0 if no special encoder function is found
Packit Service 21b5d1
            encoderFct = td->encoderFct_;
Packit Service 21b5d1
        }
Packit Service 21b5d1
        return encoderFct;
Packit Service 21b5d1
    }
Packit Service 21b5d1
Packit Service 21b5d1
    bool TiffTreeStruct::operator==(const TiffTreeStruct::Key& key) const
Packit Service 21b5d1
    {
Packit Service 21b5d1
        return key.r_ == root_ && key.g_ == group_;
Packit Service 21b5d1
    }
Packit Service 21b5d1
Packit Service 21b5d1
    TiffComponent::AutoPtr TiffCreator::create(uint32_t extendedTag,
Packit Service 21b5d1
                                               IfdId    group)
Packit Service 21b5d1
    {
Packit Service 21b5d1
        TiffComponent::AutoPtr tc(0);
Packit Service 21b5d1
        uint16_t tag = static_cast<uint16_t>(extendedTag & 0xffff);
Packit Service 21b5d1
        const TiffGroupStruct* ts = find(tiffGroupStruct_,
Packit Service 21b5d1
                                         TiffGroupStruct::Key(extendedTag, group));
Packit Service 21b5d1
        if (ts && ts->newTiffCompFct_) {
Packit Service 21b5d1
            tc = ts->newTiffCompFct_(tag, group);
Packit Service 21b5d1
        }
Packit Service 21b5d1
#ifdef EXIV2_DEBUG_MESSAGES
Packit Service 21b5d1
        else {
Packit Service 21b5d1
            if (!ts) {
Packit Service 21b5d1
                std::cerr << "Warning: No TIFF structure entry found for ";
Packit Service 21b5d1
            }
Packit Service 21b5d1
            else {
Packit Service 21b5d1
                std::cerr << "Warning: No TIFF component creator found for ";
Packit Service 21b5d1
            }
Packit Service 21b5d1
            std::cerr << "extended tag 0x" << std::setw(4) << std::setfill('0')
Packit Service 21b5d1
                      << std::hex << std::right << extendedTag
Packit Service 21b5d1
                      << ", group " << groupName(group) << "\n";
Packit Service 21b5d1
        }
Packit Service 21b5d1
#endif
Packit Service 21b5d1
        return tc;
Packit Service 21b5d1
    } // TiffCreator::create
Packit Service 21b5d1
Packit Service 21b5d1
    void TiffCreator::getPath(TiffPath& tiffPath,
Packit Service 21b5d1
                              uint32_t  extendedTag,
Packit Service 21b5d1
                              IfdId     group,
Packit Service 21b5d1
                              uint32_t  root)
Packit Service 21b5d1
    {
Packit Service 21b5d1
        const TiffTreeStruct* ts = 0;
Packit Service 21b5d1
        do {
Packit Service 21b5d1
            tiffPath.push(TiffPathItem(extendedTag, group));
Packit Service 21b5d1
            ts = find(tiffTreeStruct_, TiffTreeStruct::Key(root, group));
Packit Service 21b5d1
            assert(ts != 0);
Packit Service 21b5d1
            extendedTag = ts->parentExtTag_;
Packit Service 21b5d1
            group = ts->parentGroup_;
Packit Service 21b5d1
        } while (!(ts->root_ == root && ts->group_ == ifdIdNotSet));
Packit Service 21b5d1
Packit Service 21b5d1
    } // TiffCreator::getPath
Packit Service 21b5d1
Packit Service 21b5d1
    ByteOrder TiffParserWorker::decode(
Packit Service 21b5d1
              ExifData&          exifData,
Packit Service 21b5d1
              IptcData&          iptcData,
Packit Service 21b5d1
              XmpData&           xmpData,
Packit Service 21b5d1
        const byte*              pData,
Packit Service 21b5d1
              uint32_t           size,
Packit Service 21b5d1
              uint32_t           root,
Packit Service 21b5d1
              FindDecoderFct     findDecoderFct,
Packit Service 21b5d1
              TiffHeaderBase*    pHeader
Packit Service 21b5d1
    )
Packit Service 21b5d1
    {
Packit Service 21b5d1
        // Create standard TIFF header if necessary
Packit Service 21b5d1
        std::auto_ptr<TiffHeaderBase> ph;
Packit Service 21b5d1
        if (!pHeader) {
Packit Service 21b5d1
            ph = std::auto_ptr<TiffHeaderBase>(new TiffHeader);
Packit Service 21b5d1
            pHeader = ph.get();
Packit Service 21b5d1
        }
Packit Service 21b5d1
        TiffComponent::AutoPtr rootDir = parse(pData, size, root, pHeader);
Packit Service 21b5d1
        if (0 != rootDir.get()) {
Packit Service 21b5d1
            TiffDecoder decoder(exifData,
Packit Service 21b5d1
                                iptcData,
Packit Service 21b5d1
                                xmpData,
Packit Service 21b5d1
                                rootDir.get(),
Packit Service 21b5d1
                                findDecoderFct);
Packit Service 21b5d1
            rootDir->accept(decoder);
Packit Service 21b5d1
        }
Packit Service 21b5d1
        return pHeader->byteOrder();
Packit Service 21b5d1
Packit Service 21b5d1
    } // TiffParserWorker::decode
Packit Service 21b5d1
Packit Service 21b5d1
    WriteMethod TiffParserWorker::encode(
Packit Service 21b5d1
              BasicIo&           io,
Packit Service 21b5d1
        const byte*              pData,
Packit Service 21b5d1
              uint32_t           size,
Packit Service 21b5d1
        const ExifData&          exifData,
Packit Service 21b5d1
        const IptcData&          iptcData,
Packit Service 21b5d1
        const XmpData&           xmpData,
Packit Service 21b5d1
              uint32_t           root,
Packit Service 21b5d1
              FindEncoderFct     findEncoderFct,
Packit Service 21b5d1
              TiffHeaderBase*    pHeader,
Packit Service 21b5d1
              OffsetWriter*      pOffsetWriter
Packit Service 21b5d1
    )
Packit Service 21b5d1
    {
Packit Service 21b5d1
        /*
Packit Service 21b5d1
           1) parse the binary image, if one is provided, and
Packit Service 21b5d1
           2) attempt updating the parsed tree in-place ("non-intrusive writing")
Packit Service 21b5d1
           3) else, create a new tree and write a new TIFF structure ("intrusive
Packit Service 21b5d1
              writing"). If there is a parsed tree, it is only used to access the
Packit Service 21b5d1
              image data in this case.
Packit Service 21b5d1
         */
Packit Service 21b5d1
        assert(pHeader);
Packit Service 21b5d1
        assert(pHeader->byteOrder() != invalidByteOrder);
Packit Service 21b5d1
        WriteMethod writeMethod = wmIntrusive;
Packit Service 21b5d1
        TiffComponent::AutoPtr parsedTree = parse(pData, size, root, pHeader);
Packit Service 21b5d1
        PrimaryGroups primaryGroups;
Packit Service 21b5d1
        findPrimaryGroups(primaryGroups, parsedTree.get());
Packit Service 21b5d1
        if (0 != parsedTree.get()) {
Packit Service 21b5d1
            // Attempt to update existing TIFF components based on metadata entries
Packit Service 21b5d1
            TiffEncoder encoder(exifData,
Packit Service 21b5d1
                                iptcData,
Packit Service 21b5d1
                                xmpData,
Packit Service 21b5d1
                                parsedTree.get(),
Packit Service 21b5d1
                                false,
Packit Service 21b5d1
                                &primaryGroups,
Packit Service 21b5d1
                                pHeader,
Packit Service 21b5d1
                                findEncoderFct);
Packit Service 21b5d1
            parsedTree->accept(encoder);
Packit Service 21b5d1
            if (!encoder.dirty()) writeMethod = wmNonIntrusive;
Packit Service 21b5d1
        }
Packit Service 21b5d1
        if (writeMethod == wmIntrusive) {
Packit Service 21b5d1
            TiffComponent::AutoPtr createdTree = TiffCreator::create(root, ifdIdNotSet);
Packit Service 21b5d1
            if (0 != parsedTree.get()) {
Packit Service 21b5d1
                // Copy image tags from the original image to the composite
Packit Service 21b5d1
                TiffCopier copier(createdTree.get(), root, pHeader, &primaryGroups);
Packit Service 21b5d1
                parsedTree->accept(copier);
Packit Service 21b5d1
            }
Packit Service 21b5d1
            // Add entries from metadata to composite
Packit Service 21b5d1
            TiffEncoder encoder(exifData,
Packit Service 21b5d1
                                iptcData,
Packit Service 21b5d1
                                xmpData,
Packit Service 21b5d1
                                createdTree.get(),
Packit Service 21b5d1
                                parsedTree.get() == 0,
Packit Service 21b5d1
                                &primaryGroups,
Packit Service 21b5d1
                                pHeader,
Packit Service 21b5d1
                                findEncoderFct);
Packit Service 21b5d1
            encoder.add(createdTree.get(), parsedTree.get(), root);
Packit Service 21b5d1
            // Write binary representation from the composite tree
Packit Service 21b5d1
            DataBuf header = pHeader->write();
Packit Service 21b5d1
            BasicIo::AutoPtr tempIo(new MemIo);
Packit Service 21b5d1
            assert(tempIo.get() != 0);
Packit Service 21b5d1
            IoWrapper ioWrapper(*tempIo, header.pData_, header.size_, pOffsetWriter);
Packit Service 21b5d1
            uint32_t imageIdx(uint32_t(-1));
Packit Service 21b5d1
            createdTree->write(ioWrapper,
Packit Service 21b5d1
                               pHeader->byteOrder(),
Packit Service 21b5d1
                               header.size_,
Packit Service 21b5d1
                               uint32_t(-1),
Packit Service 21b5d1
                               uint32_t(-1),
Packit Service 21b5d1
                               imageIdx);
Packit Service 21b5d1
            if (pOffsetWriter) pOffsetWriter->writeOffsets(*tempIo);
Packit Service 21b5d1
            io.transfer(*tempIo); // may throw
Packit Service 21b5d1
#ifndef SUPPRESS_WARNINGS
Packit Service 21b5d1
            EXV_INFO << "Write strategy: Intrusive\n";
Packit Service 21b5d1
#endif
Packit Service 21b5d1
        }
Packit Service 21b5d1
#ifndef SUPPRESS_WARNINGS
Packit Service 21b5d1
        else {
Packit Service 21b5d1
            EXV_INFO << "Write strategy: Non-intrusive\n";
Packit Service 21b5d1
        }
Packit Service 21b5d1
#endif
Packit Service 21b5d1
        return writeMethod;
Packit Service 21b5d1
    } // TiffParserWorker::encode
Packit Service 21b5d1
Packit Service 21b5d1
    TiffComponent::AutoPtr TiffParserWorker::parse(
Packit Service 21b5d1
        const byte*              pData,
Packit Service 21b5d1
              uint32_t           size,
Packit Service 21b5d1
              uint32_t           root,
Packit Service 21b5d1
              TiffHeaderBase*    pHeader
Packit Service 21b5d1
    )
Packit Service 21b5d1
    {
Packit Service 21b5d1
        if (pData == 0 || size == 0) return TiffComponent::AutoPtr(0);
Packit Service 21b5d1
        if (!pHeader->read(pData, size) || pHeader->offset() >= size) {
Packit Service 21b5d1
            throw Error(kerNotAnImage, "TIFF");
Packit Service 21b5d1
        }
Packit Service 21b5d1
        TiffComponent::AutoPtr rootDir = TiffCreator::create(root, ifdIdNotSet);
Packit Service 21b5d1
        if (0 != rootDir.get()) {
Packit Service 21b5d1
            rootDir->setStart(pData + pHeader->offset());
Packit Service 21b5d1
            TiffRwState state(pHeader->byteOrder(), 0);
Packit Service 21b5d1
            TiffReader reader(pData, size, rootDir.get(), state);
Packit Service 21b5d1
            rootDir->accept(reader);
Packit Service 21b5d1
            reader.postProcess();
Packit Service 21b5d1
        }
Packit Service 21b5d1
        return rootDir;
Packit Service 21b5d1
Packit Service 21b5d1
    } // TiffParserWorker::parse
Packit Service 21b5d1
Packit Service 21b5d1
    void TiffParserWorker::findPrimaryGroups(PrimaryGroups& primaryGroups, TiffComponent* pSourceDir)
Packit Service 21b5d1
    {
Packit Service 21b5d1
        if (0 == pSourceDir)
Packit Service 21b5d1
            return;
Packit Service 21b5d1
Packit Service 21b5d1
        const IfdId imageGroups[] = {
Packit Service 21b5d1
            ifd0Id,
Packit Service 21b5d1
            ifd1Id,
Packit Service 21b5d1
            ifd2Id,
Packit Service 21b5d1
            ifd3Id,
Packit Service 21b5d1
            subImage1Id,
Packit Service 21b5d1
            subImage2Id,
Packit Service 21b5d1
            subImage3Id,
Packit Service 21b5d1
            subImage4Id,
Packit Service 21b5d1
            subImage5Id,
Packit Service 21b5d1
            subImage6Id,
Packit Service 21b5d1
            subImage7Id,
Packit Service 21b5d1
            subImage8Id,
Packit Service 21b5d1
            subImage9Id
Packit Service 21b5d1
        };
Packit Service 21b5d1
Packit Service 21b5d1
        for (unsigned int i = 0; i < EXV_COUNTOF(imageGroups); ++i) {
Packit Service 21b5d1
            TiffFinder finder(0x00fe, imageGroups[i]);
Packit Service 21b5d1
            pSourceDir->accept(finder);
Packit Service 21b5d1
            TiffEntryBase* te = dynamic_cast<TiffEntryBase*>(finder.result());
Packit Service 21b5d1
            const Value* pV = te != NULL ? te->pValue() : NULL;
Packit Service 21b5d1
            if (pV && pV->typeId() == unsignedLong && pV->count() == 1 && (pV->toLong() & 1) == 0) {
Packit Service 21b5d1
                primaryGroups.push_back(te->group());
Packit Service 21b5d1
            }
Packit Service 21b5d1
        }
Packit Service 21b5d1
Packit Service 21b5d1
    } // TiffParserWorker::findPrimaryGroups
Packit Service 21b5d1
Packit Service 21b5d1
    TiffHeaderBase::TiffHeaderBase(uint16_t  tag,
Packit Service 21b5d1
                                   uint32_t  size,
Packit Service 21b5d1
                                   ByteOrder byteOrder,
Packit Service 21b5d1
                                   uint32_t  offset)
Packit Service 21b5d1
        : tag_(tag),
Packit Service 21b5d1
          size_(size),
Packit Service 21b5d1
          byteOrder_(byteOrder),
Packit Service 21b5d1
          offset_(offset)
Packit Service 21b5d1
    {
Packit Service 21b5d1
    }
Packit Service 21b5d1
Packit Service 21b5d1
    TiffHeaderBase::~TiffHeaderBase()
Packit Service 21b5d1
    {
Packit Service 21b5d1
    }
Packit Service 21b5d1
Packit Service 21b5d1
    bool TiffHeaderBase::read(const byte* pData, uint32_t size)
Packit Service 21b5d1
    {
Packit Service 21b5d1
        if (!pData || size < 8) return false;
Packit Service 21b5d1
Packit Service 21b5d1
        if (pData[0] == 'I' && pData[0] == pData[1]) {
Packit Service 21b5d1
            byteOrder_ = littleEndian;
Packit Service 21b5d1
        }
Packit Service 21b5d1
        else if (pData[0] == 'M' && pData[0] == pData[1]) {
Packit Service 21b5d1
            byteOrder_ = bigEndian;
Packit Service 21b5d1
        }
Packit Service 21b5d1
        else {
Packit Service 21b5d1
            return false;
Packit Service 21b5d1
        }
Packit Service 21b5d1
        if (tag_ != getUShort(pData + 2, byteOrder_)) return false;
Packit Service 21b5d1
        offset_ = getULong(pData + 4, byteOrder_);
Packit Service 21b5d1
Packit Service 21b5d1
        return true;
Packit Service 21b5d1
    } // TiffHeaderBase::read
Packit Service 21b5d1
Packit Service 21b5d1
    DataBuf TiffHeaderBase::write() const
Packit Service 21b5d1
    {
Packit Service 21b5d1
        DataBuf buf(8);
Packit Service 21b5d1
        switch (byteOrder_) {
Packit Service 21b5d1
        case littleEndian:
Packit Service 21b5d1
            buf.pData_[0] = 'I';
Packit Service 21b5d1
            break;
Packit Service 21b5d1
        case bigEndian:
Packit Service 21b5d1
            buf.pData_[0] = 'M';
Packit Service 21b5d1
            break;
Packit Service 21b5d1
        case invalidByteOrder:
Packit Service 21b5d1
            assert(false);
Packit Service 21b5d1
            break;
Packit Service 21b5d1
        }
Packit Service 21b5d1
        buf.pData_[1]=buf.pData_[0];
Packit Service 21b5d1
        us2Data(buf.pData_ + 2, tag_, byteOrder_);
Packit Service 21b5d1
        ul2Data(buf.pData_ + 4, 0x00000008, byteOrder_);
Packit Service 21b5d1
        return buf;
Packit Service 21b5d1
    }
Packit Service 21b5d1
Packit Service 21b5d1
    void TiffHeaderBase::print(std::ostream& os, const std::string& prefix) const
Packit Service 21b5d1
    {
Packit Service 21b5d1
        std::ios::fmtflags f( os.flags() );
Packit Service 21b5d1
        os << prefix
Packit Service 21b5d1
           << _("TIFF header, offset") << " = 0x"
Packit Service 21b5d1
           << std::setw(8) << std::setfill('0') << std::hex << std::right
Packit Service 21b5d1
           << offset_;
Packit Service 21b5d1
Packit Service 21b5d1
        switch (byteOrder_) {
Packit Service 21b5d1
        case littleEndian:     os << ", " << _("little endian encoded"); break;
Packit Service 21b5d1
        case bigEndian:        os << ", " << _("big endian encoded");    break;
Packit Service 21b5d1
        case invalidByteOrder: break;
Packit Service 21b5d1
        }
Packit Service 21b5d1
        os << "\n";
Packit Service 21b5d1
        os.flags(f);
Packit Service 21b5d1
    } // TiffHeaderBase::print
Packit Service 21b5d1
Packit Service 21b5d1
    ByteOrder TiffHeaderBase::byteOrder() const
Packit Service 21b5d1
    {
Packit Service 21b5d1
        return byteOrder_;
Packit Service 21b5d1
    }
Packit Service 21b5d1
Packit Service 21b5d1
    void TiffHeaderBase::setByteOrder(ByteOrder byteOrder)
Packit Service 21b5d1
    {
Packit Service 21b5d1
        byteOrder_ = byteOrder;
Packit Service 21b5d1
    }
Packit Service 21b5d1
Packit Service 21b5d1
    uint32_t TiffHeaderBase::offset() const
Packit Service 21b5d1
    {
Packit Service 21b5d1
        return offset_;
Packit Service 21b5d1
    }
Packit Service 21b5d1
Packit Service 21b5d1
    void TiffHeaderBase::setOffset(uint32_t offset)
Packit Service 21b5d1
    {
Packit Service 21b5d1
        offset_ = offset;
Packit Service 21b5d1
    }
Packit Service 21b5d1
Packit Service 21b5d1
    uint32_t TiffHeaderBase::size() const
Packit Service 21b5d1
    {
Packit Service 21b5d1
        return size_;
Packit Service 21b5d1
    }
Packit Service 21b5d1
Packit Service 21b5d1
    uint16_t TiffHeaderBase::tag() const
Packit Service 21b5d1
    {
Packit Service 21b5d1
        return tag_;
Packit Service 21b5d1
    }
Packit Service 21b5d1
Packit Service 21b5d1
    bool TiffHeaderBase::isImageTag(      uint16_t       /*tag*/,
Packit Service 21b5d1
                                          IfdId          /*group*/,
Packit Service 21b5d1
                                    const PrimaryGroups* /*primaryGroups*/) const
Packit Service 21b5d1
    {
Packit Service 21b5d1
        return false;
Packit Service 21b5d1
    }
Packit Service 21b5d1
Packit Service 21b5d1
    bool isTiffImageTag(uint16_t tag, IfdId group)
Packit Service 21b5d1
    {
Packit Service 21b5d1
        //! List of TIFF image tags
Packit Service 21b5d1
        static const TiffImgTagStruct tiffImageTags[] = {
Packit Service 21b5d1
            { 0x00fe, ifd0Id }, // Exif.Image.NewSubfileType
Packit Service 21b5d1
            { 0x00ff, ifd0Id }, // Exif.Image.SubfileType
Packit Service 21b5d1
            { 0x0100, ifd0Id }, // Exif.Image.ImageWidth
Packit Service 21b5d1
            { 0x0101, ifd0Id }, // Exif.Image.ImageLength
Packit Service 21b5d1
            { 0x0102, ifd0Id }, // Exif.Image.BitsPerSample
Packit Service 21b5d1
            { 0x0103, ifd0Id }, // Exif.Image.Compression
Packit Service 21b5d1
            { 0x0106, ifd0Id }, // Exif.Image.PhotometricInterpretation
Packit Service 21b5d1
            { 0x010a, ifd0Id }, // Exif.Image.FillOrder
Packit Service 21b5d1
            { 0x0111, ifd0Id }, // Exif.Image.StripOffsets
Packit Service 21b5d1
            { 0x0115, ifd0Id }, // Exif.Image.SamplesPerPixel
Packit Service 21b5d1
            { 0x0116, ifd0Id }, // Exif.Image.RowsPerStrip
Packit Service 21b5d1
            { 0x0117, ifd0Id }, // Exif.Image.StripByteCounts
Packit Service 21b5d1
            { 0x011a, ifd0Id }, // Exif.Image.XResolution
Packit Service 21b5d1
            { 0x011b, ifd0Id }, // Exif.Image.YResolution
Packit Service 21b5d1
            { 0x011c, ifd0Id }, // Exif.Image.PlanarConfiguration
Packit Service 21b5d1
            { 0x0122, ifd0Id }, // Exif.Image.GrayResponseUnit
Packit Service 21b5d1
            { 0x0123, ifd0Id }, // Exif.Image.GrayResponseCurve
Packit Service 21b5d1
            { 0x0124, ifd0Id }, // Exif.Image.T4Options
Packit Service 21b5d1
            { 0x0125, ifd0Id }, // Exif.Image.T6Options
Packit Service 21b5d1
            { 0x0128, ifd0Id }, // Exif.Image.ResolutionUnit
Packit Service 21b5d1
            { 0x0129, ifd0Id }, // Exif.Image.PageNumber
Packit Service 21b5d1
            { 0x012d, ifd0Id }, // Exif.Image.TransferFunction
Packit Service 21b5d1
            { 0x013d, ifd0Id }, // Exif.Image.Predictor
Packit Service 21b5d1
            { 0x013e, ifd0Id }, // Exif.Image.WhitePoint
Packit Service 21b5d1
            { 0x013f, ifd0Id }, // Exif.Image.PrimaryChromaticities
Packit Service 21b5d1
            { 0x0140, ifd0Id }, // Exif.Image.ColorMap
Packit Service 21b5d1
            { 0x0141, ifd0Id }, // Exif.Image.HalftoneHints
Packit Service 21b5d1
            { 0x0142, ifd0Id }, // Exif.Image.TileWidth
Packit Service 21b5d1
            { 0x0143, ifd0Id }, // Exif.Image.TileLength
Packit Service 21b5d1
            { 0x0144, ifd0Id }, // Exif.Image.TileOffsets
Packit Service 21b5d1
            { 0x0145, ifd0Id }, // Exif.Image.TileByteCounts
Packit Service 21b5d1
            { 0x014c, ifd0Id }, // Exif.Image.InkSet
Packit Service 21b5d1
            { 0x014d, ifd0Id }, // Exif.Image.InkNames
Packit Service 21b5d1
            { 0x014e, ifd0Id }, // Exif.Image.NumberOfInks
Packit Service 21b5d1
            { 0x0150, ifd0Id }, // Exif.Image.DotRange
Packit Service 21b5d1
            { 0x0151, ifd0Id }, // Exif.Image.TargetPrinter
Packit Service 21b5d1
            { 0x0152, ifd0Id }, // Exif.Image.ExtraSamples
Packit Service 21b5d1
            { 0x0153, ifd0Id }, // Exif.Image.SampleFormat
Packit Service 21b5d1
            { 0x0154, ifd0Id }, // Exif.Image.SMinSampleValue
Packit Service 21b5d1
            { 0x0155, ifd0Id }, // Exif.Image.SMaxSampleValue
Packit Service 21b5d1
            { 0x0156, ifd0Id }, // Exif.Image.TransferRange
Packit Service 21b5d1
            { 0x0157, ifd0Id }, // Exif.Image.ClipPath
Packit Service 21b5d1
            { 0x0158, ifd0Id }, // Exif.Image.XClipPathUnits
Packit Service 21b5d1
            { 0x0159, ifd0Id }, // Exif.Image.YClipPathUnits
Packit Service 21b5d1
            { 0x015a, ifd0Id }, // Exif.Image.Indexed
Packit Service 21b5d1
            { 0x015b, ifd0Id }, // Exif.Image.JPEGTables
Packit Service 21b5d1
            { 0x0200, ifd0Id }, // Exif.Image.JPEGProc
Packit Service 21b5d1
            { 0x0201, ifd0Id }, // Exif.Image.JPEGInterchangeFormat
Packit Service 21b5d1
            { 0x0202, ifd0Id }, // Exif.Image.JPEGInterchangeFormatLength
Packit Service 21b5d1
            { 0x0203, ifd0Id }, // Exif.Image.JPEGRestartInterval
Packit Service 21b5d1
            { 0x0205, ifd0Id }, // Exif.Image.JPEGLosslessPredictors
Packit Service 21b5d1
            { 0x0206, ifd0Id }, // Exif.Image.JPEGPointTransforms
Packit Service 21b5d1
            { 0x0207, ifd0Id }, // Exif.Image.JPEGQTables
Packit Service 21b5d1
            { 0x0208, ifd0Id }, // Exif.Image.JPEGDCTables
Packit Service 21b5d1
            { 0x0209, ifd0Id }, // Exif.Image.JPEGACTables
Packit Service 21b5d1
            { 0x0211, ifd0Id }, // Exif.Image.YCbCrCoefficients
Packit Service 21b5d1
            { 0x0212, ifd0Id }, // Exif.Image.YCbCrSubSampling
Packit Service 21b5d1
            { 0x0213, ifd0Id }, // Exif.Image.YCbCrPositioning
Packit Service 21b5d1
            { 0x0214, ifd0Id }, // Exif.Image.ReferenceBlackWhite
Packit Service 21b5d1
            { 0x828d, ifd0Id }, // Exif.Image.CFARepeatPatternDim
Packit Service 21b5d1
            { 0x828e, ifd0Id }, // Exif.Image.CFAPattern
Packit Service 21b5d1
        //  { 0x8773, ifd0Id }, // Exif.Image.InterColorProfile
Packit Service 21b5d1
            { 0x8824, ifd0Id }, // Exif.Image.SpectralSensitivity
Packit Service 21b5d1
            { 0x8828, ifd0Id }, // Exif.Image.OECF
Packit Service 21b5d1
            { 0x9102, ifd0Id }, // Exif.Image.CompressedBitsPerPixel
Packit Service 21b5d1
            { 0x9217, ifd0Id }, // Exif.Image.SensingMethod
Packit Service 21b5d1
        };
Packit Service 21b5d1
Packit Service 21b5d1
        // If tag, group is one of the image tags listed above -> bingo!
Packit Service 21b5d1
        if (find(tiffImageTags, TiffImgTagStruct::Key(tag, group))) {
Packit Service 21b5d1
#ifdef EXIV2_DEBUG_MESSAGES
Packit Service 21b5d1
            ExifKey key(tag, groupName(group));
Packit Service 21b5d1
            std::cerr << "Image tag: " << key << " (3)\n";
Packit Service 21b5d1
#endif
Packit Service 21b5d1
            return true;
Packit Service 21b5d1
        }
Packit Service 21b5d1
#ifdef EXIV2_DEBUG_MESSAGES
Packit Service 21b5d1
        std::cerr << "Not an image tag: " << tag << " (4)\n";
Packit Service 21b5d1
#endif
Packit Service 21b5d1
        return false;
Packit Service 21b5d1
    }
Packit Service 21b5d1
Packit Service 21b5d1
    TiffHeader::TiffHeader(ByteOrder byteOrder, uint32_t offset, bool hasImageTags)
Packit Service 21b5d1
        : TiffHeaderBase(42, 8, byteOrder, offset),
Packit Service 21b5d1
          hasImageTags_(hasImageTags)
Packit Service 21b5d1
    {
Packit Service 21b5d1
    }
Packit Service 21b5d1
Packit Service 21b5d1
    TiffHeader::~TiffHeader()
Packit Service 21b5d1
    {
Packit Service 21b5d1
    }
Packit Service 21b5d1
Packit Service 21b5d1
    bool TiffHeader::isImageTag(      uint16_t       tag,
Packit Service 21b5d1
                                      IfdId          group,
Packit Service 21b5d1
                                const PrimaryGroups* pPrimaryGroups) const
Packit Service 21b5d1
    {
Packit Service 21b5d1
        if (!hasImageTags_) {
Packit Service 21b5d1
#ifdef EXIV2_DEBUG_MESSAGES
Packit Service 21b5d1
            std::cerr << "No image tags in this image\n";
Packit Service 21b5d1
#endif
Packit Service 21b5d1
            return false;
Packit Service 21b5d1
        }
Packit Service 21b5d1
#ifdef EXIV2_DEBUG_MESSAGES
Packit Service 21b5d1
        ExifKey key(tag, groupName(group));
Packit Service 21b5d1
#endif
Packit Service 21b5d1
        // If there are primary groups and none matches group, we're done
Packit Service 21b5d1
        if (   pPrimaryGroups != 0
Packit Service 21b5d1
            && !pPrimaryGroups->empty()
Packit Service 21b5d1
            && std::find(pPrimaryGroups->begin(), pPrimaryGroups->end(), group)
Packit Service 21b5d1
               == pPrimaryGroups->end()) {
Packit Service 21b5d1
#ifdef EXIV2_DEBUG_MESSAGES
Packit Service 21b5d1
            std::cerr << "Not an image tag: " << key << " (1)\n";
Packit Service 21b5d1
#endif
Packit Service 21b5d1
            return false;
Packit Service 21b5d1
        }
Packit Service 21b5d1
        // All tags of marked primary groups other than IFD0 are considered
Packit Service 21b5d1
        // image tags. That should take care of NEFs until we know better.
Packit Service 21b5d1
        if (   pPrimaryGroups != 0
Packit Service 21b5d1
            && !pPrimaryGroups->empty()
Packit Service 21b5d1
            && group != ifd0Id) {
Packit Service 21b5d1
#ifdef EXIV2_DEBUG_MESSAGES
Packit Service 21b5d1
            ExifKey key(tag, groupName(group));
Packit Service 21b5d1
            std::cerr << "Image tag: " << key << " (2)\n";
Packit Service 21b5d1
#endif
Packit Service 21b5d1
            return true;
Packit Service 21b5d1
        }
Packit Service 21b5d1
        // Finally, if tag, group is one of the TIFF image tags -> bingo!
Packit Service 21b5d1
        return isTiffImageTag(tag, group);
Packit Service 21b5d1
    } // TiffHeader::isImageTag
Packit Service 21b5d1
Packit Service 21b5d1
    void OffsetWriter::setOrigin(OffsetId id, uint32_t origin, ByteOrder byteOrder)
Packit Service 21b5d1
    {
Packit Service 21b5d1
        offsetList_[id] = OffsetData(origin, byteOrder);
Packit Service 21b5d1
    }
Packit Service 21b5d1
Packit Service 21b5d1
    void OffsetWriter::setTarget(OffsetId id, uint32_t target)
Packit Service 21b5d1
    {
Packit Service 21b5d1
        OffsetList::iterator it = offsetList_.find(id);
Packit Service 21b5d1
        if (it != offsetList_.end()) it->second.target_ = target;
Packit Service 21b5d1
    }
Packit Service 21b5d1
Packit Service 21b5d1
    void OffsetWriter::writeOffsets(BasicIo& io) const
Packit Service 21b5d1
    {
Packit Service 21b5d1
        for (OffsetList::const_iterator it = offsetList_.begin(); it != offsetList_.end(); ++it) {
Packit Service 21b5d1
            io.seek(it->second.origin_, BasicIo::beg);
Packit Service 21b5d1
            byte buf[4] = { 0, 0, 0, 0 };
Packit Service 21b5d1
            l2Data(buf, it->second.target_, it->second.byteOrder_);
Packit Service 21b5d1
            io.write(buf, 4);
Packit Service 21b5d1
        }
Packit Service 21b5d1
    }
Packit Service 21b5d1
Packit Service 21b5d1
}}                                       // namespace Internal, Exiv2