Refactor color table functions to reference the lookup table where appropriate

This commit is contained in:
Dan Paulat 2024-01-04 23:16:05 -06:00
parent c1280c05aa
commit 03f08d54f1
11 changed files with 30 additions and 29 deletions

View file

@ -109,7 +109,7 @@ void ColorTableLayer::Initialize()
gl.glEnableVertexAttribArray(1);
connect(context()->radar_product_view().get(),
&view::RadarProductView::ColorTableUpdated,
&view::RadarProductView::ColorTableLutUpdated,
this,
[this]() { p->colorTableNeedsUpdate_ = true; });
}
@ -142,7 +142,7 @@ void ColorTableLayer::Render(
if (p->colorTableNeedsUpdate_)
{
p->colorTable_ = radarProductView->color_table();
p->colorTable_ = radarProductView->color_table_lut();
gl.glActiveTexture(GL_TEXTURE0);
gl.glBindTexture(GL_TEXTURE_1D, p->texture_);

View file

@ -182,8 +182,6 @@ public:
manager::PlacefileManager::Instance()};
std::shared_ptr<manager::RadarProductManager> radarProductManager_;
std::shared_ptr<common::ColorTable> colorTable_;
std::shared_ptr<RadarProductLayer> radarProductLayer_;
std::shared_ptr<AlertLayer> alertLayer_;
std::shared_ptr<OverlayLayer> overlayLayer_;
@ -1377,7 +1375,7 @@ void MapWidgetImpl::RadarProductViewConnect()
{
connect(
radarProductView.get(),
&view::RadarProductView::ColorTableUpdated,
&view::RadarProductView::ColorTableLutUpdated,
this,
[this]() { widget_->update(); },
Qt::QueuedConnection);
@ -1412,7 +1410,7 @@ void MapWidgetImpl::RadarProductViewDisconnect()
if (radarProductView != nullptr)
{
disconnect(radarProductView.get(),
&view::RadarProductView::ColorTableUpdated,
&view::RadarProductView::ColorTableLutUpdated,
this,
nullptr);
disconnect(radarProductView.get(),

View file

@ -77,7 +77,7 @@ RadarProductLayer::RadarProductLayer(std::shared_ptr<MapContext> context) :
{
auto radarProductView = context->radar_product_view();
connect(radarProductView.get(),
&view::RadarProductView::ColorTableUpdated,
&view::RadarProductView::ColorTableLutUpdated,
this,
[this]() { p->colorTableNeedsUpdate_ = true; });
connect(radarProductView.get(),
@ -334,7 +334,7 @@ void RadarProductLayer::UpdateColorTable()
context()->radar_product_view();
const std::vector<boost::gil::rgba8_pixel_t>& colorTable =
radarProductView->color_table();
radarProductView->color_table_lut();
const uint16_t rangeMin = radarProductView->color_table_min();
const uint16_t rangeMax = radarProductView->color_table_max();