diff options
| author | Jacob Palecki <[email protected]> | 2021-04-09 16:27:32 -0700 |
|---|---|---|
| committer | Jacob Palecki <[email protected]> | 2021-04-09 16:27:32 -0700 |
| commit | 060b79bda0b656bd9aec253389706681a565443e (patch) | |
| tree | 93c7246b34873dc694b064f7b8b2a2bf560a9ea8 /wrapper | |
| parent | Fixed some bugs (diff) | |
| download | rawaccel-060b79bda0b656bd9aec253389706681a565443e.tar.xz rawaccel-060b79bda0b656bd9aec253389706681a565443e.zip | |
Some more small additions and fixes
Diffstat (limited to 'wrapper')
| -rw-r--r-- | wrapper/wrapper.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/wrapper/wrapper.cpp b/wrapper/wrapper.cpp index 74e8683..1f27415 100644 --- a/wrapper/wrapper.cpp +++ b/wrapper/wrapper.cpp @@ -178,6 +178,20 @@ public ref struct ArbitraryLut sealed : public LutBase array<float, 2>^ data; + ArbitraryLut() + { + } + + ArbitraryLut(const ra::arbitrary_lut& table) + { + mode = Mode::arbitrary; + transfer = true; + data = gcnew array<float, 2>(table.last_arbitrary_index + 1, 2); + + pin_ptr<float> pdata = &data[0,0]; + std::memcpy(pdata, &table.raw_data_in, sizeof(float) * 2 * (table.last_arbitrary_index + 1)); + } + virtual void SetArgs(TableArgs% args) override { args.mode = TableMode::arbitrary; @@ -565,7 +579,7 @@ private: case ra::table_mode::off: return nullptr; case ra::table_mode::linear: return gcnew LinearLut(au.lin_lut); case ra::table_mode::binlog: return gcnew BinLogLut(au.log_lut); - case ra::table_mode::arbitrary: + case ra::table_mode::arbitrary: return gcnew ArbitraryLut(au.arb_lut); default: throw gcnew NotImplementedException(); } } |