mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 04:10:06 +00:00 
			
		
		
		
	Refactor color table functions to reference the lookup table where appropriate
This commit is contained in:
		
							parent
							
								
									c1280c05aa
								
							
						
					
					
						commit
						03f08d54f1
					
				
					 11 changed files with 30 additions and 29 deletions
				
			
		|  | @ -164,11 +164,11 @@ boost::asio::thread_pool& Level2ProductView::thread_pool() | |||
| } | ||||
| 
 | ||||
| const std::vector<boost::gil::rgba8_pixel_t>& | ||||
| Level2ProductView::color_table() const | ||||
| Level2ProductView::color_table_lut() const | ||||
| { | ||||
|    if (p->colorTableLut_.size() == 0) | ||||
|    { | ||||
|       return RadarProductView::color_table(); | ||||
|       return RadarProductView::color_table_lut(); | ||||
|    } | ||||
|    else | ||||
|    { | ||||
|  | @ -282,7 +282,7 @@ void Level2ProductView::LoadColorTable( | |||
|    std::shared_ptr<common::ColorTable> colorTable) | ||||
| { | ||||
|    p->colorTable_ = colorTable; | ||||
|    UpdateColorTable(); | ||||
|    UpdateColorTableLut(); | ||||
| } | ||||
| 
 | ||||
| void Level2ProductView::SelectElevation(float elevation) | ||||
|  | @ -317,7 +317,7 @@ void Level2ProductViewImpl::SetProduct(common::Level2Product product) | |||
|    } | ||||
| } | ||||
| 
 | ||||
| void Level2ProductView::UpdateColorTable() | ||||
| void Level2ProductView::UpdateColorTableLut() | ||||
| { | ||||
|    if (p->momentDataBlock0_ == nullptr || //
 | ||||
|        p->colorTable_ == nullptr ||       //
 | ||||
|  | @ -398,7 +398,7 @@ void Level2ProductView::UpdateColorTable() | |||
|    p->savedOffset_     = offset; | ||||
|    p->savedScale_      = scale; | ||||
| 
 | ||||
|    Q_EMIT ColorTableUpdated(); | ||||
|    Q_EMIT ColorTableLutUpdated(); | ||||
| } | ||||
| 
 | ||||
| void Level2ProductView::ComputeSweep() | ||||
|  | @ -702,7 +702,7 @@ void Level2ProductView::ComputeSweep() | |||
|    timer.stop(); | ||||
|    logger_->debug("Vertices calculated in {}", timer.format(6, "%ws")); | ||||
| 
 | ||||
|    UpdateColorTable(); | ||||
|    UpdateColorTableLut(); | ||||
| 
 | ||||
|    Q_EMIT SweepComputed(); | ||||
| } | ||||
|  |  | |||
|  | @ -27,7 +27,8 @@ public: | |||
|       std::shared_ptr<manager::RadarProductManager> radarProductManager); | ||||
|    ~Level2ProductView(); | ||||
| 
 | ||||
|    const std::vector<boost::gil::rgba8_pixel_t>& color_table() const override; | ||||
|    const std::vector<boost::gil::rgba8_pixel_t>& | ||||
|                                          color_table_lut() const override; | ||||
|    std::uint16_t                         color_table_min() const override; | ||||
|    std::uint16_t                         color_table_max() const override; | ||||
|    float                                 elevation() const override; | ||||
|  | @ -63,7 +64,7 @@ protected: | |||
| 
 | ||||
|    void ConnectRadarProductManager() override; | ||||
|    void DisconnectRadarProductManager() override; | ||||
|    void UpdateColorTable() override; | ||||
|    void UpdateColorTableLut() override; | ||||
| 
 | ||||
| protected slots: | ||||
|    void ComputeSweep() override; | ||||
|  |  | |||
|  | @ -97,11 +97,11 @@ void Level3ProductView::DisconnectRadarProductManager() | |||
| } | ||||
| 
 | ||||
