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

#pragma once

#include <fbjni/fbjni.h>
#include "DepthPixelFormat.hpp"

namespace margelo::nitro::camera {

  using namespace facebook;

  /**
   * The C++ JNI bridge between the C++ enum "DepthPixelFormat" and the the Kotlin enum "DepthPixelFormat".
   */
  struct JDepthPixelFormat final: public jni::JavaClass<JDepthPixelFormat> {
  public:
    static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/camera/DepthPixelFormat;";

  public:
    /**
     * Convert this Java/Kotlin-based enum to the C++ enum DepthPixelFormat.
     */
    [[maybe_unused]]
    [[nodiscard]]
    DepthPixelFormat toCpp() const {
      static const auto clazz = javaClassStatic();
      static const auto fieldOrdinal = clazz->getField<int>("value");
      int ordinal = this->getFieldValue(fieldOrdinal);
      return static_cast<DepthPixelFormat>(ordinal);
    }

  public:
    /**
     * Create a Java/Kotlin-based enum with the given C++ enum's value.
     */
    [[maybe_unused]]
    static jni::alias_ref<JDepthPixelFormat> fromCpp(DepthPixelFormat value) {
      static const auto clazz = javaClassStatic();
      switch (value) {
        case DepthPixelFormat::UNKNOWN:
          static const auto fieldUNKNOWN = clazz->getStaticField<JDepthPixelFormat>("UNKNOWN");
          return clazz->getStaticFieldValue(fieldUNKNOWN);
        case DepthPixelFormat::DEPTH_16_BIT:
          static const auto fieldDEPTH_16_BIT = clazz->getStaticField<JDepthPixelFormat>("DEPTH_16_BIT");
          return clazz->getStaticFieldValue(fieldDEPTH_16_BIT);
        case DepthPixelFormat::DEPTH_32_BIT:
          static const auto fieldDEPTH_32_BIT = clazz->getStaticField<JDepthPixelFormat>("DEPTH_32_BIT");
          return clazz->getStaticFieldValue(fieldDEPTH_32_BIT);
        case DepthPixelFormat::DEPTH_POINT_CLOUD_32_BIT:
          static const auto fieldDEPTH_POINT_CLOUD_32_BIT = clazz->getStaticField<JDepthPixelFormat>("DEPTH_POINT_CLOUD_32_BIT");
          return clazz->getStaticFieldValue(fieldDEPTH_POINT_CLOUD_32_BIT);
        case DepthPixelFormat::DISPARITY_16_BIT:
          static const auto fieldDISPARITY_16_BIT = clazz->getStaticField<JDepthPixelFormat>("DISPARITY_16_BIT");
          return clazz->getStaticFieldValue(fieldDISPARITY_16_BIT);
        case DepthPixelFormat::DISPARITY_32_BIT:
          static const auto fieldDISPARITY_32_BIT = clazz->getStaticField<JDepthPixelFormat>("DISPARITY_32_BIT");
          return clazz->getStaticFieldValue(fieldDISPARITY_32_BIT);
        default:
          std::string stringValue = std::to_string(static_cast<int>(value));
          throw std::invalid_argument("Invalid enum value (" + stringValue + "!");
      }
    }
  };

} // namespace margelo::nitro::camera
