/*
 * E57Simple - public header of E57 Simple API for reading/writing .e57 file extensions.
 *
 * Copyright (c) 2026 Andy Maloney <asmaloney@gmail.com>
 *
 * Permission is hereby granted, free of charge, to any person or organization
 * obtaining a copy of the software and accompanying documentation covered by
 * this license (the "Software") to use, reproduce, display, distribute,
 * execute, and transmit the Software, and to prepare derivative works of the
 * Software, and to permit third-parties to whom the Software is furnished to
 * do so, all subject to the following:
 *
 * The copyright notices in the Software and this entire statement, including
 * the above license grant, this restriction and the following disclaimer,
 * must be included in all copies of the Software, in whole or in part, and
 * all derivative works of the Software, unless such copies or derivative
 * works are solely in the form of machine-executable object code generated by
 * a source language processor.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
 * SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
 * FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 * DEALINGS IN THE SOFTWARE.
 */

#pragma once

/// @file
/// @brief Data structures for E57 Simple API extensions

#include "E57Format.h"

namespace e57
{
   namespace Extension
   {
      /// @brief Stores optional camera pinhole distortion coefficients and data
      /// Implements e57 extension from http://www.libe57.org/E57_LEICA_Camera_Distortion.txt
      struct E57_DLL PinholeCameraDistortion
      {
         /// Optional - Camera number in a multiple camera app (1 - n).
         int64_t cameraNumber = 0;

         /// Distortion Type like "OpenCV"
         ustring type;

         /// Radial distortion coefficient K1
         double CV_K1 = 0;

         /// Radial distortion coefficient K2
         double CV_K2 = 0;

         /// Radial distortion coefficient K3
         double CV_K3 = 0;

         /// Radial distortion coefficient K4
         double CV_K4 = 0;

         /// Radial distortion coefficient K5
         double CV_K5 = 0;

         /// Radial distortion coefficient K6
         double CV_K6 = 0;

         /// Tangential distortion coefficient - P1
         double CV_P1 = 0;

         /// Tangential distortion coefficient - P2
         double CV_P2 = 0;

         /// Principal point usually at image centerX in pixel units
         double CV_CX = 0;

         /// Principal point usually at image centerY in pixel units
         double CV_CY = 0;

         /// X focal length expressed in pixel units
         double CV_FX = 0;

         /// Y focal length expressed in pixel units
         double CV_FY = 0;

         /// Image X in pixel units
         int32_t CV_HEIGHT = 0;

         /// Image Y in pixel units
         int32_t CV_WIDTH = 0;
      };
   }
}