| const std::vector<boost::gil::rgba8_pixel_t>& | ||||
| Level3ProductView::color_table() const | ||||
| Level3ProductView::color_table_lut() const | ||||
| { | ||||
|    if (p->colorTableLut_.size() == 0) | ||||
|    { | ||||
|       return RadarProductView::color_table(); | ||||
|       return RadarProductView::color_table_lut(); | ||||
|    } | ||||
|    else | ||||
|    { | ||||
|  | @ -218,10 +218,10 @@ void Level3ProductView::LoadColorTable( | |||
|    std::shared_ptr<common::ColorTable> colorTable) | ||||
| { | ||||
|    p->colorTable_ = colorTable; | ||||
|    UpdateColorTable(); | ||||
|    UpdateColorTableLut(); | ||||
| } | ||||
| 
 | ||||
| void Level3ProductView::UpdateColorTable() | ||||
| void Level3ProductView::UpdateColorTableLut() | ||||
| { | ||||
|    logger_->debug("UpdateColorTable()"); | ||||
| 
 | ||||
|  | @ -346,7 +346,7 @@ void Level3ProductView::UpdateColorTable() | |||
|    p->savedOffset_     = offset; | ||||
|    p->savedScale_      = scale; | ||||
| 
 | ||||
|    Q_EMIT ColorTableUpdated(); | ||||
|    Q_EMIT ColorTableLutUpdated(); | ||||
| } | ||||
| 
 | ||||
| } // namespace view
 | ||||
|  |  | |||
|  | @ -25,7 +25,8 @@ public: | |||
|       std::shared_ptr<manager::RadarProductManager> radarProductManager); | ||||
|    virtual ~Level3ProductView(); | ||||
| 
 | ||||
|    const std::vector<boost::gil::rgba8_pixel_t>& color_table() const override; | ||||
|    const std::vector<boost::gil::rgba8_pixel_t>& | ||||
|                  color_table_lut() const override; | ||||
|    std::uint16_t color_table_min() const override; | ||||
|    std::uint16_t color_table_max() const override; | ||||
| 
 | ||||
|  | @ -47,7 +48,7 @@ protected: | |||
| 
 | ||||
|    void ConnectRadarProductManager() override; | ||||
|    void DisconnectRadarProductManager() override; | ||||
|    void UpdateColorTable() override; | ||||
|    void UpdateColorTableLut() override; | ||||
| 
 | ||||
| private: | ||||
|    class Impl; | ||||
|  |  | |||
|  | @ -423,7 +423,7 @@ void Level3RadialView::ComputeSweep() | |||
|    timer.stop(); | ||||
|    logger_->debug("Vertices calculated in {}", timer.format(6, "%ws")); | ||||
| 
 | ||||
|    UpdateColorTable(); | ||||
|    UpdateColorTableLut(); | ||||
| 
 | ||||
|    Q_EMIT SweepComputed(); | ||||
| } | ||||
|  |  | |||
|  | @ -347,7 +347,7 @@ void Level3RasterView::ComputeSweep() | |||
|    timer.stop(); | ||||
|    logger_->debug("Vertices calculated in {}", timer.format(6, "%ws")); | ||||
| 
 | ||||
|    UpdateColorTable(); | ||||
|    UpdateColorTableLut(); | ||||
| 
 | ||||
|    Q_EMIT SweepComputed(); | ||||
| } | ||||
|  |  | |||
|  | @ -51,7 +51,7 @@ RadarProductView::RadarProductView( | |||
| RadarProductView::~RadarProductView() = default; | ||||
| 
 | ||||
| const std::vector<boost::gil::rgba8_pixel_t>& | ||||
| RadarProductView::color_table() const | ||||
| RadarProductView::color_table_lut() const | ||||
| { | ||||
|    return kDefaultColorTable_; | ||||
| } | ||||
|  |  | |||
|  | @ -34,7 +34,8 @@ public: | |||
|       std::shared_ptr<manager::RadarProductManager> radarProductManager); | ||||
|    virtual ~RadarProductView(); | ||||
| 
 | ||||
|    virtual const std::vector<boost::gil::rgba8_pixel_t>& color_table() const; | ||||
|    virtual const std::vector<boost::gil::rgba8_pixel_t>& | ||||
|                                                  color_table_lut() const; | ||||
|    virtual std::uint16_t                         color_table_min() const; | ||||
|    virtual std::uint16_t                         color_table_max() const; | ||||
|    virtual float                                 elevation() const; | ||||
|  | @ -84,13 +85,13 @@ protected: | |||
| 
 | ||||
|    virtual void ConnectRadarProductManager()    = 0; | ||||
|    virtual void DisconnectRadarProductManager() = 0; | ||||
|    virtual void UpdateColorTable()              = 0; | ||||
|    virtual void UpdateColorTableLut()           = 0; | ||||
| 
 | ||||
| protected slots: | ||||
|    virtual void ComputeSweep(); | ||||
| 
 | ||||
| signals: | ||||
|    void ColorTableUpdated(); | ||||
|    void ColorTableLutUpdated(); | ||||
|    void SweepComputed(); | ||||
|    void SweepNotComputed(types::NoUpdateReason reason); | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat