#------------------------------------------------------------------------------
# File:         pix4d.config
#
# Description:  This config file contains tag definitions needed to be able
#               to write Pix4D XMP-Camera tags
#
# Usage:        exiftool -config pix4d.config -XMP-camera:TAG=VAL ...
#
# Requires:     ExifTool version 7.00 or later
#
# References:   1) https://support.pix4d.com/hc/en-us/articles/360016450032-Specifications-of-xmpcamera-tags
#
# Revisions:    2017/12/08 - P. Harvey Created
#               2020/04/02 - PH Updated to current specification
#------------------------------------------------------------------------------

%Image::ExifTool::UserDefined = (
    'Image::ExifTool::XMP::Main' => {
        Camera => {
            SubDirectory => {
                TagTable => 'Image::ExifTool::UserDefined::Camera',
            },
        },
    },
);

%Image::ExifTool::UserDefined::Camera = (
    GROUPS => { 0 => 'XMP', 1 => 'XMP-Camera', 2 => 'Camera' },
    NAMESPACE => { 'Camera' => 'http://pix4d.com/camera/1.0/'  },
    WRITABLE => 'string',
    Yaw             => { Writable => 'real' },
    Pitch           => { Writable => 'real' },
    Roll            => { Writable => 'real' },
    IMUSampleSize   => { Writable => 'integer' },
    IMUTimeOffset   => { Writable => 'integer' },
    LineReadoutTime => { Writable => 'integer' },
    IMUFrequency    => { Writable => 'real' },
    PrincipalPoint  => { },
    ModelType       => { },
    PerspectiveFocalLength => { Writable => 'real' },
    PerspectiveDistortion  => { },
    IMULinearVelocity => { },
    GPSXYAccuracy   => { Writable => 'real' },
    GPSZAccuracy    => { Writable => 'real' },
    FlightUUID      => { },
    CentralWaveLength => { },
    BandName        => { List => 'Seq' },
    RigName         => { },
    RigCameraIndex  => { Writable => 'integer' },
    BandName        => { List => 'Seq' },
    IMUAngularVelocity => {
        Binary => 1,
        ValueConv => 'Image::ExifTool::XMP::DecodeBase64($val)',
        ValueConvInv => 'Image::ExifTool::XMP::EncodeBase64($val)',
    },
    # added 2020/04/02 (ref 1)
    FisheyeAffineMatrix     => { },
    FisheyeAffineSymmetric  => { },
    FisheyePolynomial       => { },
    RigRelatives            => { },
    PerspectiveFocalLengthUnits => { },
    CaptureUUID             => { },
    CentralWavelength       => { List => 'Seq' },
    WavelengthFWHM          => { List => 'Seq' },
    BlackCurrent            => { List => 'Seq' },
    BandSensitivity         => { List => 'Seq' },
    SunSensor               => { List => 'Seq' },
    SunSensorExposureTime   => { List => 'Seq' },
    SunSensorSensitivity    => { List => 'Seq' },
    InvalidPixel            => { List => 'Seq' },
    VignettingPolynomial    => { List => 'Seq' },
    VignettingCenter        => { List => 'Seq' },
    VignettingPolynomial2DName => { List => 'Seq' },
    VignettingPolynomial2D  => { List => 'Seq' },
    ColorTransform          => { List => 'Seq' },
    IsNormalized            => { },
    Albedo                  => { List => 'Seq' },
    ReflectArea             => { List => 'Seq' },
    CalibrationPicture      => { Writable => 'integer' },
    GyroRate                => { Writable => 'real' },
    IMUPitchAccuracy        => { Writable => 'real' },
    IMURollAccuracy         => { Writable => 'real' },
    IMUYawAccuracy          => { Writable => 'real' },
    NominalCameraDistance   => { Writable => 'real' },
    AboveGroundAltitude     => { Writable => 'real' },
    SunSensorYaw            => { Writable => 'real' },
    SunSensorPitch          => { Writable => 'real' },
    SunSensorRoll           => { Writable => 'real' },
    SunSensorRelativeRotation => { Writable => 'real', List => 'Seq' },
    TransformAlpha          => { List => 'Seq' },
    TransformBeta           => { List => 'Seq' },
    TransformGamma          => { List => 'Seq' },
    SensorBitDepth          => { Writable => 'integer' },
    SensorTemperature       => { Writable => 'real' },
    # (ref https://community.pix4d.com/t/camera-sun-irradiance-and-sun-angle-in-red-text/3290)
    IrradianceRelativeRotation => { },
);

1;  #end
