diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2022-05-26 21:43:30 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-06-05 14:44:25 +0200 |
commit | 21a3c7028b51378577410028a0394753ba45c2e7 (patch) | |
tree | 15542f096b002c0ee046d52e399033c09bc37e2d /tracker-trackhat/settings.cpp | |
parent | f045b65d7e3f2d65195e02c4b6097f2c9886222c (diff) |
tracker/trackhat: add back gain slider
Diffstat (limited to 'tracker-trackhat/settings.cpp')
-rw-r--r-- | tracker-trackhat/settings.cpp | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/tracker-trackhat/settings.cpp b/tracker-trackhat/settings.cpp index 71ab17d2..955d6511 100644 --- a/tracker-trackhat/settings.cpp +++ b/tracker-trackhat/settings.cpp @@ -7,14 +7,6 @@ namespace trackhat_impl { trackhat_settings::trackhat_settings() : opts{"tracker-trackhat"} { } -int trackhat_settings::effective_exposure() const -{ - return std::clamp((int)*exposure, min_exposure, max_exposure); -} -int trackhat_settings::effective_gain() const -{ - return min_gain + std::clamp((int)*exposure - max_exposure, 0, max_gain - min_gain); -} void setting_receiver::settings_changed() { @@ -92,12 +84,12 @@ void trackhat_camera::set_pt_options() bool trackhat_camera::init_regs() { - auto exp = (uint8_t)t.effective_exposure(); + auto exp = (uint8_t)t.exposure; auto exp2 = (uint8_t)(exp == 0xff ? 0xf0 : 0xff); auto thres = (uint8_t)0xfe; auto thres2 = (uint8_t)3; - auto gain = (uint8_t)t.effective_gain(); + auto gain = (uint8_t)t.gain; auto gain_c = (uint8_t)(gain/0x10); gain %= 0x10; gain_c %= 4; |