///
/// HybridFrameSpec.hpp
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
/// https://github.com/mrousavy/nitro
/// Copyright © Marc Rousavy @ Margelo
///

#pragma once

#if __has_include(<NitroModules/HybridObject.hpp>)
#include <NitroModules/HybridObject.hpp>
#else
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
#endif

// Forward declaration of `PixelFormat` to properly resolve imports.
namespace margelo::nitro::camera { enum class PixelFormat; }
// Forward declaration of `CameraOrientation` to properly resolve imports.
namespace margelo::nitro::camera { enum class CameraOrientation; }
// Forward declaration of `HybridFramePlaneSpec` to properly resolve imports.
namespace margelo::nitro::camera { class HybridFramePlaneSpec; }
// Forward declaration of `NativeBuffer` to properly resolve imports.
namespace margelo::nitro::camera { struct NativeBuffer; }
// Forward declaration of `Point` to properly resolve imports.
namespace margelo::nitro::camera { struct Point; }

#include "PixelFormat.hpp"
#include "CameraOrientation.hpp"
#include <vector>
#include <optional>
#include <memory>
#include "HybridFramePlaneSpec.hpp"
#include <NitroModules/ArrayBuffer.hpp>
#include "NativeBuffer.hpp"
#include "Point.hpp"

namespace margelo::nitro::camera {

  using namespace margelo::nitro;

  /**
   * An abstract base class for `Frame`
   * Inherit this class to create instances of `HybridFrameSpec` in C++.
   * You must explicitly call `HybridObject`'s constructor yourself, because it is virtual.
   * @example
   * ```cpp
   * class HybridFrame: public HybridFrameSpec {
   * public:
   *   HybridFrame(...): HybridObject(TAG) { ... }
   *   // ...
   * };
   * ```
   */
  class HybridFrameSpec: public virtual HybridObject {
    public:
      // Constructor
      explicit HybridFrameSpec(): HybridObject(TAG) { }

      // Destructor
      ~HybridFrameSpec() override = default;

    public:
      // Properties
      virtual double getTimestamp() = 0;
      virtual bool getIsValid() = 0;
      virtual double getWidth() = 0;
      virtual double getHeight() = 0;
      virtual double getBytesPerRow() = 0;
      virtual PixelFormat getPixelFormat() = 0;
      virtual CameraOrientation getOrientation() = 0;
      virtual bool getIsMirrored() = 0;
      virtual bool getIsPlanar() = 0;
      virtual bool getHasPixelBuffer() = 0;
      virtual bool getHasNativeBuffer() = 0;
      virtual std::optional<std::vector<double>> getCameraIntrinsicMatrix() = 0;

    public:
      // Methods
      virtual std::vector<std::shared_ptr<HybridFramePlaneSpec>> getPlanes() = 0;
      virtual std::shared_ptr<ArrayBuffer> getPixelBuffer() = 0;
      virtual NativeBuffer getNativeBuffer() = 0;
      virtual Point convertCameraPointToFramePoint(const Point& cameraPoint) = 0;
      virtual Point convertFramePointToCameraPoint(const Point& framePoint) = 0;

    protected:
      // Hybrid Setup
      void loadHybridMethods() override;

    protected:
      // Tag for logging
      static constexpr auto TAG = "Frame";
  };

} // namespace margelo::nitro::camera
