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

#include "VisionCameraFaceDetector-Swift-Cxx-Bridge.hpp"

// Include C++ implementation defined types
#include "HybridFaceDetectorFactorySpecSwift.hpp"
#include "HybridFaceDetectorSpecSwift.hpp"
#include "HybridFaceSpecSwift.hpp"
#include "HybridImageFaceDetectorFactorySpecSwift.hpp"
#include "HybridImageFaceDetectorSpecSwift.hpp"
#include "VisionCameraFaceDetector-Swift-Cxx-Umbrella.hpp"
#include <NitroModules/NitroDefines.hpp>
#include <VisionCamera/VisionCamera-Swift-Cxx-Bridge.hpp>

namespace margelo::nitro::camera::facedetector::bridge::swift {

  // pragma MARK: std::shared_ptr<HybridFaceSpec>
  std::shared_ptr<HybridFaceSpec> create_std__shared_ptr_HybridFaceSpec_(void* NON_NULL swiftUnsafePointer) noexcept {
    VisionCameraFaceDetector::HybridFaceSpec_cxx swiftPart = VisionCameraFaceDetector::HybridFaceSpec_cxx::fromUnsafe(swiftUnsafePointer);
    return std::make_shared<margelo::nitro::camera::facedetector::HybridFaceSpecSwift>(swiftPart);
  }
  void* NON_NULL get_std__shared_ptr_HybridFaceSpec_(std__shared_ptr_HybridFaceSpec_ cppType) {
    std::shared_ptr<margelo::nitro::camera::facedetector::HybridFaceSpecSwift> swiftWrapper = std::dynamic_pointer_cast<margelo::nitro::camera::facedetector::HybridFaceSpecSwift>(cppType);
    #ifdef NITRO_DEBUG
    if (swiftWrapper == nullptr) [[unlikely]] {
      throw std::runtime_error("Class \"HybridFaceSpec\" is not implemented in Swift!");
    }
    #endif
    VisionCameraFaceDetector::HybridFaceSpec_cxx& swiftPart = swiftWrapper->getSwiftPart();
    return swiftPart.toUnsafe();
  }
  
  // pragma MARK: std::shared_ptr<margelo::nitro::camera::HybridFrameSpec>
  std::shared_ptr<margelo::nitro::camera::HybridFrameSpec> create_std__shared_ptr_margelo__nitro__camera__HybridFrameSpec_(void* NON_NULL swiftUnsafePointer) noexcept {
    // Implemented in VisionCamera
    return margelo::nitro::camera::bridge::swift::create_std__shared_ptr_HybridFrameSpec_(swiftUnsafePointer);
  }
  void* NON_NULL get_std__shared_ptr_margelo__nitro__camera__HybridFrameSpec_(std__shared_ptr_margelo__nitro__camera__HybridFrameSpec_ cppType) {
    // Implemented in VisionCamera
    return margelo::nitro::camera::bridge::swift::get_std__shared_ptr_HybridFrameSpec_(cppType);
  }
  
  // pragma MARK: std::shared_ptr<HybridFaceDetectorSpec>
  std::shared_ptr<HybridFaceDetectorSpec> create_std__shared_ptr_HybridFaceDetectorSpec_(void* NON_NULL swiftUnsafePointer) noexcept {
    VisionCameraFaceDetector::HybridFaceDetectorSpec_cxx swiftPart = VisionCameraFaceDetector::HybridFaceDetectorSpec_cxx::fromUnsafe(swiftUnsafePointer);
    return std::make_shared<margelo::nitro::camera::facedetector::HybridFaceDetectorSpecSwift>(swiftPart);
  }
  void* NON_NULL get_std__shared_ptr_HybridFaceDetectorSpec_(std__shared_ptr_HybridFaceDetectorSpec_ cppType) {
    std::shared_ptr<margelo::nitro::camera::facedetector::HybridFaceDetectorSpecSwift> swiftWrapper = std::dynamic_pointer_cast<margelo::nitro::camera::facedetector::HybridFaceDetectorSpecSwift>(cppType);
    #ifdef NITRO_DEBUG
    if (swiftWrapper == nullptr) [[unlikely]] {
      throw std::runtime_error("Class \"HybridFaceDetectorSpec\" is not implemented in Swift!");
    }
    #endif
    VisionCameraFaceDetector::HybridFaceDetectorSpec_cxx& swiftPart = swiftWrapper->getSwiftPart();
    return swiftPart.toUnsafe();
  }
  
  // pragma MARK: std::shared_ptr<margelo::nitro::camera::HybridCameraOutputSpec>
  std::shared_ptr<margelo::nitro::camera::HybridCameraOutputSpec> create_std__shared_ptr_margelo__nitro__camera__HybridCameraOutputSpec_(void* NON_NULL swiftUnsafePointer) noexcept {
    // Implemented in VisionCamera
    return margelo::nitro::camera::bridge::swift::create_std__shared_ptr_HybridCameraOutputSpec_(swiftUnsafePointer);
  }
  void* NON_NULL get_std__shared_ptr_margelo__nitro__camera__HybridCameraOutputSpec_(std__shared_ptr_margelo__nitro__camera__HybridCameraOutputSpec_ cppType) {
    // Implemented in VisionCamera
    return margelo::nitro::camera::bridge::swift::get_std__shared_ptr_HybridCameraOutputSpec_(cppType);
  }
  
