///
/// JVideoDynamicRangeConstraint.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 "VideoDynamicRangeConstraint.hpp"

#include "JTargetColorRange.hpp"
#include "JTargetColorSpace.hpp"
#include "JTargetDynamicRange.hpp"
#include "JTargetDynamicRangeBitDepth.hpp"
#include "TargetColorRange.hpp"
#include "TargetColorSpace.hpp"
#include "TargetDynamicRange.hpp"
#include "TargetDynamicRangeBitDepth.hpp"

namespace margelo::nitro::camera {

  using namespace facebook;

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

  public:
    /**
     * Convert this Java/Kotlin-based struct to the C++ struct VideoDynamicRangeConstraint by copying all values to C++.
     */
    [[maybe_unused]]
    [[nodiscard]]
    VideoDynamicRangeConstraint toCpp() const {
      static const auto clazz = javaClassStatic();
      static const auto fieldVideoDynamicRange = clazz->getField<JTargetDynamicRange>("videoDynamicRange");
      jni::local_ref<JTargetDynamicRange> videoDynamicRange = this->getFieldValue(fieldVideoDynamicRange);
      return VideoDynamicRangeConstraint(
        videoDynamicRange->toCpp()
      );
    }

  public:
    /**
     * Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
     */
    [[maybe_unused]]
    static jni::local_ref<JVideoDynamicRangeConstraint::javaobject> fromCpp(const VideoDynamicRangeConstraint& value) {
      using JSignature = JVideoDynamicRangeConstraint(jni::alias_ref<JTargetDynamicRange>);
      static const auto clazz = javaClassStatic();
      static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
      return create(
        clazz,
        JTargetDynamicRange::fromCpp(value.videoDynamicRange)
      );
    }
  };

} // namespace margelo::nitro::camera
