// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from mynteye_types.djinni

#include "NativeIntrinsics.hpp"  // my header
#include "Marshal.hpp"
#include "NativeCalibrationModel.hpp"

namespace djinni_generated {

NativeIntrinsics::NativeIntrinsics() = default;

NativeIntrinsics::~NativeIntrinsics() = default;

auto NativeIntrinsics::fromCpp(JNIEnv* jniEnv, const CppType& c) -> ::djinni::LocalRef<JniType> {
    const auto& data = ::djinni::JniClass<NativeIntrinsics>::get();
    auto r = ::djinni::LocalRef<JniType>{jniEnv->NewObject(data.clazz.get(), data.jconstructor,
                                                           ::djinni::get(::djinni_generated::NativeCalibrationModel::fromCpp(jniEnv, c.calib_model)),
                                                           ::djinni::get(::djinni::I32::fromCpp(jniEnv, c.width)),
                                                           ::djinni::get(::djinni::I32::fromCpp(jniEnv, c.height)),
                                                           ::djinni::get(::djinni::F64::fromCpp(jniEnv, c.fx)),
                                                           ::djinni::get(::djinni::F64::fromCpp(jniEnv, c.fy)),
                                                           ::djinni::get(::djinni::F64::fromCpp(jniEnv, c.cx)),
                                                           ::djinni::get(::djinni::F64::fromCpp(jniEnv, c.cy)),
                                                           ::djinni::get(::djinni::List<::djinni::F64>::fromCpp(jniEnv, c.coeffs)))};
    ::djinni::jniExceptionCheck(jniEnv);
    return r;
}

auto NativeIntrinsics::toCpp(JNIEnv* jniEnv, JniType j) -> CppType {
    ::djinni::JniLocalScope jscope(jniEnv, 9);
    assert(j != nullptr);
    const auto& data = ::djinni::JniClass<NativeIntrinsics>::get();
    return {::djinni_generated::NativeCalibrationModel::toCpp(jniEnv, jniEnv->GetObjectField(j, data.field_mCalibModel)),
            ::djinni::I32::toCpp(jniEnv, jniEnv->GetIntField(j, data.field_mWidth)),
            ::djinni::I32::toCpp(jniEnv, jniEnv->GetIntField(j, data.field_mHeight)),
            ::djinni::F64::toCpp(jniEnv, jniEnv->GetDoubleField(j, data.field_mFx)),
            ::djinni::F64::toCpp(jniEnv, jniEnv->GetDoubleField(j, data.field_mFy)),
            ::djinni::F64::toCpp(jniEnv, jniEnv->GetDoubleField(j, data.field_mCx)),
            ::djinni::F64::toCpp(jniEnv, jniEnv->GetDoubleField(j, data.field_mCy)),
            ::djinni::List<::djinni::F64>::toCpp(jniEnv, jniEnv->GetObjectField(j, data.field_mCoeffs))};
}

}  // namespace djinni_generated
