feat(android): add more interfaces
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
// AUTOGENERATED FILE - DO NOT MODIFY!
|
||||
// This file generated by Djinni from mynteye_types.djinni
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <functional>
|
||||
|
||||
namespace mynteye_jni {
|
||||
|
||||
enum class Addon : int {
|
||||
/** Infrared */
|
||||
INFRARED,
|
||||
/** Second infrared */
|
||||
INFRARED2,
|
||||
};
|
||||
|
||||
} // namespace mynteye_jni
|
||||
|
||||
namespace std {
|
||||
|
||||
template <>
|
||||
struct hash<::mynteye_jni::Addon> {
|
||||
size_t operator()(::mynteye_jni::Addon type) const {
|
||||
return std::hash<int>()(static_cast<int>(type));
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace std
|
||||
@@ -0,0 +1,30 @@
|
||||
// AUTOGENERATED FILE - DO NOT MODIFY!
|
||||
// This file generated by Djinni from mynteye_types.djinni
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <functional>
|
||||
|
||||
namespace mynteye_jni {
|
||||
|
||||
enum class CalibrationModel : int {
|
||||
/** Pinhole */
|
||||
PINHOLE,
|
||||
/** Equidistant: KANNALA_BRANDT */
|
||||
KANNALA_BRANDT,
|
||||
/** Unknow */
|
||||
UNKNOW,
|
||||
};
|
||||
|
||||
} // namespace mynteye_jni
|
||||
|
||||
namespace std {
|
||||
|
||||
template <>
|
||||
struct hash<::mynteye_jni::CalibrationModel> {
|
||||
size_t operator()(::mynteye_jni::CalibrationModel type) const {
|
||||
return std::hash<int>()(static_cast<int>(type));
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace std
|
||||
@@ -0,0 +1,42 @@
|
||||
// AUTOGENERATED FILE - DO NOT MODIFY!
|
||||
// This file generated by Djinni from mynteye_types.djinni
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <functional>
|
||||
|
||||
namespace mynteye_jni {
|
||||
|
||||
enum class Capability : int {
|
||||
/** Provides stereo stream */
|
||||
STEREO,
|
||||
/** Provide stereo color stream */
|
||||
STEREO_COLOR,
|
||||
/** Provides color stream */
|
||||
COLOR,
|
||||
/** Provides depth stream */
|
||||
DEPTH,
|
||||
/** Provides point cloud stream */
|
||||
POINTS,
|
||||
/** Provides fisheye stream */
|
||||
FISHEYE,
|
||||
/** Provides infrared stream */
|
||||
INFRARED,
|
||||
/** Provides second infrared stream */
|
||||
INFRARED2,
|
||||
/** Provides IMU (accelerometer, gyroscope) data */
|
||||
IMU,
|
||||
};
|
||||
|
||||
} // namespace mynteye_jni
|
||||
|
||||
namespace std {
|
||||
|
||||
template <>
|
||||
struct hash<::mynteye_jni::Capability> {
|
||||
size_t operator()(::mynteye_jni::Capability type) const {
|
||||
return std::hash<int>()(static_cast<int>(type));
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace std
|
||||
@@ -3,14 +3,24 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "addon.hpp"
|
||||
#include "capability.hpp"
|
||||
#include "device_usb_info.hpp"
|
||||
#include "extrinsics.hpp"
|
||||
#include "info.hpp"
|
||||
#include "intrinsics.hpp"
|
||||
#include "model.hpp"
|
||||
#include "motion_data.hpp"
|
||||
#include "motion_intrinsics.hpp"
|
||||
#include "option.hpp"
|
||||
#include "option_info.hpp"
|
||||
#include "source.hpp"
|
||||
#include "stream.hpp"
|
||||
#include "stream_data.hpp"
|
||||
#include "stream_request.hpp"
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace mynteye_jni {
|
||||
@@ -23,12 +33,54 @@ public:
|
||||
/** Create the device instance */
|
||||
static std::shared_ptr<Device> Create(const ::mynteye_jni::DeviceUsbInfo & info);
|
||||
|
||||
/** Get the model */
|
||||
virtual ::mynteye_jni::Model GetModel() = 0;
|
||||
|
||||
/** Supports the stream or not */
|
||||
virtual bool SupportsStream(::mynteye_jni::Stream stream) = 0;
|
||||
|
||||
/** Supports the capability or not */
|
||||
virtual bool SupportsCapability(::mynteye_jni::Capability capabilities) = 0;
|
||||
|
||||
/** Supports the option or not */
|
||||
virtual bool SupportsOption(::mynteye_jni::Option option) = 0;
|
||||
|
||||
/** Supports the addon or not */
|
||||
virtual bool SupportsAddon(::mynteye_jni::Addon addon) = 0;
|
||||
|
||||
/** Get all stream requests */
|
||||
virtual std::vector<::mynteye_jni::StreamRequest> GetStreamRequests() = 0;
|
||||
|
||||
/** Config the stream request */
|
||||
virtual void ConfigStreamRequest(const ::mynteye_jni::StreamRequest & request) = 0;
|
||||
|
||||
/** Get the device info */
|
||||
virtual std::string GetInfo(::mynteye_jni::Info info) = 0;
|
||||
|
||||
/** Get the intrinsics of stream */
|
||||
virtual ::mynteye_jni::Intrinsics GetIntrinsics(::mynteye_jni::Stream stream) = 0;
|
||||
|
||||
/** Get the extrinsics of stream */
|
||||
virtual ::mynteye_jni::Extrinsics GetExtrinsics(::mynteye_jni::Stream from, ::mynteye_jni::Stream to) = 0;
|
||||
|
||||
/** Get the intrinsics of motion */
|
||||
virtual ::mynteye_jni::MotionIntrinsics GetMotionIntrinsics() = 0;
|
||||
|
||||
/** Get the extrinsics from one stream to motion */
|
||||
virtual ::mynteye_jni::Extrinsics GetMotionExtrinsics(::mynteye_jni::Stream from) = 0;
|
||||
|
||||
/** Get the option info */
|
||||
virtual ::mynteye_jni::OptionInfo GetOptionInfo(::mynteye_jni::Option option) = 0;
|
||||
|
||||
/** Get the option value */
|
||||
virtual int32_t GetOptionValue(::mynteye_jni::Option option) = 0;
|
||||
|
||||
/** Set the option value */
|
||||
virtual void SetOptionValue(::mynteye_jni::Option option, int32_t value) = 0;
|
||||
|
||||
/** Run the option value */
|
||||
virtual bool RunOptionAction(::mynteye_jni::Option option) = 0;
|
||||
|
||||
/** Start capturing the source */
|
||||
virtual void Start(::mynteye_jni::Source source) = 0;
|
||||
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
// AUTOGENERATED FILE - DO NOT MODIFY!
|
||||
// This file generated by Djinni from mynteye_types.djinni
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
namespace mynteye_jni {
|
||||
|
||||
/** Extrinsics, represent how the different datas are connected */
|
||||
struct Extrinsics final {
|
||||
/** Rotation matrix, 3x3 */
|
||||
std::vector<double> rotation;
|
||||
/** Translation vector, 1x3 */
|
||||
std::vector<double> translation;
|
||||
|
||||
Extrinsics(std::vector<double> rotation_,
|
||||
std::vector<double> translation_)
|
||||
: rotation(std::move(rotation_))
|
||||
, translation(std::move(translation_))
|
||||
{}
|
||||
};
|
||||
|
||||
} // namespace mynteye_jni
|
||||
@@ -0,0 +1,38 @@
|
||||
// AUTOGENERATED FILE - DO NOT MODIFY!
|
||||
// This file generated by Djinni from mynteye_types.djinni
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
namespace mynteye_jni {
|
||||
|
||||
/** IMU intrinsics: scale, drift and variances */
|
||||
struct ImuIntrinsics final {
|
||||
/**
|
||||
* Scale matrix 3x3
|
||||
* Scale X cross axis cross axis
|
||||
* cross axis Scale Y cross axis
|
||||
* cross axis cross axis Scale Z
|
||||
*/
|
||||
std::vector<double> scale;
|
||||
/** Zero-drift: X, Y, Z 1x3 */
|
||||
std::vector<double> drift;
|
||||
/** Noise density variances 1x3 */
|
||||
std::vector<double> noise;
|
||||
/** Random walk variances 1x3 */
|
||||
std::vector<double> bias;
|
||||
|
||||
ImuIntrinsics(std::vector<double> scale_,
|
||||
std::vector<double> drift_,
|
||||
std::vector<double> noise_,
|
||||
std::vector<double> bias_)
|
||||
: scale(std::move(scale_))
|
||||
, drift(std::move(drift_))
|
||||
, noise(std::move(noise_))
|
||||
, bias(std::move(bias_))
|
||||
{}
|
||||
};
|
||||
|
||||
} // namespace mynteye_jni
|
||||
@@ -0,0 +1,40 @@
|
||||
// AUTOGENERATED FILE - DO NOT MODIFY!
|
||||
// This file generated by Djinni from mynteye_types.djinni
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <functional>
|
||||
|
||||
namespace mynteye_jni {
|
||||
|
||||
enum class Info : int {
|
||||
/** Device name */
|
||||
DEVICE_NAME,
|
||||
/** Serial number */
|
||||
SERIAL_NUMBER,
|
||||
/** Firmware version */
|
||||
FIRMWARE_VERSION,
|
||||
/** Hardware version */
|
||||
HARDWARE_VERSION,
|
||||
/** Spec version */
|
||||
SPEC_VERSION,
|
||||
/** Lens type */
|
||||
LENS_TYPE,
|
||||
/** IMU type */
|
||||
IMU_TYPE,
|
||||
/** Nominal baseline */
|
||||
NOMINAL_BASELINE,
|
||||
};
|
||||
|
||||
} // namespace mynteye_jni
|
||||
|
||||
namespace std {
|
||||
|
||||
template <>
|
||||
struct hash<::mynteye_jni::Info> {
|
||||
size_t operator()(::mynteye_jni::Info type) const {
|
||||
return std::hash<int>()(static_cast<int>(type));
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace std
|
||||
@@ -0,0 +1,55 @@
|
||||
// AUTOGENERATED FILE - DO NOT MODIFY!
|
||||
// This file generated by Djinni from mynteye_types.djinni
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "calibration_model.hpp"
|
||||
#include <cstdint>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
namespace mynteye_jni {
|
||||
|
||||
/** Stream intrinsics */
|
||||
struct Intrinsics final {
|
||||
/** The calibration model */
|
||||
CalibrationModel calib_model;
|
||||
/** The width of the image in pixels */
|
||||
int32_t width;
|
||||
/** The height of the image in pixels */
|
||||
int32_t height;
|
||||
/** The focal length of the image plane, as a multiple of pixel width (pinhole) */
|
||||
double fx;
|
||||
/** The focal length of the image plane, as a multiple of pixel height (pinhole) */
|
||||
double fy;
|
||||
/** The horizontal coordinate of the principal point of the image (pinhole) */
|
||||
double cx;
|
||||
/** The vertical coordinate of the principal point of the image (pinhole) */
|
||||
double cy;
|
||||
/**
|
||||
* The distortion coefficients
|
||||
* pinhole: k1,k2,p1,p2,k3
|
||||
* kannala_brandt: k2,k3,k4,k5,mu,mv,u0,v0
|
||||
*/
|
||||
std::vector<double> coeffs;
|
||||
|
||||
Intrinsics(CalibrationModel calib_model_,
|
||||
int32_t width_,
|
||||
int32_t height_,
|
||||
double fx_,
|
||||
double fy_,
|
||||
double cx_,
|
||||
double cy_,
|
||||
std::vector<double> coeffs_)
|
||||
: calib_model(std::move(calib_model_))
|
||||
, width(std::move(width_))
|
||||
, height(std::move(height_))
|
||||
, fx(std::move(fx_))
|
||||
, fy(std::move(fy_))
|
||||
, cx(std::move(cx_))
|
||||
, cy(std::move(cy_))
|
||||
, coeffs(std::move(coeffs_))
|
||||
{}
|
||||
};
|
||||
|
||||
} // namespace mynteye_jni
|
||||
@@ -0,0 +1,25 @@
|
||||
// AUTOGENERATED FILE - DO NOT MODIFY!
|
||||
// This file generated by Djinni from mynteye_types.djinni
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "imu_intrinsics.hpp"
|
||||
#include <utility>
|
||||
|
||||
namespace mynteye_jni {
|
||||
|
||||
/** Motion intrinsics, including accelerometer and gyroscope */
|
||||
struct MotionIntrinsics final {
|
||||
/** Accelerometer intrinsics */
|
||||
ImuIntrinsics accel;
|
||||
/** Gyroscope intrinsics */
|
||||
ImuIntrinsics gyro;
|
||||
|
||||
MotionIntrinsics(ImuIntrinsics accel_,
|
||||
ImuIntrinsics gyro_)
|
||||
: accel(std::move(accel_))
|
||||
, gyro(std::move(gyro_))
|
||||
{}
|
||||
};
|
||||
|
||||
} // namespace mynteye_jni
|
||||
@@ -0,0 +1,115 @@
|
||||
// AUTOGENERATED FILE - DO NOT MODIFY!
|
||||
// This file generated by Djinni from mynteye_types.djinni
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <functional>
|
||||
|
||||
namespace mynteye_jni {
|
||||
|
||||
enum class Option : int {
|
||||
/**
|
||||
* Image gain, valid if manual-exposure
|
||||
* range: [0,48], default: 24
|
||||
*/
|
||||
GAIN,
|
||||
/**
|
||||
* Image brightness, valid if manual-exposure
|
||||
* range: [0,240], default: 120
|
||||
*/
|
||||
BRIGHTNESS,
|
||||
/**
|
||||
* Image contrast, valid if manual-exposure
|
||||
* range: [0,255], default: 127
|
||||
*/
|
||||
CONTRAST,
|
||||
/**
|
||||
* Image frame rate, must set IMU_FREQUENCY together
|
||||
* values: {10,15,20,25,30,35,40,45,50,55,60}, default: 25
|
||||
*/
|
||||
FRAME_RATE,
|
||||
/**
|
||||
* IMU frequency, must set FRAME_RATE together
|
||||
* values: {100,200,250,333,500}, default: 200
|
||||
*/
|
||||
IMU_FREQUENCY,
|
||||
/**
|
||||
* Exposure mode
|
||||
* 0: enable auto-exposure
|
||||
* 1: disable auto-exposure (manual-exposure)
|
||||
*/
|
||||
EXPOSURE_MODE,
|
||||
/**
|
||||
* Max gain, valid if auto-exposure
|
||||
* range of standard 1: [0,48], default: 48
|
||||
* range of standard 2: [0,255], default: 8
|
||||
*/
|
||||
MAX_GAIN,
|
||||
/**
|
||||
* Max exposure time, valid if auto-exposure
|
||||
* range of standard 1: [0,240], default: 240
|
||||
* range of standard 2: [0,1000], default: 333
|
||||
*/
|
||||
MAX_EXPOSURE_TIME,
|
||||
/**
|
||||
* min exposure time, valid if auto-exposure
|
||||
* range: [0,1000], default: 0
|
||||
*/
|
||||
MIN_EXPOSURE_TIME,
|
||||
/**
|
||||
* Desired brightness, valid if auto-exposure
|
||||
* range of standard 1: [0,255], default: 192
|
||||
* range of standard 2: [1,255], default: 122
|
||||
*/
|
||||
DESIRED_BRIGHTNESS,
|
||||
/**
|
||||
* IR control
|
||||
* range: [0,160], default: 0
|
||||
*/
|
||||
IR_CONTROL,
|
||||
/**
|
||||
* HDR mode
|
||||
* 0: 10-bit
|
||||
* 1: 12-bit
|
||||
*/
|
||||
HDR_MODE,
|
||||
/**
|
||||
* The range of accelerometer
|
||||
* value of standard 1: {4,8,16,32}, default: 8
|
||||
* value of standard 2: {6,12,24,48}, default: 12
|
||||
*/
|
||||
ACCELEROMETER_RANGE,
|
||||
/**
|
||||
* The range of gyroscope
|
||||
* value of standard 1: {500,1000,2000,4000}, default: 1000
|
||||
* value of standard 2: {250,500,1000,2000,4000}, default: 1000
|
||||
*/
|
||||
GYROSCOPE_RANGE,
|
||||
/**
|
||||
* The parameter of accelerometer low pass filter
|
||||
* values: {0,1,2}, default: 2
|
||||
*/
|
||||
ACCELEROMETER_LOW_PASS_FILTER,
|
||||
/**
|
||||
* The parameter of gyroscope low pass filter
|
||||
* values: {23,64}, default: 64
|
||||
*/
|
||||
GYROSCOPE_LOW_PASS_FILTER,
|
||||
/** Zero drift calibration */
|
||||
ZERO_DRIFT_CALIBRATION,
|
||||
/** Erase chip */
|
||||
ERASE_CHIP,
|
||||
};
|
||||
|
||||
} // namespace mynteye_jni
|
||||
|
||||
namespace std {
|
||||
|
||||
template <>
|
||||
struct hash<::mynteye_jni::Option> {
|
||||
size_t operator()(::mynteye_jni::Option type) const {
|
||||
return std::hash<int>()(static_cast<int>(type));
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace std
|
||||
@@ -0,0 +1,29 @@
|
||||
// AUTOGENERATED FILE - DO NOT MODIFY!
|
||||
// This file generated by Djinni from mynteye_types.djinni
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
#include <utility>
|
||||
|
||||
namespace mynteye_jni {
|
||||
|
||||
/** Option info */
|
||||
struct OptionInfo final {
|
||||
/** Minimum value */
|
||||
int32_t min;
|
||||
/** Maximum value */
|
||||
int32_t max;
|
||||
/** Default value */
|
||||
int32_t def;
|
||||
|
||||
OptionInfo(int32_t min_,
|
||||
int32_t max_,
|
||||
int32_t def_)
|
||||
: min(std::move(min_))
|
||||
, max(std::move(max_))
|
||||
, def(std::move(def_))
|
||||
{}
|
||||
};
|
||||
|
||||
} // namespace mynteye_jni
|
||||
@@ -70,6 +70,26 @@ DeviceImpl::~DeviceImpl() {
|
||||
VLOG(2) << __func__;
|
||||
}
|
||||
|
||||
::mynteye_jni::Model DeviceImpl::GetModel() {
|
||||
return to_jni(device_->GetModel());
|
||||
}
|
||||
|
||||
bool DeviceImpl::SupportsStream(::mynteye_jni::Stream stream) {
|
||||
return device_->Supports(from_jni(stream));
|
||||
}
|
||||
|
||||
bool DeviceImpl::SupportsCapability(::mynteye_jni::Capability capabilities) {
|
||||
return device_->Supports(from_jni(capabilities));
|
||||
}
|
||||
|
||||
bool DeviceImpl::SupportsOption(::mynteye_jni::Option option) {
|
||||
return device_->Supports(from_jni(option));
|
||||
}
|
||||
|
||||
bool DeviceImpl::SupportsAddon(::mynteye_jni::Addon addon) {
|
||||
return device_->Supports(from_jni(addon));
|
||||
}
|
||||
|
||||
std::vector<::mynteye_jni::StreamRequest> DeviceImpl::GetStreamRequests() {
|
||||
VLOG(2) << __func__;
|
||||
std::vector<::mynteye_jni::StreamRequest> requests;
|
||||
@@ -97,6 +117,68 @@ void DeviceImpl::ConfigStreamRequest(
|
||||
}
|
||||
}
|
||||
|
||||
std::string DeviceImpl::GetInfo(::mynteye_jni::Info info) {
|
||||
return device_->GetInfo(from_jni(info));
|
||||
}
|
||||
|
||||
::mynteye_jni::Intrinsics DeviceImpl::GetIntrinsics(
|
||||
::mynteye_jni::Stream stream) {
|
||||
auto in = device_->GetIntrinsics(from_jni(stream));
|
||||
if (in->calib_model() == MYNTEYE_NAMESPACE::CalibrationModel::PINHOLE) {
|
||||
auto in_p = std::dynamic_pointer_cast<IntrinsicsPinhole>(in);
|
||||
return {CalibrationModel::PINHOLE, in_p->width, in_p->height,
|
||||
in_p->fx, in_p->fy, in_p->cx, in_p->cy,
|
||||
to_vector<5>(in_p->coeffs)};
|
||||
} else if (in->calib_model() == MYNTEYE_NAMESPACE::CalibrationModel::KANNALA_BRANDT) {
|
||||
auto in_k = std::dynamic_pointer_cast<IntrinsicsEquidistant>(in);
|
||||
return {CalibrationModel::KANNALA_BRANDT, in_k->width, in_k->height,
|
||||
0, 0, 0, 0, to_vector<8>(in_k->coeffs)};
|
||||
} else {
|
||||
LOG(WARNING) << "Unknown calibration model";
|
||||
return {CalibrationModel::UNKNOW, 0, 0, 0, 0, 0, 0, {}};
|
||||
}
|
||||
}
|
||||
|
||||
::mynteye_jni::Extrinsics DeviceImpl::GetExtrinsics(
|
||||
::mynteye_jni::Stream from, ::mynteye_jni::Stream to) {
|
||||
auto ex = device_->GetExtrinsics(from_jni(from), from_jni(to));
|
||||
return {to_vector<3, 3>(ex.rotation), to_vector<3>(ex.translation)};
|
||||
}
|
||||
|
||||
::mynteye_jni::MotionIntrinsics DeviceImpl::GetMotionIntrinsics() {
|
||||
auto in = device_->GetMotionIntrinsics();
|
||||
auto in_to_jni = [](MYNTEYE_NAMESPACE::ImuIntrinsics& in) {
|
||||
return ImuIntrinsics{
|
||||
to_vector<3, 3>(in.scale), to_vector<3>(in.drift),
|
||||
to_vector<3>(in.noise), to_vector<3>(in.bias)
|
||||
};
|
||||
};
|
||||
return {in_to_jni(in.accel), in_to_jni(in.gyro)};
|
||||
}
|
||||
|
||||
::mynteye_jni::Extrinsics DeviceImpl::GetMotionExtrinsics(
|
||||
::mynteye_jni::Stream from) {
|
||||
auto ex = device_->GetMotionExtrinsics(from_jni(from));
|
||||
return {to_vector<3, 3>(ex.rotation), to_vector<3>(ex.translation)};
|
||||
}
|
||||
|
||||
::mynteye_jni::OptionInfo DeviceImpl::GetOptionInfo(::mynteye_jni::Option option) {
|
||||
auto info = device_->GetOptionInfo(from_jni(option));
|
||||
return {info.min, info.max, info.def};
|
||||
}
|
||||
|
||||
int32_t DeviceImpl::GetOptionValue(::mynteye_jni::Option option) {
|
||||
return device_->GetOptionValue(from_jni(option));
|
||||
}
|
||||
|
||||
void DeviceImpl::SetOptionValue(::mynteye_jni::Option option, int32_t value) {
|
||||
return device_->SetOptionValue(from_jni(option), value);
|
||||
}
|
||||
|
||||
bool DeviceImpl::RunOptionAction(::mynteye_jni::Option option) {
|
||||
return device_->RunOptionAction(from_jni(option));
|
||||
}
|
||||
|
||||
void DeviceImpl::Start(::mynteye_jni::Source source) {
|
||||
device_->Start(from_jni(source));
|
||||
}
|
||||
|
||||
@@ -16,12 +16,54 @@ class DeviceImpl : public Device {
|
||||
explicit DeviceImpl(const device_t & device);
|
||||
~DeviceImpl();
|
||||
|
||||
/** Get the model */
|
||||
::mynteye_jni::Model GetModel() override;
|
||||
|
||||
/** Supports the stream or not */
|
||||
bool SupportsStream(::mynteye_jni::Stream stream) override;
|
||||
|
||||
/** Supports the capability or not */
|
||||
bool SupportsCapability(::mynteye_jni::Capability capabilities) override;
|
||||
|
||||
/** Supports the option or not */
|
||||
bool SupportsOption(::mynteye_jni::Option option) override;
|
||||
|
||||
/** Supports the addon or not */
|
||||
bool SupportsAddon(::mynteye_jni::Addon addon) override;
|
||||
|
||||
/** Get all stream requests */
|
||||
std::vector<::mynteye_jni::StreamRequest> GetStreamRequests() override;
|
||||
|
||||
/** Config the stream request */
|
||||
void ConfigStreamRequest(const ::mynteye_jni::StreamRequest & request) override;
|
||||
|
||||
/** Get the device info */
|
||||
std::string GetInfo(::mynteye_jni::Info info) override;
|
||||
|
||||
/** Get the intrinsics of stream */
|
||||
::mynteye_jni::Intrinsics GetIntrinsics(::mynteye_jni::Stream stream) override;
|
||||
|
||||
/** Get the extrinsics of stream */
|
||||
::mynteye_jni::Extrinsics GetExtrinsics(::mynteye_jni::Stream from, ::mynteye_jni::Stream to) override;
|
||||
|
||||
/** Get the intrinsics of motion */
|
||||
::mynteye_jni::MotionIntrinsics GetMotionIntrinsics() override;
|
||||
|
||||
/** Get the extrinsics from one stream to motion */
|
||||
::mynteye_jni::Extrinsics GetMotionExtrinsics(::mynteye_jni::Stream from) override;
|
||||
|
||||
/** Get the option info */
|
||||
::mynteye_jni::OptionInfo GetOptionInfo(::mynteye_jni::Option option) override;
|
||||
|
||||
/** Get the option value */
|
||||
int32_t GetOptionValue(::mynteye_jni::Option option) override;
|
||||
|
||||
/** Set the option value */
|
||||
void SetOptionValue(::mynteye_jni::Option option, int32_t value) override;
|
||||
|
||||
/** Run the option value */
|
||||
bool RunOptionAction(::mynteye_jni::Option option) override;
|
||||
|
||||
/** Start capturing the source */
|
||||
void Start(::mynteye_jni::Source source) override;
|
||||
|
||||
@@ -37,7 +79,7 @@ class DeviceImpl : public Device {
|
||||
/** Get the datas of stream */
|
||||
std::vector<std::shared_ptr<::mynteye_jni::StreamData>> GetStreamDatas(::mynteye_jni::Stream stream) override;
|
||||
|
||||
/** Enable cache motion datas until get them, otherwise using callback instead */
|
||||
/** Enable cache motion datas until get them, otherwise using callback instead */
|
||||
void EnableMotionDatas(int32_t max_size) override;
|
||||
|
||||
/** Get the motion datas */
|
||||
|
||||
@@ -5,9 +5,14 @@
|
||||
#include "mynteye/logger.h"
|
||||
#include "mynteye/types.h"
|
||||
|
||||
#include "addon.hpp"
|
||||
#include "calibration_model.hpp"
|
||||
#include "capability.hpp"
|
||||
#include "device_usb_info.hpp"
|
||||
#include "format.hpp"
|
||||
#include "info.hpp"
|
||||
#include "model.hpp"
|
||||
#include "option.hpp"
|
||||
#include "source.hpp"
|
||||
#include "stream.hpp"
|
||||
|
||||
@@ -15,105 +20,7 @@
|
||||
|
||||
namespace mynteye_jni {
|
||||
|
||||
using RawModel = MYNTEYE_NAMESPACE::Model;
|
||||
using JniModel = mynteye_jni::Model;
|
||||
|
||||
inline
|
||||
RawModel from_jni(const JniModel& model) {
|
||||
switch (model) {
|
||||
case JniModel::STANDARD: return RawModel::STANDARD;
|
||||
case JniModel::STANDARD2: return RawModel::STANDARD2;
|
||||
case JniModel::STANDARD210A: return RawModel::STANDARD210A;
|
||||
default:
|
||||
LOG(FATAL) << "Model is unknown";
|
||||
}
|
||||
}
|
||||
|
||||
inline
|
||||
JniModel to_jni(const RawModel& model) {
|
||||
switch (model) {
|
||||
case RawModel::STANDARD: return JniModel::STANDARD;
|
||||
case RawModel::STANDARD2: return JniModel::STANDARD2;
|
||||
case RawModel::STANDARD210A: return JniModel::STANDARD210A;
|
||||
default:
|
||||
LOG(FATAL) << "Model is unknown";
|
||||
}
|
||||
}
|
||||
|
||||
using RawFormat = MYNTEYE_NAMESPACE::Format;
|
||||
using JniFormat = mynteye_jni::Format;
|
||||
|
||||
inline
|
||||
RawFormat from_jni(const JniFormat& format) {
|
||||
switch (format) {
|
||||
case JniFormat::GREY: return RawFormat::GREY;
|
||||
case JniFormat::YUYV: return RawFormat::YUYV;
|
||||
case JniFormat::BGR888: return RawFormat::BGR888;
|
||||
case JniFormat::RGB888: return RawFormat::RGB888;
|
||||
default:
|
||||
LOG(FATAL) << "Format is unknown";
|
||||
}
|
||||
}
|
||||
|
||||
inline
|
||||
JniFormat to_jni(const RawFormat& format) {
|
||||
switch (format) {
|
||||
case RawFormat::GREY: return JniFormat::GREY;
|
||||
case RawFormat::YUYV: return JniFormat::YUYV;
|
||||
case RawFormat::BGR888: return JniFormat::BGR888;
|
||||
case RawFormat::RGB888: return JniFormat::RGB888;
|
||||
default:
|
||||
LOG(FATAL) << "Format is unknown";
|
||||
}
|
||||
}
|
||||
|
||||
using RawSource = MYNTEYE_NAMESPACE::Source;
|
||||
using JniSource = mynteye_jni::Source;
|
||||
|
||||
inline
|
||||
RawSource from_jni(const JniSource& source) {
|
||||
switch (source) {
|
||||
case JniSource::VIDEO_STREAMING: return RawSource::VIDEO_STREAMING;
|
||||
case JniSource::MOTION_TRACKING: return RawSource::MOTION_TRACKING;
|
||||
case JniSource::ALL: return RawSource::ALL;
|
||||
default:
|
||||
LOG(FATAL) << "Source is unknown";
|
||||
}
|
||||
}
|
||||
|
||||
inline
|
||||
JniSource to_jni(const RawSource& source) {
|
||||
switch (source) {
|
||||
case RawSource::VIDEO_STREAMING: return JniSource::VIDEO_STREAMING;
|
||||
case RawSource::MOTION_TRACKING: return JniSource::MOTION_TRACKING;
|
||||
case RawSource::ALL: return JniSource::ALL;
|
||||
default:
|
||||
LOG(FATAL) << "Source is unknown";
|
||||
}
|
||||
}
|
||||
|
||||
using RawStream = MYNTEYE_NAMESPACE::Stream;
|
||||
using JniStream = mynteye_jni::Stream;
|
||||
|
||||
inline
|
||||
RawStream from_jni(const JniStream& stream) {
|
||||
switch (stream) {
|
||||
case JniStream::LEFT: return RawStream::LEFT;
|
||||
case JniStream::RIGHT: return RawStream::RIGHT;
|
||||
default:
|
||||
LOG(FATAL) << "Stream is unknown";
|
||||
}
|
||||
}
|
||||
|
||||
inline
|
||||
JniStream to_jni(const RawStream& stream) {
|
||||
switch (stream) {
|
||||
case RawStream::LEFT: return JniStream::LEFT;
|
||||
case RawStream::RIGHT: return JniStream::RIGHT;
|
||||
default:
|
||||
LOG(FATAL) << "Stream is unknown";
|
||||
}
|
||||
}
|
||||
// device_usb_info
|
||||
|
||||
using RawUsbInfo = MYNTEYE_NAMESPACE::UsbInfo;
|
||||
using JniUsbInfo = mynteye_jni::DeviceUsbInfo;
|
||||
@@ -146,4 +53,361 @@ JniUsbInfo to_jni(const RawUsbInfo& info) {
|
||||
};
|
||||
}
|
||||
|
||||
// model
|
||||
|
||||
using RawModel = MYNTEYE_NAMESPACE::Model;
|
||||
using JniModel = mynteye_jni::Model;
|
||||
|
||||
inline
|
||||
RawModel from_jni(const JniModel& model) {
|
||||
switch (model) {
|
||||
case JniModel::STANDARD: return RawModel::STANDARD;
|
||||
case JniModel::STANDARD2: return RawModel::STANDARD2;
|
||||
case JniModel::STANDARD210A: return RawModel::STANDARD210A;
|
||||
default:
|
||||
LOG(FATAL) << "Model is unknown";
|
||||
}
|
||||
}
|
||||
|
||||
inline
|
||||
JniModel to_jni(const RawModel& model) {
|
||||
switch (model) {
|
||||
case RawModel::STANDARD: return JniModel::STANDARD;
|
||||
case RawModel::STANDARD2: return JniModel::STANDARD2;
|
||||
case RawModel::STANDARD210A: return JniModel::STANDARD210A;
|
||||
default:
|
||||
LOG(FATAL) << "Model is unknown";
|
||||
}
|
||||
}
|
||||
|
||||
// format
|
||||
|
||||
using RawFormat = MYNTEYE_NAMESPACE::Format;
|
||||
using JniFormat = mynteye_jni::Format;
|
||||
|
||||
inline
|
||||
RawFormat from_jni(const JniFormat& format) {
|
||||
switch (format) {
|
||||
case JniFormat::GREY: return RawFormat::GREY;
|
||||
case JniFormat::YUYV: return RawFormat::YUYV;
|
||||
case JniFormat::BGR888: return RawFormat::BGR888;
|
||||
case JniFormat::RGB888: return RawFormat::RGB888;
|
||||
default:
|
||||
LOG(FATAL) << "Format is unknown";
|
||||
}
|
||||
}
|
||||
|
||||
inline
|
||||
JniFormat to_jni(const RawFormat& format) {
|
||||
switch (format) {
|
||||
case RawFormat::GREY: return JniFormat::GREY;
|
||||
case RawFormat::YUYV: return JniFormat::YUYV;
|
||||
case RawFormat::BGR888: return JniFormat::BGR888;
|
||||
case RawFormat::RGB888: return JniFormat::RGB888;
|
||||
default:
|
||||
LOG(FATAL) << "Format is unknown";
|
||||
}
|
||||
}
|
||||
|
||||
// source
|
||||
|
||||
using RawSource = MYNTEYE_NAMESPACE::Source;
|
||||
using JniSource = mynteye_jni::Source;
|
||||
|
||||
inline
|
||||
RawSource from_jni(const JniSource& source) {
|
||||
switch (source) {
|
||||
case JniSource::VIDEO_STREAMING: return RawSource::VIDEO_STREAMING;
|
||||
case JniSource::MOTION_TRACKING: return RawSource::MOTION_TRACKING;
|
||||
case JniSource::ALL: return RawSource::ALL;
|
||||
default:
|
||||
LOG(FATAL) << "Source is unknown";
|
||||
}
|
||||
}
|
||||
|
||||
inline
|
||||
JniSource to_jni(const RawSource& source) {
|
||||
switch (source) {
|
||||
case RawSource::VIDEO_STREAMING: return JniSource::VIDEO_STREAMING;
|
||||
case RawSource::MOTION_TRACKING: return JniSource::MOTION_TRACKING;
|
||||
case RawSource::ALL: return JniSource::ALL;
|
||||
default:
|
||||
LOG(FATAL) << "Source is unknown";
|
||||
}
|
||||
}
|
||||
|
||||
// stream
|
||||
|
||||
using RawStream = MYNTEYE_NAMESPACE::Stream;
|
||||
using JniStream = mynteye_jni::Stream;
|
||||
|
||||
inline
|
||||
RawStream from_jni(const JniStream& stream) {
|
||||
switch (stream) {
|
||||
case JniStream::LEFT: return RawStream::LEFT;
|
||||
case JniStream::RIGHT: return RawStream::RIGHT;
|
||||
default:
|
||||
LOG(FATAL) << "Stream is unknown";
|
||||
}
|
||||
}
|
||||
|
||||
inline
|
||||
JniStream to_jni(const RawStream& stream) {
|
||||
switch (stream) {
|
||||
case RawStream::LEFT: return JniStream::LEFT;
|
||||
case RawStream::RIGHT: return JniStream::RIGHT;
|
||||
default:
|
||||
LOG(FATAL) << "Stream is unknown";
|
||||
}
|
||||
}
|
||||
|
||||
// capability
|
||||
|
||||
using RawCapability = MYNTEYE_NAMESPACE::Capabilities;
|
||||
using JniCapability = mynteye_jni::Capability;
|
||||
|
||||
inline
|
||||
RawCapability from_jni(const JniCapability& Capability) {
|
||||
switch (Capability) {
|
||||
case JniCapability::STEREO: return RawCapability::STEREO;
|
||||
case JniCapability::STEREO_COLOR: return RawCapability::STEREO_COLOR;
|
||||
case JniCapability::COLOR: return RawCapability::COLOR;
|
||||
case JniCapability::DEPTH: return RawCapability::DEPTH;
|
||||
case JniCapability::POINTS: return RawCapability::POINTS;
|
||||
case JniCapability::FISHEYE: return RawCapability::FISHEYE;
|
||||
case JniCapability::INFRARED: return RawCapability::INFRARED;
|
||||
case JniCapability::INFRARED2: return RawCapability::INFRARED2;
|
||||
case JniCapability::IMU: return RawCapability::IMU;
|
||||
default:
|
||||
LOG(FATAL) << "Capability is unknown";
|
||||
}
|
||||
}
|
||||
|
||||
inline
|
||||
JniCapability to_jni(const RawCapability& Capability) {
|
||||
switch (Capability) {
|
||||
case RawCapability::STEREO: return JniCapability::STEREO;
|
||||
case RawCapability::STEREO_COLOR: return JniCapability::STEREO_COLOR;
|
||||
case RawCapability::COLOR: return JniCapability::COLOR;
|
||||
case RawCapability::DEPTH: return JniCapability::DEPTH;
|
||||
case RawCapability::POINTS: return JniCapability::POINTS;
|
||||
case RawCapability::FISHEYE: return JniCapability::FISHEYE;
|
||||
case RawCapability::INFRARED: return JniCapability::INFRARED;
|
||||
case RawCapability::INFRARED2: return JniCapability::INFRARED2;
|
||||
case RawCapability::IMU: return JniCapability::IMU;
|
||||
default:
|
||||
LOG(FATAL) << "Capability is unknown";
|
||||
}
|
||||
}
|
||||
|
||||
// info
|
||||
|
||||
using RawInfo = MYNTEYE_NAMESPACE::Info;
|
||||
using JniInfo = mynteye_jni::Info;
|
||||
|
||||
inline
|
||||
RawInfo from_jni(const JniInfo& Info) {
|
||||
switch (Info) {
|
||||
case JniInfo::DEVICE_NAME: return RawInfo::DEVICE_NAME;
|
||||
case JniInfo::SERIAL_NUMBER: return RawInfo::SERIAL_NUMBER;
|
||||
case JniInfo::FIRMWARE_VERSION: return RawInfo::FIRMWARE_VERSION;
|
||||
case JniInfo::HARDWARE_VERSION: return RawInfo::HARDWARE_VERSION;
|
||||
case JniInfo::SPEC_VERSION: return RawInfo::SPEC_VERSION;
|
||||
case JniInfo::LENS_TYPE: return RawInfo::LENS_TYPE;
|
||||
case JniInfo::IMU_TYPE: return RawInfo::IMU_TYPE;
|
||||
case JniInfo::NOMINAL_BASELINE: return RawInfo::NOMINAL_BASELINE;
|
||||
default:
|
||||
LOG(FATAL) << "Info is unknown";
|
||||
}
|
||||
}
|
||||
|
||||
inline
|
||||
JniInfo to_jni(const RawInfo& Info) {
|
||||
switch (Info) {
|
||||
case RawInfo::DEVICE_NAME: return JniInfo::DEVICE_NAME;
|
||||
case RawInfo::SERIAL_NUMBER: return JniInfo::SERIAL_NUMBER;
|
||||
case RawInfo::FIRMWARE_VERSION: return JniInfo::FIRMWARE_VERSION;
|
||||
case RawInfo::HARDWARE_VERSION: return JniInfo::HARDWARE_VERSION;
|
||||
case RawInfo::SPEC_VERSION: return JniInfo::SPEC_VERSION;
|
||||
case RawInfo::LENS_TYPE: return JniInfo::LENS_TYPE;
|
||||
case RawInfo::IMU_TYPE: return JniInfo::IMU_TYPE;
|
||||
case RawInfo::NOMINAL_BASELINE: return JniInfo::NOMINAL_BASELINE;
|
||||
default:
|
||||
LOG(FATAL) << "Info is unknown";
|
||||
}
|
||||
}
|
||||
|
||||
// option
|
||||
|
||||
using RawOption = MYNTEYE_NAMESPACE::Option;
|
||||
using JniOption = mynteye_jni::Option;
|
||||
|
||||
inline
|
||||
RawOption from_jni(const JniOption& Option) {
|
||||
switch (Option) {
|
||||
case JniOption::GAIN:
|
||||
return RawOption::GAIN;
|
||||
case JniOption::BRIGHTNESS:
|
||||
return RawOption::BRIGHTNESS;
|
||||
case JniOption::CONTRAST:
|
||||
return RawOption::CONTRAST;
|
||||
case JniOption::FRAME_RATE:
|
||||
return RawOption::FRAME_RATE;
|
||||
case JniOption::IMU_FREQUENCY:
|
||||
return RawOption::IMU_FREQUENCY;
|
||||
case JniOption::EXPOSURE_MODE:
|
||||
return RawOption::EXPOSURE_MODE;
|
||||
case JniOption::MAX_GAIN:
|
||||
return RawOption::MAX_GAIN;
|
||||
case JniOption::MAX_EXPOSURE_TIME:
|
||||
return RawOption::MAX_EXPOSURE_TIME;
|
||||
case JniOption::MIN_EXPOSURE_TIME:
|
||||
return RawOption::MIN_EXPOSURE_TIME;
|
||||
case JniOption::DESIRED_BRIGHTNESS:
|
||||
return RawOption::DESIRED_BRIGHTNESS;
|
||||
case JniOption::IR_CONTROL:
|
||||
return RawOption::IR_CONTROL;
|
||||
case JniOption::HDR_MODE:
|
||||
return RawOption::HDR_MODE;
|
||||
case JniOption::ACCELEROMETER_RANGE:
|
||||
return RawOption::ACCELEROMETER_RANGE;
|
||||
case JniOption::GYROSCOPE_RANGE:
|
||||
return RawOption::GYROSCOPE_RANGE;
|
||||
case JniOption::ACCELEROMETER_LOW_PASS_FILTER:
|
||||
return RawOption::ACCELEROMETER_LOW_PASS_FILTER;
|
||||
case JniOption::GYROSCOPE_LOW_PASS_FILTER:
|
||||
return RawOption::GYROSCOPE_LOW_PASS_FILTER;
|
||||
case JniOption::ZERO_DRIFT_CALIBRATION:
|
||||
return RawOption::ZERO_DRIFT_CALIBRATION;
|
||||
case JniOption::ERASE_CHIP:
|
||||
return RawOption::ERASE_CHIP;
|
||||
default:
|
||||
LOG(FATAL) << "Option is unknown";
|
||||
}
|
||||
}
|
||||
|
||||
inline
|
||||
JniOption to_jni(const RawOption& Option) {
|
||||
switch (Option) {
|
||||
case RawOption::GAIN:
|
||||
return JniOption::GAIN;
|
||||
case RawOption::BRIGHTNESS:
|
||||
return JniOption::BRIGHTNESS;
|
||||
case RawOption::CONTRAST:
|
||||
return JniOption::CONTRAST;
|
||||
case RawOption::FRAME_RATE:
|
||||
return JniOption::FRAME_RATE;
|
||||
case RawOption::IMU_FREQUENCY:
|
||||
return JniOption::IMU_FREQUENCY;
|
||||
case RawOption::EXPOSURE_MODE:
|
||||
return JniOption::EXPOSURE_MODE;
|
||||
case RawOption::MAX_GAIN:
|
||||
return JniOption::MAX_GAIN;
|
||||
case RawOption::MAX_EXPOSURE_TIME:
|
||||
return JniOption::MAX_EXPOSURE_TIME;
|
||||
case RawOption::MIN_EXPOSURE_TIME:
|
||||
return JniOption::MIN_EXPOSURE_TIME;
|
||||
case RawOption::DESIRED_BRIGHTNESS:
|
||||
return JniOption::DESIRED_BRIGHTNESS;
|
||||
case RawOption::IR_CONTROL:
|
||||
return JniOption::IR_CONTROL;
|
||||
case RawOption::HDR_MODE:
|
||||
return JniOption::HDR_MODE;
|
||||
case RawOption::ACCELEROMETER_RANGE:
|
||||
return JniOption::ACCELEROMETER_RANGE;
|
||||
case RawOption::GYROSCOPE_RANGE:
|
||||
return JniOption::GYROSCOPE_RANGE;
|
||||
case RawOption::ACCELEROMETER_LOW_PASS_FILTER:
|
||||
return JniOption::ACCELEROMETER_LOW_PASS_FILTER;
|
||||
case RawOption::GYROSCOPE_LOW_PASS_FILTER:
|
||||
return JniOption::GYROSCOPE_LOW_PASS_FILTER;
|
||||
case RawOption::ZERO_DRIFT_CALIBRATION:
|
||||
return JniOption::ZERO_DRIFT_CALIBRATION;
|
||||
case RawOption::ERASE_CHIP:
|
||||
return JniOption::ERASE_CHIP;
|
||||
default:
|
||||
LOG(FATAL) << "Option is unknown";
|
||||
}
|
||||
}
|
||||
|
||||
// addon
|
||||
|
||||
using RawAddon = MYNTEYE_NAMESPACE::AddOns;
|
||||
using JniAddon = mynteye_jni::Addon;
|
||||
|
||||
inline
|
||||
RawAddon from_jni(const JniAddon& Addon) {
|
||||
switch (Addon) {
|
||||
case JniAddon::INFRARED: return RawAddon::INFRARED;
|
||||
case JniAddon::INFRARED2: return RawAddon::INFRARED2;
|
||||
default:
|
||||
LOG(FATAL) << "Addon is unknown";
|
||||
}
|
||||
}
|
||||
|
||||
inline
|
||||
JniAddon to_jni(const RawAddon& Addon) {
|
||||
switch (Addon) {
|
||||
case RawAddon::INFRARED: return JniAddon::INFRARED;
|
||||
case RawAddon::INFRARED2: return JniAddon::INFRARED2;
|
||||
default:
|
||||
LOG(FATAL) << "Addon is unknown";
|
||||
}
|
||||
}
|
||||
|
||||
// calibration_model
|
||||
|
||||
using RawCalibrationModel = MYNTEYE_NAMESPACE::CalibrationModel;
|
||||
using JniCalibrationModel = mynteye_jni::CalibrationModel;
|
||||
|
||||
inline
|
||||
RawCalibrationModel from_jni(const JniCalibrationModel& CalibrationModel) {
|
||||
switch (CalibrationModel) {
|
||||
case JniCalibrationModel::PINHOLE:
|
||||
return RawCalibrationModel::PINHOLE;
|
||||
case JniCalibrationModel::KANNALA_BRANDT:
|
||||
return RawCalibrationModel::KANNALA_BRANDT;
|
||||
case JniCalibrationModel::UNKNOW:
|
||||
return RawCalibrationModel::UNKNOW;
|
||||
default:
|
||||
LOG(FATAL) << "CalibrationModel is unknown";
|
||||
}
|
||||
}
|
||||
|
||||
inline
|
||||
JniCalibrationModel to_jni(const RawCalibrationModel& CalibrationModel) {
|
||||
switch (CalibrationModel) {
|
||||
case RawCalibrationModel::PINHOLE:
|
||||
return JniCalibrationModel::PINHOLE;
|
||||
case RawCalibrationModel::KANNALA_BRANDT:
|
||||
return JniCalibrationModel::KANNALA_BRANDT;
|
||||
case RawCalibrationModel::UNKNOW:
|
||||
return JniCalibrationModel::UNKNOW;
|
||||
default:
|
||||
LOG(FATAL) << "CalibrationModel is unknown";
|
||||
}
|
||||
}
|
||||
|
||||
// others
|
||||
|
||||
template<int n>
|
||||
std::vector<double> to_vector(double (&vector)[n]) {
|
||||
std::vector<double> datas;
|
||||
for (int i = 0; i < n; i++) {
|
||||
datas.push_back(vector[i]);
|
||||
}
|
||||
return datas;
|
||||
}
|
||||
|
||||
template<int rows, int cols>
|
||||
std::vector<double> to_vector(double (&matrix)[rows][cols]) {
|
||||
std::vector<double> datas;
|
||||
for (int i = 0; i < rows; i++) {
|
||||
for (int j = 0; j < cols; j++) {
|
||||
datas.push_back(matrix[i][j]);
|
||||
}
|
||||
}
|
||||
return datas;
|
||||
}
|
||||
|
||||
} // namespace mynteye_jni
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
// AUTOGENERATED FILE - DO NOT MODIFY!
|
||||
// This file generated by Djinni from mynteye_types.djinni
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "addon.hpp"
|
||||
#include "djinni_support.hpp"
|
||||
|
||||
namespace djinni_generated {
|
||||
|
||||
class NativeAddon final : ::djinni::JniEnum {
|
||||
public:
|
||||
using CppType = ::mynteye_jni::Addon;
|
||||
using JniType = jobject;
|
||||
|
||||
using Boxed = NativeAddon;
|
||||
|
||||
static CppType toCpp(JNIEnv* jniEnv, JniType j) { return static_cast<CppType>(::djinni::JniClass<NativeAddon>::get().ordinal(jniEnv, j)); }
|
||||
static ::djinni::LocalRef<JniType> fromCpp(JNIEnv* jniEnv, CppType c) { return ::djinni::JniClass<NativeAddon>::get().create(jniEnv, static_cast<jint>(c)); }
|
||||
|
||||
private:
|
||||
NativeAddon() : JniEnum("com/slightech/mynteye/Addon") {}
|
||||
friend ::djinni::JniClass<NativeAddon>;
|
||||
};
|
||||
|
||||
} // namespace djinni_generated
|
||||
@@ -0,0 +1,26 @@
|
||||
// AUTOGENERATED FILE - DO NOT MODIFY!
|
||||
// This file generated by Djinni from mynteye_types.djinni
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "calibration_model.hpp"
|
||||
#include "djinni_support.hpp"
|
||||
|
||||
namespace djinni_generated {
|
||||
|
||||
class NativeCalibrationModel final : ::djinni::JniEnum {
|
||||
public:
|
||||
using CppType = ::mynteye_jni::CalibrationModel;
|
||||
using JniType = jobject;
|
||||
|
||||
using Boxed = NativeCalibrationModel;
|
||||
|
||||
static CppType toCpp(JNIEnv* jniEnv, JniType j) { return static_cast<CppType>(::djinni::JniClass<NativeCalibrationModel>::get().ordinal(jniEnv, j)); }
|
||||
static ::djinni::LocalRef<JniType> fromCpp(JNIEnv* jniEnv, CppType c) { return ::djinni::JniClass<NativeCalibrationModel>::get().create(jniEnv, static_cast<jint>(c)); }
|
||||
|
||||
private:
|
||||
NativeCalibrationModel() : JniEnum("com/slightech/mynteye/CalibrationModel") {}
|
||||
friend ::djinni::JniClass<NativeCalibrationModel>;
|
||||
};
|
||||
|
||||
} // namespace djinni_generated
|
||||
@@ -0,0 +1,26 @@
|
||||
// AUTOGENERATED FILE - DO NOT MODIFY!
|
||||
// This file generated by Djinni from mynteye_types.djinni
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "capability.hpp"
|
||||
#include "djinni_support.hpp"
|
||||
|
||||
namespace djinni_generated {
|
||||
|
||||
class NativeCapability final : ::djinni::JniEnum {
|
||||
public:
|
||||
using CppType = ::mynteye_jni::Capability;
|
||||
using JniType = jobject;
|
||||
|
||||
using Boxed = NativeCapability;
|
||||
|
||||
static CppType toCpp(JNIEnv* jniEnv, JniType j) { return static_cast<CppType>(::djinni::JniClass<NativeCapability>::get().ordinal(jniEnv, j)); }
|
||||
static ::djinni::LocalRef<JniType> fromCpp(JNIEnv* jniEnv, CppType c) { return ::djinni::JniClass<NativeCapability>::get().create(jniEnv, static_cast<jint>(c)); }
|
||||
|
||||
private:
|
||||
NativeCapability() : JniEnum("com/slightech/mynteye/Capability") {}
|
||||
friend ::djinni::JniClass<NativeCapability>;
|
||||
};
|
||||
|
||||
} // namespace djinni_generated
|
||||
@@ -3,8 +3,17 @@
|
||||
|
||||
#include "NativeDevice.hpp" // my header
|
||||
#include "Marshal.hpp"
|
||||
#include "NativeAddon.hpp"
|
||||
#include "NativeCapability.hpp"
|
||||
#include "NativeDeviceUsbInfo.hpp"
|
||||
#include "NativeExtrinsics.hpp"
|
||||
#include "NativeInfo.hpp"
|
||||
#include "NativeIntrinsics.hpp"
|
||||
#include "NativeModel.hpp"
|
||||
#include "NativeMotionData.hpp"
|
||||
#include "NativeMotionIntrinsics.hpp"
|
||||
#include "NativeOption.hpp"
|
||||
#include "NativeOptionInfo.hpp"
|
||||
#include "NativeSource.hpp"
|
||||
#include "NativeStream.hpp"
|
||||
#include "NativeStreamData.hpp"
|
||||
@@ -34,6 +43,56 @@ CJNIEXPORT jobject JNICALL Java_com_slightech_mynteye_Device_00024CppProxy_creat
|
||||
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
|
||||
}
|
||||
|
||||
CJNIEXPORT ::djinni_generated::NativeModel::JniType JNICALL Java_com_slightech_mynteye_Device_00024CppProxy_native_1getModel(JNIEnv* jniEnv, jobject /*this*/, jlong nativeRef)
|
||||
{
|
||||
try {
|
||||
DJINNI_FUNCTION_PROLOGUE1(jniEnv, nativeRef);
|
||||
const auto& ref = ::djinni::objectFromHandleAddress<::mynteye_jni::Device>(nativeRef);
|
||||
auto r = ref->GetModel();
|
||||
return ::djinni::release(::djinni_generated::NativeModel::fromCpp(jniEnv, r));
|
||||
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
|
||||
}
|
||||
|
||||
CJNIEXPORT jboolean JNICALL Java_com_slightech_mynteye_Device_00024CppProxy_native_1supportsStream(JNIEnv* jniEnv, jobject /*this*/, jlong nativeRef, ::djinni_generated::NativeStream::JniType j_stream)
|
||||
{
|
||||
try {
|
||||
DJINNI_FUNCTION_PROLOGUE1(jniEnv, nativeRef);
|
||||
const auto& ref = ::djinni::objectFromHandleAddress<::mynteye_jni::Device>(nativeRef);
|
||||
auto r = ref->SupportsStream(::djinni_generated::NativeStream::toCpp(jniEnv, j_stream));
|
||||
return ::djinni::release(::djinni::Bool::fromCpp(jniEnv, r));
|
||||
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
|
||||
}
|
||||
|
||||
CJNIEXPORT jboolean JNICALL Java_com_slightech_mynteye_Device_00024CppProxy_native_1supportsCapability(JNIEnv* jniEnv, jobject /*this*/, jlong nativeRef, ::djinni_generated::NativeCapability::JniType j_capabilities)
|
||||
{
|
||||
try {
|
||||
DJINNI_FUNCTION_PROLOGUE1(jniEnv, nativeRef);
|
||||
const auto& ref = ::djinni::objectFromHandleAddress<::mynteye_jni::Device>(nativeRef);
|
||||
auto r = ref->SupportsCapability(::djinni_generated::NativeCapability::toCpp(jniEnv, j_capabilities));
|
||||
return ::djinni::release(::djinni::Bool::fromCpp(jniEnv, r));
|
||||
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
|
||||
}
|
||||
|
||||
CJNIEXPORT jboolean JNICALL Java_com_slightech_mynteye_Device_00024CppProxy_native_1supportsOption(JNIEnv* jniEnv, jobject /*this*/, jlong nativeRef, ::djinni_generated::NativeOption::JniType j_option)
|
||||
{
|
||||
try {
|
||||
DJINNI_FUNCTION_PROLOGUE1(jniEnv, nativeRef);
|
||||
const auto& ref = ::djinni::objectFromHandleAddress<::mynteye_jni::Device>(nativeRef);
|
||||
auto r = ref->SupportsOption(::djinni_generated::NativeOption::toCpp(jniEnv, j_option));
|
||||
return ::djinni::release(::djinni::Bool::fromCpp(jniEnv, r));
|
||||
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
|
||||
}
|
||||
|
||||
CJNIEXPORT jboolean JNICALL Java_com_slightech_mynteye_Device_00024CppProxy_native_1supportsAddon(JNIEnv* jniEnv, jobject /*this*/, jlong nativeRef, ::djinni_generated::NativeAddon::JniType j_addon)
|
||||
{
|
||||
try {
|
||||
DJINNI_FUNCTION_PROLOGUE1(jniEnv, nativeRef);
|
||||
const auto& ref = ::djinni::objectFromHandleAddress<::mynteye_jni::Device>(nativeRef);
|
||||
auto r = ref->SupportsAddon(::djinni_generated::NativeAddon::toCpp(jniEnv, j_addon));
|
||||
return ::djinni::release(::djinni::Bool::fromCpp(jniEnv, r));
|
||||
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
|
||||
}
|
||||
|
||||
CJNIEXPORT jobject JNICALL Java_com_slightech_mynteye_Device_00024CppProxy_native_1getStreamRequests(JNIEnv* jniEnv, jobject /*this*/, jlong nativeRef)
|
||||
{
|
||||
try {
|
||||
@@ -53,6 +112,97 @@ CJNIEXPORT void JNICALL Java_com_slightech_mynteye_Device_00024CppProxy_native_1
|
||||
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, )
|
||||
}
|
||||
|
||||
CJNIEXPORT jstring JNICALL Java_com_slightech_mynteye_Device_00024CppProxy_native_1getInfo(JNIEnv* jniEnv, jobject /*this*/, jlong nativeRef, ::djinni_generated::NativeInfo::JniType j_info)
|
||||
{
|
||||
try {
|
||||
DJINNI_FUNCTION_PROLOGUE1(jniEnv, nativeRef);
|
||||
const auto& ref = ::djinni::objectFromHandleAddress<::mynteye_jni::Device>(nativeRef);
|
||||
auto r = ref->GetInfo(::djinni_generated::NativeInfo::toCpp(jniEnv, j_info));
|
||||
return ::djinni::release(::djinni::String::fromCpp(jniEnv, r));
|
||||
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
|
||||
}
|
||||
|
||||
CJNIEXPORT ::djinni_generated::NativeIntrinsics::JniType JNICALL Java_com_slightech_mynteye_Device_00024CppProxy_native_1getIntrinsics(JNIEnv* jniEnv, jobject /*this*/, jlong nativeRef, ::djinni_generated::NativeStream::JniType j_stream)
|
||||
{
|
||||
try {
|
||||
DJINNI_FUNCTION_PROLOGUE1(jniEnv, nativeRef);
|
||||
const auto& ref = ::djinni::objectFromHandleAddress<::mynteye_jni::Device>(nativeRef);
|
||||
auto r = ref->GetIntrinsics(::djinni_generated::NativeStream::toCpp(jniEnv, j_stream));
|
||||
return ::djinni::release(::djinni_generated::NativeIntrinsics::fromCpp(jniEnv, r));
|
||||
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
|
||||
}
|
||||
|
||||
CJNIEXPORT ::djinni_generated::NativeExtrinsics::JniType JNICALL Java_com_slightech_mynteye_Device_00024CppProxy_native_1getExtrinsics(JNIEnv* jniEnv, jobject /*this*/, jlong nativeRef, ::djinni_generated::NativeStream::JniType j_from, ::djinni_generated::NativeStream::JniType j_to)
|
||||
{
|
||||
try {
|
||||
DJINNI_FUNCTION_PROLOGUE1(jniEnv, nativeRef);
|
||||
const auto& ref = ::djinni::objectFromHandleAddress<::mynteye_jni::Device>(nativeRef);
|
||||
auto r = ref->GetExtrinsics(::djinni_generated::NativeStream::toCpp(jniEnv, j_from),
|
||||
::djinni_generated::NativeStream::toCpp(jniEnv, j_to));
|
||||
return ::djinni::release(::djinni_generated::NativeExtrinsics::fromCpp(jniEnv, r));
|
||||
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
|
||||
}
|
||||
|
||||
CJNIEXPORT ::djinni_generated::NativeMotionIntrinsics::JniType JNICALL Java_com_slightech_mynteye_Device_00024CppProxy_native_1getMotionIntrinsics(JNIEnv* jniEnv, jobject /*this*/, jlong nativeRef)
|
||||
{
|
||||
try {
|
||||
DJINNI_FUNCTION_PROLOGUE1(jniEnv, nativeRef);
|
||||
const auto& ref = ::djinni::objectFromHandleAddress<::mynteye_jni::Device>(nativeRef);
|
||||
auto r = ref->GetMotionIntrinsics();
|
||||
return ::djinni::release(::djinni_generated::NativeMotionIntrinsics::fromCpp(jniEnv, r));
|
||||
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
|
||||
}
|
||||
|
||||
CJNIEXPORT ::djinni_generated::NativeExtrinsics::JniType JNICALL Java_com_slightech_mynteye_Device_00024CppProxy_native_1getMotionExtrinsics(JNIEnv* jniEnv, jobject /*this*/, jlong nativeRef, ::djinni_generated::NativeStream::JniType j_from)
|
||||
{
|
||||
try {
|
||||
DJINNI_FUNCTION_PROLOGUE1(jniEnv, nativeRef);
|
||||
const auto& ref = ::djinni::objectFromHandleAddress<::mynteye_jni::Device>(nativeRef);
|
||||
auto r = ref->GetMotionExtrinsics(::djinni_generated::NativeStream::toCpp(jniEnv, j_from));
|
||||
return ::djinni::release(::djinni_generated::NativeExtrinsics::fromCpp(jniEnv, r));
|
||||
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
|
||||
}
|
||||
|
||||
CJNIEXPORT ::djinni_generated::NativeOptionInfo::JniType JNICALL Java_com_slightech_mynteye_Device_00024CppProxy_native_1getOptionInfo(JNIEnv* jniEnv, jobject /*this*/, jlong nativeRef, ::djinni_generated::NativeOption::JniType j_option)
|
||||
{
|
||||
try {
|
||||
DJINNI_FUNCTION_PROLOGUE1(jniEnv, nativeRef);
|
||||
const auto& ref = ::djinni::objectFromHandleAddress<::mynteye_jni::Device>(nativeRef);
|
||||
auto r = ref->GetOptionInfo(::djinni_generated::NativeOption::toCpp(jniEnv, j_option));
|
||||
return ::djinni::release(::djinni_generated::NativeOptionInfo::fromCpp(jniEnv, r));
|
||||
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
|
||||
}
|
||||
|
||||
CJNIEXPORT jint JNICALL Java_com_slightech_mynteye_Device_00024CppProxy_native_1getOptionValue(JNIEnv* jniEnv, jobject /*this*/, jlong nativeRef, ::djinni_generated::NativeOption::JniType j_option)
|
||||
{
|
||||
try {
|
||||
DJINNI_FUNCTION_PROLOGUE1(jniEnv, nativeRef);
|
||||
const auto& ref = ::djinni::objectFromHandleAddress<::mynteye_jni::Device>(nativeRef);
|
||||
auto r = ref->GetOptionValue(::djinni_generated::NativeOption::toCpp(jniEnv, j_option));
|
||||
return ::djinni::release(::djinni::I32::fromCpp(jniEnv, r));
|
||||
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
|
||||
}
|
||||
|
||||
CJNIEXPORT void JNICALL Java_com_slightech_mynteye_Device_00024CppProxy_native_1setOptionValue(JNIEnv* jniEnv, jobject /*this*/, jlong nativeRef, ::djinni_generated::NativeOption::JniType j_option, jint j_value)
|
||||
{
|
||||
try {
|
||||
DJINNI_FUNCTION_PROLOGUE1(jniEnv, nativeRef);
|
||||
const auto& ref = ::djinni::objectFromHandleAddress<::mynteye_jni::Device>(nativeRef);
|
||||
ref->SetOptionValue(::djinni_generated::NativeOption::toCpp(jniEnv, j_option),
|
||||
::djinni::I32::toCpp(jniEnv, j_value));
|
||||
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, )
|
||||
}
|
||||
|
||||
CJNIEXPORT jboolean JNICALL Java_com_slightech_mynteye_Device_00024CppProxy_native_1runOptionAction(JNIEnv* jniEnv, jobject /*this*/, jlong nativeRef, ::djinni_generated::NativeOption::JniType j_option)
|
||||
{
|
||||
try {
|
||||
DJINNI_FUNCTION_PROLOGUE1(jniEnv, nativeRef);
|
||||
const auto& ref = ::djinni::objectFromHandleAddress<::mynteye_jni::Device>(nativeRef);
|
||||
auto r = ref->RunOptionAction(::djinni_generated::NativeOption::toCpp(jniEnv, j_option));
|
||||
return ::djinni::release(::djinni::Bool::fromCpp(jniEnv, r));
|
||||
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
|
||||
}
|
||||
|
||||
CJNIEXPORT void JNICALL Java_com_slightech_mynteye_Device_00024CppProxy_native_1start(JNIEnv* jniEnv, jobject /*this*/, jlong nativeRef, ::djinni_generated::NativeSource::JniType j_source)
|
||||
{
|
||||
try {
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
// AUTOGENERATED FILE - DO NOT MODIFY!
|
||||
// This file generated by Djinni from mynteye_types.djinni
|
||||
|
||||
#include "NativeExtrinsics.hpp" // my header
|
||||
#include "Marshal.hpp"
|
||||
|
||||
namespace djinni_generated {
|
||||
|
||||
NativeExtrinsics::NativeExtrinsics() = default;
|
||||
|
||||
NativeExtrinsics::~NativeExtrinsics() = default;
|
||||
|
||||
auto NativeExtrinsics::fromCpp(JNIEnv* jniEnv, const CppType& c) -> ::djinni::LocalRef<JniType> {
|
||||
const auto& data = ::djinni::JniClass<NativeExtrinsics>::get();
|
||||
auto r = ::djinni::LocalRef<JniType>{jniEnv->NewObject(data.clazz.get(), data.jconstructor,
|
||||
::djinni::get(::djinni::List<::djinni::F64>::fromCpp(jniEnv, c.rotation)),
|
||||
::djinni::get(::djinni::List<::djinni::F64>::fromCpp(jniEnv, c.translation)))};
|
||||
::djinni::jniExceptionCheck(jniEnv);
|
||||
return r;
|
||||
}
|
||||
|
||||
auto NativeExtrinsics::toCpp(JNIEnv* jniEnv, JniType j) -> CppType {
|
||||
::djinni::JniLocalScope jscope(jniEnv, 3);
|
||||
assert(j != nullptr);
|
||||
const auto& data = ::djinni::JniClass<NativeExtrinsics>::get();
|
||||
return {::djinni::List<::djinni::F64>::toCpp(jniEnv, jniEnv->GetObjectField(j, data.field_mRotation)),
|
||||
::djinni::List<::djinni::F64>::toCpp(jniEnv, jniEnv->GetObjectField(j, data.field_mTranslation))};
|
||||
}
|
||||
|
||||
} // namespace djinni_generated
|
||||
@@ -0,0 +1,33 @@
|
||||
// AUTOGENERATED FILE - DO NOT MODIFY!
|
||||
// This file generated by Djinni from mynteye_types.djinni
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "djinni_support.hpp"
|
||||
#include "extrinsics.hpp"
|
||||
|
||||
namespace djinni_generated {
|
||||
|
||||
class NativeExtrinsics final {
|
||||
public:
|
||||
using CppType = ::mynteye_jni::Extrinsics;
|
||||
using JniType = jobject;
|
||||
|
||||
using Boxed = NativeExtrinsics;
|
||||
|
||||
~NativeExtrinsics();
|
||||
|
||||
static CppType toCpp(JNIEnv* jniEnv, JniType j);
|
||||
static ::djinni::LocalRef<JniType> fromCpp(JNIEnv* jniEnv, const CppType& c);
|
||||
|
||||
private:
|
||||
NativeExtrinsics();
|
||||
friend ::djinni::JniClass<NativeExtrinsics>;
|
||||
|
||||
const ::djinni::GlobalRef<jclass> clazz { ::djinni::jniFindClass("com/slightech/mynteye/Extrinsics") };
|
||||
const jmethodID jconstructor { ::djinni::jniGetMethodID(clazz.get(), "<init>", "(Ljava/util/ArrayList;Ljava/util/ArrayList;)V") };
|
||||
const jfieldID field_mRotation { ::djinni::jniGetFieldID(clazz.get(), "mRotation", "Ljava/util/ArrayList;") };
|
||||
const jfieldID field_mTranslation { ::djinni::jniGetFieldID(clazz.get(), "mTranslation", "Ljava/util/ArrayList;") };
|
||||
};
|
||||
|
||||
} // namespace djinni_generated
|
||||
@@ -0,0 +1,34 @@
|
||||
// AUTOGENERATED FILE - DO NOT MODIFY!
|
||||
// This file generated by Djinni from mynteye_types.djinni
|
||||
|
||||
#include "NativeImuIntrinsics.hpp" // my header
|
||||
#include "Marshal.hpp"
|
||||
|
||||
namespace djinni_generated {
|
||||
|
||||
NativeImuIntrinsics::NativeImuIntrinsics() = default;
|
||||
|
||||
NativeImuIntrinsics::~NativeImuIntrinsics() = default;
|
||||
|
||||
auto NativeImuIntrinsics::fromCpp(JNIEnv* jniEnv, const CppType& c) -> ::djinni::LocalRef<JniType> {
|
||||
const auto& data = ::djinni::JniClass<NativeImuIntrinsics>::get();
|
||||
auto r = ::djinni::LocalRef<JniType>{jniEnv->NewObject(data.clazz.get(), data.jconstructor,
|
||||
::djinni::get(::djinni::List<::djinni::F64>::fromCpp(jniEnv, c.scale)),
|
||||
::djinni::get(::djinni::List<::djinni::F64>::fromCpp(jniEnv, c.drift)),
|
||||
::djinni::get(::djinni::List<::djinni::F64>::fromCpp(jniEnv, c.noise)),
|
||||
::djinni::get(::djinni::List<::djinni::F64>::fromCpp(jniEnv, c.bias)))};
|
||||
::djinni::jniExceptionCheck(jniEnv);
|
||||
return r;
|
||||
}
|
||||
|
||||
auto NativeImuIntrinsics::toCpp(JNIEnv* jniEnv, JniType j) -> CppType {
|
||||
::djinni::JniLocalScope jscope(jniEnv, 5);
|
||||
assert(j != nullptr);
|
||||
const auto& data = ::djinni::JniClass<NativeImuIntrinsics>::get();
|
||||
return {::djinni::List<::djinni::F64>::toCpp(jniEnv, jniEnv->GetObjectField(j, data.field_mScale)),
|
||||
::djinni::List<::djinni::F64>::toCpp(jniEnv, jniEnv->GetObjectField(j, data.field_mDrift)),
|
||||
::djinni::List<::djinni::F64>::toCpp(jniEnv, jniEnv->GetObjectField(j, data.field_mNoise)),
|
||||
::djinni::List<::djinni::F64>::toCpp(jniEnv, jniEnv->GetObjectField(j, data.field_mBias))};
|
||||
}
|
||||
|
||||
} // namespace djinni_generated
|
||||
@@ -0,0 +1,35 @@
|
||||
// AUTOGENERATED FILE - DO NOT MODIFY!
|
||||
// This file generated by Djinni from mynteye_types.djinni
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "djinni_support.hpp"
|
||||
#include "imu_intrinsics.hpp"
|
||||
|
||||
namespace djinni_generated {
|
||||
|
||||
class NativeImuIntrinsics final {
|
||||
public:
|
||||
using CppType = ::mynteye_jni::ImuIntrinsics;
|
||||
using JniType = jobject;
|
||||
|
||||
using Boxed = NativeImuIntrinsics;
|
||||
|
||||
~NativeImuIntrinsics();
|
||||
|
||||
static CppType toCpp(JNIEnv* jniEnv, JniType j);
|
||||
static ::djinni::LocalRef<JniType> fromCpp(JNIEnv* jniEnv, const CppType& c);
|
||||
|
||||
private:
|
||||
NativeImuIntrinsics();
|
||||
friend ::djinni::JniClass<NativeImuIntrinsics>;
|
||||
|
||||
const ::djinni::GlobalRef<jclass> clazz { ::djinni::jniFindClass("com/slightech/mynteye/ImuIntrinsics") };
|
||||
const jmethodID jconstructor { ::djinni::jniGetMethodID(clazz.get(), "<init>", "(Ljava/util/ArrayList;Ljava/util/ArrayList;Ljava/util/ArrayList;Ljava/util/ArrayList;)V") };
|
||||
const jfieldID field_mScale { ::djinni::jniGetFieldID(clazz.get(), "mScale", "Ljava/util/ArrayList;") };
|
||||
const jfieldID field_mDrift { ::djinni::jniGetFieldID(clazz.get(), "mDrift", "Ljava/util/ArrayList;") };
|
||||
const jfieldID field_mNoise { ::djinni::jniGetFieldID(clazz.get(), "mNoise", "Ljava/util/ArrayList;") };
|
||||
const jfieldID field_mBias { ::djinni::jniGetFieldID(clazz.get(), "mBias", "Ljava/util/ArrayList;") };
|
||||
};
|
||||
|
||||
} // namespace djinni_generated
|
||||
@@ -0,0 +1,26 @@
|
||||
// AUTOGENERATED FILE - DO NOT MODIFY!
|
||||
// This file generated by Djinni from mynteye_types.djinni
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "djinni_support.hpp"
|
||||
#include "info.hpp"
|
||||
|
||||
namespace djinni_generated {
|
||||
|
||||
class NativeInfo final : ::djinni::JniEnum {
|
||||
public:
|
||||
using CppType = ::mynteye_jni::Info;
|
||||
using JniType = jobject;
|
||||
|
||||
using Boxed = NativeInfo;
|
||||
|
||||
static CppType toCpp(JNIEnv* jniEnv, JniType j) { return static_cast<CppType>(::djinni::JniClass<NativeInfo>::get().ordinal(jniEnv, j)); }
|
||||
static ::djinni::LocalRef<JniType> fromCpp(JNIEnv* jniEnv, CppType c) { return ::djinni::JniClass<NativeInfo>::get().create(jniEnv, static_cast<jint>(c)); }
|
||||
|
||||
private:
|
||||
NativeInfo() : JniEnum("com/slightech/mynteye/Info") {}
|
||||
friend ::djinni::JniClass<NativeInfo>;
|
||||
};
|
||||
|
||||
} // namespace djinni_generated
|
||||
@@ -0,0 +1,43 @@
|
||||
// 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
|
||||
@@ -0,0 +1,39 @@
|
||||
// AUTOGENERATED FILE - DO NOT MODIFY!
|
||||
// This file generated by Djinni from mynteye_types.djinni
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "djinni_support.hpp"
|
||||
#include "intrinsics.hpp"
|
||||
|
||||
namespace djinni_generated {
|
||||
|
||||
class NativeIntrinsics final {
|
||||
public:
|
||||
using CppType = ::mynteye_jni::Intrinsics;
|
||||
using JniType = jobject;
|
||||
|
||||
using Boxed = NativeIntrinsics;
|
||||
|
||||
~NativeIntrinsics();
|
||||
|
||||
static CppType toCpp(JNIEnv* jniEnv, JniType j);
|
||||
static ::djinni::LocalRef<JniType> fromCpp(JNIEnv* jniEnv, const CppType& c);
|
||||
|
||||
private:
|
||||
NativeIntrinsics();
|
||||
friend ::djinni::JniClass<NativeIntrinsics>;
|
||||
|
||||
const ::djinni::GlobalRef<jclass> clazz { ::djinni::jniFindClass("com/slightech/mynteye/Intrinsics") };
|
||||
const jmethodID jconstructor { ::djinni::jniGetMethodID(clazz.get(), "<init>", "(Lcom/slightech/mynteye/CalibrationModel;IIDDDDLjava/util/ArrayList;)V") };
|
||||
const jfieldID field_mCalibModel { ::djinni::jniGetFieldID(clazz.get(), "mCalibModel", "Lcom/slightech/mynteye/CalibrationModel;") };
|
||||
const jfieldID field_mWidth { ::djinni::jniGetFieldID(clazz.get(), "mWidth", "I") };
|
||||
const jfieldID field_mHeight { ::djinni::jniGetFieldID(clazz.get(), "mHeight", "I") };
|
||||
const jfieldID field_mFx { ::djinni::jniGetFieldID(clazz.get(), "mFx", "D") };
|
||||
const jfieldID field_mFy { ::djinni::jniGetFieldID(clazz.get(), "mFy", "D") };
|
||||
const jfieldID field_mCx { ::djinni::jniGetFieldID(clazz.get(), "mCx", "D") };
|
||||
const jfieldID field_mCy { ::djinni::jniGetFieldID(clazz.get(), "mCy", "D") };
|
||||
const jfieldID field_mCoeffs { ::djinni::jniGetFieldID(clazz.get(), "mCoeffs", "Ljava/util/ArrayList;") };
|
||||
};
|
||||
|
||||
} // namespace djinni_generated
|
||||
@@ -0,0 +1,30 @@
|
||||
// AUTOGENERATED FILE - DO NOT MODIFY!
|
||||
// This file generated by Djinni from mynteye_types.djinni
|
||||
|
||||
#include "NativeMotionIntrinsics.hpp" // my header
|
||||
#include "NativeImuIntrinsics.hpp"
|
||||
|
||||
namespace djinni_generated {
|
||||
|
||||
NativeMotionIntrinsics::NativeMotionIntrinsics() = default;
|
||||
|
||||
NativeMotionIntrinsics::~NativeMotionIntrinsics() = default;
|
||||
|
||||
auto NativeMotionIntrinsics::fromCpp(JNIEnv* jniEnv, const CppType& c) -> ::djinni::LocalRef<JniType> {
|
||||
const auto& data = ::djinni::JniClass<NativeMotionIntrinsics>::get();
|
||||
auto r = ::djinni::LocalRef<JniType>{jniEnv->NewObject(data.clazz.get(), data.jconstructor,
|
||||
::djinni::get(::djinni_generated::NativeImuIntrinsics::fromCpp(jniEnv, c.accel)),
|
||||
::djinni::get(::djinni_generated::NativeImuIntrinsics::fromCpp(jniEnv, c.gyro)))};
|
||||
::djinni::jniExceptionCheck(jniEnv);
|
||||
return r;
|
||||
}
|
||||
|
||||
auto NativeMotionIntrinsics::toCpp(JNIEnv* jniEnv, JniType j) -> CppType {
|
||||
::djinni::JniLocalScope jscope(jniEnv, 3);
|
||||
assert(j != nullptr);
|
||||
const auto& data = ::djinni::JniClass<NativeMotionIntrinsics>::get();
|
||||
return {::djinni_generated::NativeImuIntrinsics::toCpp(jniEnv, jniEnv->GetObjectField(j, data.field_mAccel)),
|
||||
::djinni_generated::NativeImuIntrinsics::toCpp(jniEnv, jniEnv->GetObjectField(j, data.field_mGyro))};
|
||||
}
|
||||
|
||||
} // namespace djinni_generated
|
||||
@@ -0,0 +1,33 @@
|
||||
// AUTOGENERATED FILE - DO NOT MODIFY!
|
||||
// This file generated by Djinni from mynteye_types.djinni
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "djinni_support.hpp"
|
||||
#include "motion_intrinsics.hpp"
|
||||
|
||||
namespace djinni_generated {
|
||||
|
||||
class NativeMotionIntrinsics final {
|
||||
public:
|
||||
using CppType = ::mynteye_jni::MotionIntrinsics;
|
||||
using JniType = jobject;
|
||||
|
||||
using Boxed = NativeMotionIntrinsics;
|
||||
|
||||
~NativeMotionIntrinsics();
|
||||
|
||||
static CppType toCpp(JNIEnv* jniEnv, JniType j);
|
||||
static ::djinni::LocalRef<JniType> fromCpp(JNIEnv* jniEnv, const CppType& c);
|
||||
|
||||
private:
|
||||
NativeMotionIntrinsics();
|
||||
friend ::djinni::JniClass<NativeMotionIntrinsics>;
|
||||
|
||||
const ::djinni::GlobalRef<jclass> clazz { ::djinni::jniFindClass("com/slightech/mynteye/MotionIntrinsics") };
|
||||
const jmethodID jconstructor { ::djinni::jniGetMethodID(clazz.get(), "<init>", "(Lcom/slightech/mynteye/ImuIntrinsics;Lcom/slightech/mynteye/ImuIntrinsics;)V") };
|
||||
const jfieldID field_mAccel { ::djinni::jniGetFieldID(clazz.get(), "mAccel", "Lcom/slightech/mynteye/ImuIntrinsics;") };
|
||||
const jfieldID field_mGyro { ::djinni::jniGetFieldID(clazz.get(), "mGyro", "Lcom/slightech/mynteye/ImuIntrinsics;") };
|
||||
};
|
||||
|
||||
} // namespace djinni_generated
|
||||
@@ -0,0 +1,26 @@
|
||||
// AUTOGENERATED FILE - DO NOT MODIFY!
|
||||
// This file generated by Djinni from mynteye_types.djinni
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "djinni_support.hpp"
|
||||
#include "option.hpp"
|
||||
|
||||
namespace djinni_generated {
|
||||
|
||||
class NativeOption final : ::djinni::JniEnum {
|
||||
public:
|
||||
using CppType = ::mynteye_jni::Option;
|
||||
using JniType = jobject;
|
||||
|
||||
using Boxed = NativeOption;
|
||||
|
||||
static CppType toCpp(JNIEnv* jniEnv, JniType j) { return static_cast<CppType>(::djinni::JniClass<NativeOption>::get().ordinal(jniEnv, j)); }
|
||||
static ::djinni::LocalRef<JniType> fromCpp(JNIEnv* jniEnv, CppType c) { return ::djinni::JniClass<NativeOption>::get().create(jniEnv, static_cast<jint>(c)); }
|
||||
|
||||
private:
|
||||
NativeOption() : JniEnum("com/slightech/mynteye/Option") {}
|
||||
friend ::djinni::JniClass<NativeOption>;
|
||||
};
|
||||
|
||||
} // namespace djinni_generated
|
||||
@@ -0,0 +1,32 @@
|
||||
// AUTOGENERATED FILE - DO NOT MODIFY!
|
||||
// This file generated by Djinni from mynteye_types.djinni
|
||||
|
||||
#include "NativeOptionInfo.hpp" // my header
|
||||
#include "Marshal.hpp"
|
||||
|
||||
namespace djinni_generated {
|
||||
|
||||
NativeOptionInfo::NativeOptionInfo() = default;
|
||||
|
||||
NativeOptionInfo::~NativeOptionInfo() = default;
|
||||
|
||||
auto NativeOptionInfo::fromCpp(JNIEnv* jniEnv, const CppType& c) -> ::djinni::LocalRef<JniType> {
|
||||
const auto& data = ::djinni::JniClass<NativeOptionInfo>::get();
|
||||
auto r = ::djinni::LocalRef<JniType>{jniEnv->NewObject(data.clazz.get(), data.jconstructor,
|
||||
::djinni::get(::djinni::I32::fromCpp(jniEnv, c.min)),
|
||||
::djinni::get(::djinni::I32::fromCpp(jniEnv, c.max)),
|
||||
::djinni::get(::djinni::I32::fromCpp(jniEnv, c.def)))};
|
||||
::djinni::jniExceptionCheck(jniEnv);
|
||||
return r;
|
||||
}
|
||||
|
||||
auto NativeOptionInfo::toCpp(JNIEnv* jniEnv, JniType j) -> CppType {
|
||||
::djinni::JniLocalScope jscope(jniEnv, 4);
|
||||
assert(j != nullptr);
|
||||
const auto& data = ::djinni::JniClass<NativeOptionInfo>::get();
|
||||
return {::djinni::I32::toCpp(jniEnv, jniEnv->GetIntField(j, data.field_mMin)),
|
||||
::djinni::I32::toCpp(jniEnv, jniEnv->GetIntField(j, data.field_mMax)),
|
||||
::djinni::I32::toCpp(jniEnv, jniEnv->GetIntField(j, data.field_mDef))};
|
||||
}
|
||||
|
||||
} // namespace djinni_generated
|
||||
@@ -0,0 +1,34 @@
|
||||
// AUTOGENERATED FILE - DO NOT MODIFY!
|
||||
// This file generated by Djinni from mynteye_types.djinni
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "djinni_support.hpp"
|
||||
#include "option_info.hpp"
|
||||
|
||||
namespace djinni_generated {
|
||||
|
||||
class NativeOptionInfo final {
|
||||
public:
|
||||
using CppType = ::mynteye_jni::OptionInfo;
|
||||
using JniType = jobject;
|
||||
|
||||
using Boxed = NativeOptionInfo;
|
||||
|
||||
~NativeOptionInfo();
|
||||
|
||||
static CppType toCpp(JNIEnv* jniEnv, JniType j);
|
||||
static ::djinni::LocalRef<JniType> fromCpp(JNIEnv* jniEnv, const CppType& c);
|
||||
|
||||
private:
|
||||
NativeOptionInfo();
|
||||
friend ::djinni::JniClass<NativeOptionInfo>;
|
||||
|
||||
const ::djinni::GlobalRef<jclass> clazz { ::djinni::jniFindClass("com/slightech/mynteye/OptionInfo") };
|
||||
const jmethodID jconstructor { ::djinni::jniGetMethodID(clazz.get(), "<init>", "(III)V") };
|
||||
const jfieldID field_mMin { ::djinni::jniGetFieldID(clazz.get(), "mMin", "I") };
|
||||
const jfieldID field_mMax { ::djinni::jniGetFieldID(clazz.get(), "mMax", "I") };
|
||||
const jfieldID field_mDef { ::djinni::jniGetFieldID(clazz.get(), "mDef", "I") };
|
||||
};
|
||||
|
||||
} // namespace djinni_generated
|
||||
@@ -0,0 +1,16 @@
|
||||
// AUTOGENERATED FILE - DO NOT MODIFY!
|
||||
// This file generated by Djinni from mynteye_types.djinni
|
||||
|
||||
package com.slightech.mynteye;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
/** Add-On are peripheral modules of our hardware */
|
||||
public enum Addon {
|
||||
/** Infrared */
|
||||
INFRARED,
|
||||
/** Second infrared */
|
||||
INFRARED2,
|
||||
;
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
// AUTOGENERATED FILE - DO NOT MODIFY!
|
||||
// This file generated by Djinni from mynteye_types.djinni
|
||||
|
||||
package com.slightech.mynteye;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
/** Camera calibration model */
|
||||
public enum CalibrationModel {
|
||||
/** Pinhole */
|
||||
PINHOLE,
|
||||
/** Equidistant: KANNALA_BRANDT */
|
||||
KANNALA_BRANDT,
|
||||
/** Unknow */
|
||||
UNKNOW,
|
||||
;
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// AUTOGENERATED FILE - DO NOT MODIFY!
|
||||
// This file generated by Djinni from mynteye_types.djinni
|
||||
|
||||
package com.slightech.mynteye;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* Capabilities define the full set of functionality that the device
|
||||
* might provide
|
||||
*/
|
||||
public enum Capability {
|
||||
/** Provides stereo stream */
|
||||
STEREO,
|
||||
/** Provide stereo color stream */
|
||||
STEREO_COLOR,
|
||||
/** Provides color stream */
|
||||
COLOR,
|
||||
/** Provides depth stream */
|
||||
DEPTH,
|
||||
/** Provides point cloud stream */
|
||||
POINTS,
|
||||
/** Provides fisheye stream */
|
||||
FISHEYE,
|
||||
/** Provides infrared stream */
|
||||
INFRARED,
|
||||
/** Provides second infrared stream */
|
||||
INFRARED2,
|
||||
/** Provides IMU (accelerometer, gyroscope) data */
|
||||
IMU,
|
||||
;
|
||||
}
|
||||
@@ -10,6 +10,22 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
/** Device class to communicate with MYNT® EYE device */
|
||||
public interface Device {
|
||||
/** Get the model */
|
||||
@NonNull
|
||||
public com.slightech.mynteye.Model getModel();
|
||||
|
||||
/** Supports the stream or not */
|
||||
public boolean supportsStream(@NonNull com.slightech.mynteye.Stream stream);
|
||||
|
||||
/** Supports the capability or not */
|
||||
public boolean supportsCapability(@NonNull com.slightech.mynteye.Capability capabilities);
|
||||
|
||||
/** Supports the option or not */
|
||||
public boolean supportsOption(@NonNull com.slightech.mynteye.Option option);
|
||||
|
||||
/** Supports the addon or not */
|
||||
public boolean supportsAddon(@NonNull com.slightech.mynteye.Addon addon);
|
||||
|
||||
/** Get all stream requests */
|
||||
@NonNull
|
||||
public ArrayList<com.slightech.mynteye.StreamRequest> getStreamRequests();
|
||||
@@ -17,6 +33,39 @@ public interface Device {
|
||||
/** Config the stream request */
|
||||
public void configStreamRequest(@NonNull com.slightech.mynteye.StreamRequest request);
|
||||
|
||||
/** Get the device info */
|
||||
@NonNull
|
||||
public String getInfo(@NonNull com.slightech.mynteye.Info info);
|
||||
|
||||
/** Get the intrinsics of stream */
|
||||
@NonNull
|
||||
public com.slightech.mynteye.Intrinsics getIntrinsics(@NonNull com.slightech.mynteye.Stream stream);
|
||||
|
||||
/** Get the extrinsics of stream */
|
||||
@NonNull
|
||||
public com.slightech.mynteye.Extrinsics getExtrinsics(@NonNull com.slightech.mynteye.Stream from, @NonNull com.slightech.mynteye.Stream to);
|
||||
|
||||
/** Get the intrinsics of motion */
|
||||
@NonNull
|
||||
public com.slightech.mynteye.MotionIntrinsics getMotionIntrinsics();
|
||||
|
||||
/** Get the extrinsics from one stream to motion */
|
||||
@NonNull
|
||||
public com.slightech.mynteye.Extrinsics getMotionExtrinsics(@NonNull com.slightech.mynteye.Stream from);
|
||||
|
||||
/** Get the option info */
|
||||
@NonNull
|
||||
public com.slightech.mynteye.OptionInfo getOptionInfo(@NonNull com.slightech.mynteye.Option option);
|
||||
|
||||
/** Get the option value */
|
||||
public int getOptionValue(@NonNull com.slightech.mynteye.Option option);
|
||||
|
||||
/** Set the option value */
|
||||
public void setOptionValue(@NonNull com.slightech.mynteye.Option option, int value);
|
||||
|
||||
/** Run the option value */
|
||||
public boolean runOptionAction(@NonNull com.slightech.mynteye.Option option);
|
||||
|
||||
/** Start capturing the source */
|
||||
public void start(@NonNull com.slightech.mynteye.Source source);
|
||||
|
||||
@@ -71,6 +120,46 @@ public interface Device {
|
||||
super.finalize();
|
||||
}
|
||||
|
||||
@Override
|
||||
public com.slightech.mynteye.Model getModel()
|
||||
{
|
||||
assert !this.destroyed.get() : "trying to use a destroyed object";
|
||||
return native_getModel(this.nativeRef);
|
||||
}
|
||||
private native com.slightech.mynteye.Model native_getModel(long _nativeRef);
|
||||
|
||||
@Override
|
||||
public boolean supportsStream(com.slightech.mynteye.Stream stream)
|
||||
{
|
||||
assert !this.destroyed.get() : "trying to use a destroyed object";
|
||||
return native_supportsStream(this.nativeRef, stream);
|
||||
}
|
||||
private native boolean native_supportsStream(long _nativeRef, com.slightech.mynteye.Stream stream);
|
||||
|
||||
@Override
|
||||
public boolean supportsCapability(com.slightech.mynteye.Capability capabilities)
|
||||
{
|
||||
assert !this.destroyed.get() : "trying to use a destroyed object";
|
||||
return native_supportsCapability(this.nativeRef, capabilities);
|
||||
}
|
||||
private native boolean native_supportsCapability(long _nativeRef, com.slightech.mynteye.Capability capabilities);
|
||||
|
||||
@Override
|
||||
public boolean supportsOption(com.slightech.mynteye.Option option)
|
||||
{
|
||||
assert !this.destroyed.get() : "trying to use a destroyed object";
|
||||
return native_supportsOption(this.nativeRef, option);
|
||||
}
|
||||
private native boolean native_supportsOption(long _nativeRef, com.slightech.mynteye.Option option);
|
||||
|
||||
@Override
|
||||
public boolean supportsAddon(com.slightech.mynteye.Addon addon)
|
||||
{
|
||||
assert !this.destroyed.get() : "trying to use a destroyed object";
|
||||
return native_supportsAddon(this.nativeRef, addon);
|
||||
}
|
||||
private native boolean native_supportsAddon(long _nativeRef, com.slightech.mynteye.Addon addon);
|
||||
|
||||
@Override
|
||||
public ArrayList<com.slightech.mynteye.StreamRequest> getStreamRequests()
|
||||
{
|
||||
@@ -87,6 +176,78 @@ public interface Device {
|
||||
}
|
||||
private native void native_configStreamRequest(long _nativeRef, com.slightech.mynteye.StreamRequest request);
|
||||
|
||||
@Override
|
||||
public String getInfo(com.slightech.mynteye.Info info)
|
||||
{
|
||||
assert !this.destroyed.get() : "trying to use a destroyed object";
|
||||
return native_getInfo(this.nativeRef, info);
|
||||
}
|
||||
private native String native_getInfo(long _nativeRef, com.slightech.mynteye.Info info);
|
||||
|
||||
@Override
|
||||
public com.slightech.mynteye.Intrinsics getIntrinsics(com.slightech.mynteye.Stream stream)
|
||||
{
|
||||
assert !this.destroyed.get() : "trying to use a destroyed object";
|
||||
return native_getIntrinsics(this.nativeRef, stream);
|
||||
}
|
||||
private native com.slightech.mynteye.Intrinsics native_getIntrinsics(long _nativeRef, com.slightech.mynteye.Stream stream);
|
||||
|
||||
@Override
|
||||
public com.slightech.mynteye.Extrinsics getExtrinsics(com.slightech.mynteye.Stream from, com.slightech.mynteye.Stream to)
|
||||
{
|
||||
assert !this.destroyed.get() : "trying to use a destroyed object";
|
||||
return native_getExtrinsics(this.nativeRef, from, to);
|
||||
}
|
||||
private native com.slightech.mynteye.Extrinsics native_getExtrinsics(long _nativeRef, com.slightech.mynteye.Stream from, com.slightech.mynteye.Stream to);
|
||||
|
||||
@Override
|
||||
public com.slightech.mynteye.MotionIntrinsics getMotionIntrinsics()
|
||||
{
|
||||
assert !this.destroyed.get() : "trying to use a destroyed object";
|
||||
return native_getMotionIntrinsics(this.nativeRef);
|
||||
}
|
||||
private native com.slightech.mynteye.MotionIntrinsics native_getMotionIntrinsics(long _nativeRef);
|
||||
|
||||
@Override
|
||||
public com.slightech.mynteye.Extrinsics getMotionExtrinsics(com.slightech.mynteye.Stream from)
|
||||
{
|
||||
assert !this.destroyed.get() : "trying to use a destroyed object";
|
||||
return native_getMotionExtrinsics(this.nativeRef, from);
|
||||
}
|
||||
private native com.slightech.mynteye.Extrinsics native_getMotionExtrinsics(long _nativeRef, com.slightech.mynteye.Stream from);
|
||||
|
||||
@Override
|
||||
public com.slightech.mynteye.OptionInfo getOptionInfo(com.slightech.mynteye.Option option)
|
||||
{
|
||||
assert !this.destroyed.get() : "trying to use a destroyed object";
|
||||
return native_getOptionInfo(this.nativeRef, option);
|
||||
}
|
||||
private native com.slightech.mynteye.OptionInfo native_getOptionInfo(long _nativeRef, com.slightech.mynteye.Option option);
|
||||
|
||||
@Override
|
||||
public int getOptionValue(com.slightech.mynteye.Option option)
|
||||
{
|
||||
assert !this.destroyed.get() : "trying to use a destroyed object";
|
||||
return native_getOptionValue(this.nativeRef, option);
|
||||
}
|
||||
private native int native_getOptionValue(long _nativeRef, com.slightech.mynteye.Option option);
|
||||
|
||||
@Override
|
||||
public void setOptionValue(com.slightech.mynteye.Option option, int value)
|
||||
{
|
||||
assert !this.destroyed.get() : "trying to use a destroyed object";
|
||||
native_setOptionValue(this.nativeRef, option, value);
|
||||
}
|
||||
private native void native_setOptionValue(long _nativeRef, com.slightech.mynteye.Option option, int value);
|
||||
|
||||
@Override
|
||||
public boolean runOptionAction(com.slightech.mynteye.Option option)
|
||||
{
|
||||
assert !this.destroyed.get() : "trying to use a destroyed object";
|
||||
return native_runOptionAction(this.nativeRef, option);
|
||||
}
|
||||
private native boolean native_runOptionAction(long _nativeRef, com.slightech.mynteye.Option option);
|
||||
|
||||
@Override
|
||||
public void start(com.slightech.mynteye.Source source)
|
||||
{
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
// AUTOGENERATED FILE - DO NOT MODIFY!
|
||||
// This file generated by Djinni from mynteye_types.djinni
|
||||
|
||||
package com.slightech.mynteye;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/** Extrinsics, represent how the different datas are connected */
|
||||
public final class Extrinsics {
|
||||
|
||||
|
||||
/*package*/ final ArrayList<Double> mRotation;
|
||||
|
||||
/*package*/ final ArrayList<Double> mTranslation;
|
||||
|
||||
public Extrinsics(
|
||||
@NonNull ArrayList<Double> rotation,
|
||||
@NonNull ArrayList<Double> translation) {
|
||||
this.mRotation = rotation;
|
||||
this.mTranslation = translation;
|
||||
}
|
||||
|
||||
/** Rotation matrix, 3x3 */
|
||||
@NonNull
|
||||
public ArrayList<Double> getRotation() {
|
||||
return mRotation;
|
||||
}
|
||||
|
||||
/** Translation vector, 1x3 */
|
||||
@NonNull
|
||||
public ArrayList<Double> getTranslation() {
|
||||
return mTranslation;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Extrinsics{" +
|
||||
"mRotation=" + mRotation +
|
||||
"," + "mTranslation=" + mTranslation +
|
||||
"}";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
// AUTOGENERATED FILE - DO NOT MODIFY!
|
||||
// This file generated by Djinni from mynteye_types.djinni
|
||||
|
||||
package com.slightech.mynteye;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/** IMU intrinsics: scale, drift and variances */
|
||||
public final class ImuIntrinsics {
|
||||
|
||||
|
||||
/*package*/ final ArrayList<Double> mScale;
|
||||
|
||||
/*package*/ final ArrayList<Double> mDrift;
|
||||
|
||||
/*package*/ final ArrayList<Double> mNoise;
|
||||
|
||||
/*package*/ final ArrayList<Double> mBias;
|
||||
|
||||
public ImuIntrinsics(
|
||||
@NonNull ArrayList<Double> scale,
|
||||
@NonNull ArrayList<Double> drift,
|
||||
@NonNull ArrayList<Double> noise,
|
||||
@NonNull ArrayList<Double> bias) {
|
||||
this.mScale = scale;
|
||||
this.mDrift = drift;
|
||||
this.mNoise = noise;
|
||||
this.mBias = bias;
|
||||
}
|
||||
|
||||
/**
|
||||
* Scale matrix 3x3
|
||||
* Scale X cross axis cross axis
|
||||
* cross axis Scale Y cross axis
|
||||
* cross axis cross axis Scale Z
|
||||
*/
|
||||
@NonNull
|
||||
public ArrayList<Double> getScale() {
|
||||
return mScale;
|
||||
}
|
||||
|
||||
/** Zero-drift: X, Y, Z 1x3 */
|
||||
@NonNull
|
||||
public ArrayList<Double> getDrift() {
|
||||
return mDrift;
|
||||
}
|
||||
|
||||
/** Noise density variances 1x3 */
|
||||
@NonNull
|
||||
public ArrayList<Double> getNoise() {
|
||||
return mNoise;
|
||||
}
|
||||
|
||||
/** Random walk variances 1x3 */
|
||||
@NonNull
|
||||
public ArrayList<Double> getBias() {
|
||||
return mBias;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ImuIntrinsics{" +
|
||||
"mScale=" + mScale +
|
||||
"," + "mDrift=" + mDrift +
|
||||
"," + "mNoise=" + mNoise +
|
||||
"," + "mBias=" + mBias +
|
||||
"}";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
// AUTOGENERATED FILE - DO NOT MODIFY!
|
||||
// This file generated by Djinni from mynteye_types.djinni
|
||||
|
||||
package com.slightech.mynteye;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
/** Camera info fields are read-only strings that can be queried from the device */
|
||||
public enum Info {
|
||||
/** Device name */
|
||||
DEVICE_NAME,
|
||||
/** Serial number */
|
||||
SERIAL_NUMBER,
|
||||
/** Firmware version */
|
||||
FIRMWARE_VERSION,
|
||||
/** Hardware version */
|
||||
HARDWARE_VERSION,
|
||||
/** Spec version */
|
||||
SPEC_VERSION,
|
||||
/** Lens type */
|
||||
LENS_TYPE,
|
||||
/** IMU type */
|
||||
IMU_TYPE,
|
||||
/** Nominal baseline */
|
||||
NOMINAL_BASELINE,
|
||||
;
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
// AUTOGENERATED FILE - DO NOT MODIFY!
|
||||
// This file generated by Djinni from mynteye_types.djinni
|
||||
|
||||
package com.slightech.mynteye;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/** Stream intrinsics */
|
||||
public final class Intrinsics {
|
||||
|
||||
|
||||
/*package*/ final CalibrationModel mCalibModel;
|
||||
|
||||
/*package*/ final int mWidth;
|
||||
|
||||
/*package*/ final int mHeight;
|
||||
|
||||
/*package*/ final double mFx;
|
||||
|
||||
/*package*/ final double mFy;
|
||||
|
||||
/*package*/ final double mCx;
|
||||
|
||||
/*package*/ final double mCy;
|
||||
|
||||
/*package*/ final ArrayList<Double> mCoeffs;
|
||||
|
||||
public Intrinsics(
|
||||
@NonNull CalibrationModel calibModel,
|
||||
int width,
|
||||
int height,
|
||||
double fx,
|
||||
double fy,
|
||||
double cx,
|
||||
double cy,
|
||||
@NonNull ArrayList<Double> coeffs) {
|
||||
this.mCalibModel = calibModel;
|
||||
this.mWidth = width;
|
||||
this.mHeight = height;
|
||||
this.mFx = fx;
|
||||
this.mFy = fy;
|
||||
this.mCx = cx;
|
||||
this.mCy = cy;
|
||||
this.mCoeffs = coeffs;
|
||||
}
|
||||
|
||||
/** The calibration model */
|
||||
@NonNull
|
||||
public CalibrationModel getCalibModel() {
|
||||
return mCalibModel;
|
||||
}
|
||||
|
||||
/** The width of the image in pixels */
|
||||
public int getWidth() {
|
||||
return mWidth;
|
||||
}
|
||||
|
||||
/** The height of the image in pixels */
|
||||
public int getHeight() {
|
||||
return mHeight;
|
||||
}
|
||||
|
||||
/** The focal length of the image plane, as a multiple of pixel width (pinhole) */
|
||||
public double getFx() {
|
||||
return mFx;
|
||||
}
|
||||
|
||||
/** The focal length of the image plane, as a multiple of pixel height (pinhole) */
|
||||
public double getFy() {
|
||||
return mFy;
|
||||
}
|
||||
|
||||
/** The horizontal coordinate of the principal point of the image (pinhole) */
|
||||
public double getCx() {
|
||||
return mCx;
|
||||
}
|
||||
|
||||
/** The vertical coordinate of the principal point of the image (pinhole) */
|
||||
public double getCy() {
|
||||
return mCy;
|
||||
}
|
||||
|
||||
/**
|
||||
* The distortion coefficients
|
||||
* pinhole: k1,k2,p1,p2,k3
|
||||
* kannala_brandt: k2,k3,k4,k5,mu,mv,u0,v0
|
||||
*/
|
||||
@NonNull
|
||||
public ArrayList<Double> getCoeffs() {
|
||||
return mCoeffs;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Intrinsics{" +
|
||||
"mCalibModel=" + mCalibModel +
|
||||
"," + "mWidth=" + mWidth +
|
||||
"," + "mHeight=" + mHeight +
|
||||
"," + "mFx=" + mFx +
|
||||
"," + "mFy=" + mFy +
|
||||
"," + "mCx=" + mCx +
|
||||
"," + "mCy=" + mCy +
|
||||
"," + "mCoeffs=" + mCoeffs +
|
||||
"}";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
// AUTOGENERATED FILE - DO NOT MODIFY!
|
||||
// This file generated by Djinni from mynteye_types.djinni
|
||||
|
||||
package com.slightech.mynteye;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
/** Motion intrinsics, including accelerometer and gyroscope */
|
||||
public final class MotionIntrinsics {
|
||||
|
||||
|
||||
/*package*/ final ImuIntrinsics mAccel;
|
||||
|
||||
/*package*/ final ImuIntrinsics mGyro;
|
||||
|
||||
public MotionIntrinsics(
|
||||
@NonNull ImuIntrinsics accel,
|
||||
@NonNull ImuIntrinsics gyro) {
|
||||
this.mAccel = accel;
|
||||
this.mGyro = gyro;
|
||||
}
|
||||
|
||||
/** Accelerometer intrinsics */
|
||||
@NonNull
|
||||
public ImuIntrinsics getAccel() {
|
||||
return mAccel;
|
||||
}
|
||||
|
||||
/** Gyroscope intrinsics */
|
||||
@NonNull
|
||||
public ImuIntrinsics getGyro() {
|
||||
return mGyro;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MotionIntrinsics{" +
|
||||
"mAccel=" + mAccel +
|
||||
"," + "mGyro=" + mGyro +
|
||||
"}";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
// AUTOGENERATED FILE - DO NOT MODIFY!
|
||||
// This file generated by Djinni from mynteye_types.djinni
|
||||
|
||||
package com.slightech.mynteye;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
/** Camera control options define general configuration controls */
|
||||
public enum Option {
|
||||
/**
|
||||
* Image gain, valid if manual-exposure
|
||||
* range: [0,48], default: 24
|
||||
*/
|
||||
GAIN,
|
||||
/**
|
||||
* Image brightness, valid if manual-exposure
|
||||
* range: [0,240], default: 120
|
||||
*/
|
||||
BRIGHTNESS,
|
||||
/**
|
||||
* Image contrast, valid if manual-exposure
|
||||
* range: [0,255], default: 127
|
||||
*/
|
||||
CONTRAST,
|
||||
/**
|
||||
* Image frame rate, must set IMU_FREQUENCY together
|
||||
* values: {10,15,20,25,30,35,40,45,50,55,60}, default: 25
|
||||
*/
|
||||
FRAME_RATE,
|
||||
/**
|
||||
* IMU frequency, must set FRAME_RATE together
|
||||
* values: {100,200,250,333,500}, default: 200
|
||||
*/
|
||||
IMU_FREQUENCY,
|
||||
/**
|
||||
* Exposure mode
|
||||
* 0: enable auto-exposure
|
||||
* 1: disable auto-exposure (manual-exposure)
|
||||
*/
|
||||
EXPOSURE_MODE,
|
||||
/**
|
||||
* Max gain, valid if auto-exposure
|
||||
* range of standard 1: [0,48], default: 48
|
||||
* range of standard 2: [0,255], default: 8
|
||||
*/
|
||||
MAX_GAIN,
|
||||
/**
|
||||
* Max exposure time, valid if auto-exposure
|
||||
* range of standard 1: [0,240], default: 240
|
||||
* range of standard 2: [0,1000], default: 333
|
||||
*/
|
||||
MAX_EXPOSURE_TIME,
|
||||
/**
|
||||
* min exposure time, valid if auto-exposure
|
||||
* range: [0,1000], default: 0
|
||||
*/
|
||||
MIN_EXPOSURE_TIME,
|
||||
/**
|
||||
* Desired brightness, valid if auto-exposure
|
||||
* range of standard 1: [0,255], default: 192
|
||||
* range of standard 2: [1,255], default: 122
|
||||
*/
|
||||
DESIRED_BRIGHTNESS,
|
||||
/**
|
||||
* IR control
|
||||
* range: [0,160], default: 0
|
||||
*/
|
||||
IR_CONTROL,
|
||||
/**
|
||||
* HDR mode
|
||||
* 0: 10-bit
|
||||
* 1: 12-bit
|
||||
*/
|
||||
HDR_MODE,
|
||||
/**
|
||||
* The range of accelerometer
|
||||
* value of standard 1: {4,8,16,32}, default: 8
|
||||
* value of standard 2: {6,12,24,48}, default: 12
|
||||
*/
|
||||
ACCELEROMETER_RANGE,
|
||||
/**
|
||||
* The range of gyroscope
|
||||
* value of standard 1: {500,1000,2000,4000}, default: 1000
|
||||
* value of standard 2: {250,500,1000,2000,4000}, default: 1000
|
||||
*/
|
||||
GYROSCOPE_RANGE,
|
||||
/**
|
||||
* The parameter of accelerometer low pass filter
|
||||
* values: {0,1,2}, default: 2
|
||||
*/
|
||||
ACCELEROMETER_LOW_PASS_FILTER,
|
||||
/**
|
||||
* The parameter of gyroscope low pass filter
|
||||
* values: {23,64}, default: 64
|
||||
*/
|
||||
GYROSCOPE_LOW_PASS_FILTER,
|
||||
/** Zero drift calibration */
|
||||
ZERO_DRIFT_CALIBRATION,
|
||||
/** Erase chip */
|
||||
ERASE_CHIP,
|
||||
;
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
// AUTOGENERATED FILE - DO NOT MODIFY!
|
||||
// This file generated by Djinni from mynteye_types.djinni
|
||||
|
||||
package com.slightech.mynteye;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
/** Option info */
|
||||
public final class OptionInfo {
|
||||
|
||||
|
||||
/*package*/ final int mMin;
|
||||
|
||||
/*package*/ final int mMax;
|
||||
|
||||
/*package*/ final int mDef;
|
||||
|
||||
public OptionInfo(
|
||||
int min,
|
||||
int max,
|
||||
int def) {
|
||||
this.mMin = min;
|
||||
this.mMax = max;
|
||||
this.mDef = def;
|
||||
}
|
||||
|
||||
/** Minimum value */
|
||||
public int getMin() {
|
||||
return mMin;
|
||||
}
|
||||
|
||||
/** Maximum value */
|
||||
public int getMax() {
|
||||
return mMax;
|
||||
}
|
||||
|
||||
/** Default value */
|
||||
public int getDef() {
|
||||
return mDef;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "OptionInfo{" +
|
||||
"mMin=" + mMin +
|
||||
"," + "mMax=" + mMax +
|
||||
"," + "mDef=" + mDef +
|
||||
"}";
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user