  // pragma MARK: std::function<void(const std::vector<std::shared_ptr<HybridFaceSpec>>& /* faces */)>
  Func_void_std__vector_std__shared_ptr_HybridFaceSpec__ create_Func_void_std__vector_std__shared_ptr_HybridFaceSpec__(void* NON_NULL swiftClosureWrapper) noexcept {
    auto swiftClosure = VisionCameraFaceDetector::Func_void_std__vector_std__shared_ptr_HybridFaceSpec__::fromUnsafe(swiftClosureWrapper);
    return [swiftClosure = std::move(swiftClosure)](const std::vector<std::shared_ptr<HybridFaceSpec>>& faces) mutable -> void {
      swiftClosure.call(faces);
    };
  }
  
  // pragma MARK: std::function<void(const std::exception_ptr& /* error */)>
  Func_void_std__exception_ptr create_Func_void_std__exception_ptr(void* NON_NULL swiftClosureWrapper) noexcept {
    auto swiftClosure = VisionCameraFaceDetector::Func_void_std__exception_ptr::fromUnsafe(swiftClosureWrapper);
    return [swiftClosure = std::move(swiftClosure)](const std::exception_ptr& error) mutable -> void {
      swiftClosure.call(error);
    };
  }
  
  // pragma MARK: std::shared_ptr<HybridFaceDetectorFactorySpec>
  std::shared_ptr<HybridFaceDetectorFactorySpec> create_std__shared_ptr_HybridFaceDetectorFactorySpec_(void* NON_NULL swiftUnsafePointer) noexcept {
    VisionCameraFaceDetector::HybridFaceDetectorFactorySpec_cxx swiftPart = VisionCameraFaceDetector::HybridFaceDetectorFactorySpec_cxx::fromUnsafe(swiftUnsafePointer);
    return std::make_shared<margelo::nitro::camera::facedetector::HybridFaceDetectorFactorySpecSwift>(swiftPart);
  }
  void* NON_NULL get_std__shared_ptr_HybridFaceDetectorFactorySpec_(std__shared_ptr_HybridFaceDetectorFactorySpec_ cppType) {
    std::shared_ptr<margelo::nitro::camera::facedetector::HybridFaceDetectorFactorySpecSwift> swiftWrapper = std::dynamic_pointer_cast<margelo::nitro::camera::facedetector::HybridFaceDetectorFactorySpecSwift>(cppType);
    #ifdef NITRO_DEBUG
    if (swiftWrapper == nullptr) [[unlikely]] {
      throw std::runtime_error("Class \"HybridFaceDetectorFactorySpec\" is not implemented in Swift!");
    }
    #endif
    VisionCameraFaceDetector::HybridFaceDetectorFactorySpec_cxx& swiftPart = swiftWrapper->getSwiftPart();
    return swiftPart.toUnsafe();
  }
  
  // pragma MARK: std::shared_ptr<HybridImageFaceDetectorSpec>
  std::shared_ptr<HybridImageFaceDetectorSpec> create_std__shared_ptr_HybridImageFaceDetectorSpec_(void* NON_NULL swiftUnsafePointer) noexcept {
    VisionCameraFaceDetector::HybridImageFaceDetectorSpec_cxx swiftPart = VisionCameraFaceDetector::HybridImageFaceDetectorSpec_cxx::fromUnsafe(swiftUnsafePointer);
    return std::make_shared<margelo::nitro::camera::facedetector::HybridImageFaceDetectorSpecSwift>(swiftPart);
  }
  void* NON_NULL get_std__shared_ptr_HybridImageFaceDetectorSpec_(std__shared_ptr_HybridImageFaceDetectorSpec_ cppType) {
    std::shared_ptr<margelo::nitro::camera::facedetector::HybridImageFaceDetectorSpecSwift> swiftWrapper = std::dynamic_pointer_cast<margelo::nitro::camera::facedetector::HybridImageFaceDetectorSpecSwift>(cppType);
    #ifdef NITRO_DEBUG
    if (swiftWrapper == nullptr) [[unlikely]] {
      throw std::runtime_error("Class \"HybridImageFaceDetectorSpec\" is not implemented in Swift!");
    }
    #endif
    VisionCameraFaceDetector::HybridImageFaceDetectorSpec_cxx& swiftPart = swiftWrapper->getSwiftPart();
    return swiftPart.toUnsafe();
  }
  
  // pragma MARK: std::shared_ptr<HybridImageFaceDetectorFactorySpec>
  std::shared_ptr<HybridImageFaceDetectorFactorySpec> create_std__shared_ptr_HybridImageFaceDetectorFactorySpec_(void* NON_NULL swiftUnsafePointer) noexcept {
    VisionCameraFaceDetector::HybridImageFaceDetectorFactorySpec_cxx swiftPart = VisionCameraFaceDetector::HybridImageFaceDetectorFactorySpec_cxx::fromUnsafe(swiftUnsafePointer);
    return std::make_shared<margelo::nitro::camera::facedetector::HybridImageFaceDetectorFactorySpecSwift>(swiftPart);
  }
  void* NON_NULL get_std__shared_ptr_HybridImageFaceDetectorFactorySpec_(std__shared_ptr_HybridImageFaceDetectorFactorySpec_ cppType) {
    std::shared_ptr<margelo::nitro::camera::facedetector::HybridImageFaceDetectorFactorySpecSwift> swiftWrapper = std::dynamic_pointer_cast<margelo::nitro::camera::facedetector::HybridImageFaceDetectorFactorySpecSwift>(cppType);
    #ifdef NITRO_DEBUG
    if (swiftWrapper == nullptr) [[unlikely]] {
      throw std::runtime_error("Class \"HybridImageFaceDetectorFactorySpec\" is not implemented in Swift!");
    }
    #endif
    VisionCameraFaceDetector::HybridImageFaceDetectorFactorySpec_cxx& swiftPart = swiftWrapper->getSwiftPart();
    return swiftPart.toUnsafe();
  }

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