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

#include "JHybridFaceDetectorFactorySpec.hpp"

// Forward declaration of `HybridFaceDetectorSpec` to properly resolve imports.
namespace margelo::nitro::camera::facedetector { class HybridFaceDetectorSpec; }
// Forward declaration of `HybridCameraOutputSpec` to properly resolve imports.
namespace margelo::nitro::camera { class HybridCameraOutputSpec; }
// Forward declaration of `FaceDetectorOptions` to properly resolve imports.
namespace margelo::nitro::camera::facedetector { struct FaceDetectorOptions; }
// Forward declaration of `CameraPosition` to properly resolve imports.
namespace margelo::nitro::camera::facedetector { enum class CameraPosition; }
// Forward declaration of `PerformanceMode` to properly resolve imports.
namespace margelo::nitro::camera::facedetector { enum class PerformanceMode; }
// Forward declaration of `FaceDetectorOutputOptions` to properly resolve imports.
namespace margelo::nitro::camera::facedetector { struct FaceDetectorOutputOptions; }
// Forward declaration of `FaceDetectorOutputResolution` to properly resolve imports.
namespace margelo::nitro::camera::facedetector { enum class FaceDetectorOutputResolution; }
// Forward declaration of `HybridFaceSpec` to properly resolve imports.
namespace margelo::nitro::camera::facedetector { class HybridFaceSpec; }

#include <memory>
#include "HybridFaceDetectorSpec.hpp"
#include "JHybridFaceDetectorSpec.hpp"
#include <VisionCamera/HybridCameraOutputSpec.hpp>
#include <VisionCamera/JHybridCameraOutputSpec.hpp>
#include "FaceDetectorOptions.hpp"
#include "JFaceDetectorOptions.hpp"
#include "CameraPosition.hpp"
#include <optional>
#include "JCameraPosition.hpp"
#include "PerformanceMode.hpp"
#include "JPerformanceMode.hpp"
#include "FaceDetectorOutputOptions.hpp"
#include "JFaceDetectorOutputOptions.hpp"
#include "FaceDetectorOutputResolution.hpp"
#include "JFaceDetectorOutputResolution.hpp"
#include "HybridFaceSpec.hpp"
#include <vector>
#include <functional>
#include "JFunc_void_std__vector_std__shared_ptr_HybridFaceSpec__.hpp"
#include <NitroModules/JNICallable.hpp>
#include "JHybridFaceSpec.hpp"
#include <exception>
#include "JFunc_void_std__exception_ptr.hpp"

namespace margelo::nitro::camera::facedetector {

  std::shared_ptr<JHybridFaceDetectorFactorySpec> JHybridFaceDetectorFactorySpec::JavaPart::getJHybridFaceDetectorFactorySpec() {
    auto hybridObject = JHybridObject::JavaPart::getJHybridObject();
    auto castHybridObject = std::dynamic_pointer_cast<JHybridFaceDetectorFactorySpec>(hybridObject);
    if (castHybridObject == nullptr) [[unlikely]] {
      throw std::runtime_error("Failed to downcast JHybridObject to JHybridFaceDetectorFactorySpec!");
    }
    return castHybridObject;
  }

  jni::local_ref<JHybridFaceDetectorFactorySpec::CxxPart::jhybriddata> JHybridFaceDetectorFactorySpec::CxxPart::initHybrid(jni::alias_ref<jhybridobject> jThis) {
    return makeCxxInstance(jThis);
  }

  std::shared_ptr<JHybridObject> JHybridFaceDetectorFactorySpec::CxxPart::createHybridObject(const jni::local_ref<JHybridObject::JavaPart>& javaPart) {
    auto castJavaPart = jni::dynamic_ref_cast<JHybridFaceDetectorFactorySpec::JavaPart>(javaPart);
    if (castJavaPart == nullptr) [[unlikely]] {
      throw std::runtime_error("Failed to cast JHybridObject::JavaPart to JHybridFaceDetectorFactorySpec::JavaPart!");
    }
    return std::make_shared<JHybridFaceDetectorFactorySpec>(castJavaPart);
  }

  void JHybridFaceDetectorFactorySpec::CxxPart::registerNatives() {
    registerHybrid({
      makeNativeMethod("initHybrid", JHybridFaceDetectorFactorySpec::CxxPart::initHybrid),
    });
  }

  // Properties
  

  // Methods
  std::shared_ptr<HybridFaceDetectorSpec> JHybridFaceDetectorFactorySpec::createFaceDetector(const FaceDetectorOptions& options) {
    static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<JHybridFaceDetectorSpec::JavaPart>(jni::alias_ref<JFaceDetectorOptions> /* options */)>("createFaceDetector");
    auto __result = method(_javaPart, JFaceDetectorOptions::fromCpp(options));
    return __result->getJHybridFaceDetectorSpec();
  }
  std::shared_ptr<margelo::nitro::camera::HybridCameraOutputSpec> JHybridFaceDetectorFactorySpec::createFaceDetectorOutput(const FaceDetectorOutputOptions& options) {
    static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<margelo::nitro::camera::JHybridCameraOutputSpec::JavaPart>(jni::alias_ref<JFaceDetectorOutputOptions> /* options */)>("createFaceDetectorOutput");
    auto __result = method(_javaPart, JFaceDetectorOutputOptions::fromCpp(options));
    return __result->getJHybridCameraOutputSpec();
  }

} // namespace margelo::nitro::camera::facedetector
