From 8a78a48dfda981cb1b29b08b7d62a1053919995b Mon Sep 17 00:00:00 2001 From: Dan Paulat Date: Sun, 25 Feb 2024 18:19:59 -0600 Subject: [PATCH] Add log parameters to color table change detection --- .../scwx/qt/view/level3_product_view.cpp | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/scwx-qt/source/scwx/qt/view/level3_product_view.cpp b/scwx-qt/source/scwx/qt/view/level3_product_view.cpp index 099e3fac..a749ec18 100644 --- a/scwx-qt/source/scwx/qt/view/level3_product_view.cpp +++ b/scwx-qt/source/scwx/qt/view/level3_product_view.cpp @@ -56,8 +56,11 @@ public: uint16_t colorTableMax_; std::shared_ptr savedColorTable_; - float savedScale_; - float savedOffset_; + float savedScale_ {1.0f}; + float savedOffset_ {0.0f}; + std::uint16_t savedLogStart_ {20u}; + float savedLogScale_ {1.0f}; + float savedLogOffset_ {0.0f}; }; Level3ProductView::Level3ProductView( @@ -247,9 +250,12 @@ void Level3ProductView::UpdateColorTableLut() return; } - float offset = descriptionBlock->offset(); - float scale = descriptionBlock->scale(); - std::uint8_t threshold = static_cast( + float offset = descriptionBlock->offset(); + float scale = descriptionBlock->scale(); + float logOffset = descriptionBlock->log_offset(); + float logScale = descriptionBlock->log_scale(); + std::uint16_t logStart = descriptionBlock->log_start(); + std::uint8_t threshold = static_cast( std::clamp(descriptionBlock->threshold(), std::numeric_limits::min(), std::numeric_limits::max())); @@ -266,6 +272,9 @@ void Level3ProductView::UpdateColorTableLut() if (p->savedColorTable_ == p->colorTable_ && // p->savedOffset_ == offset && // p->savedScale_ == scale && // + p->savedLogOffset_ == logOffset && // + p->savedLogScale_ == logScale && // + p->savedLogStart_ == logStart && // numberOfLevels > 16) { // The color table LUT does not need updated @@ -335,6 +344,9 @@ void Level3ProductView::UpdateColorTableLut() p->savedColorTable_ = p->colorTable_; p->savedOffset_ = offset; p->savedScale_ = scale; + p->savedLogOffset_ = logOffset; + p->savedLogScale_ = logScale; + p->savedLogStart_ = logStart; Q_EMIT ColorTableLutUpdated(); }