mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 15:10:05 +00:00 
			
		
		
		
	Add log parameters to color table change detection
This commit is contained in:
		
							parent
							
								
									9c181d3e76
								
							
						
					
					
						commit
						8a78a48dfd
					
				
					 1 changed files with 17 additions and 5 deletions
				
			
		|  | @ -56,8 +56,11 @@ public: | ||||||
|    uint16_t                               colorTableMax_; |    uint16_t                               colorTableMax_; | ||||||
| 
 | 
 | ||||||
|    std::shared_ptr<common::ColorTable> savedColorTable_; |    std::shared_ptr<common::ColorTable> savedColorTable_; | ||||||
|    float                               savedScale_; |    float                               savedScale_ {1.0f}; | ||||||
|    float                               savedOffset_; |    float                               savedOffset_ {0.0f}; | ||||||
|  |    std::uint16_t                       savedLogStart_ {20u}; | ||||||
|  |    float                               savedLogScale_ {1.0f}; | ||||||
|  |    float                               savedLogOffset_ {0.0f}; | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| Level3ProductView::Level3ProductView( | Level3ProductView::Level3ProductView( | ||||||
|  | @ -249,6 +252,9 @@ void Level3ProductView::UpdateColorTableLut() | ||||||
| 
 | 
 | ||||||
|    float         offset    = descriptionBlock->offset(); |    float         offset    = descriptionBlock->offset(); | ||||||
|    float         scale     = descriptionBlock->scale(); |    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::uint8_t>( |    std::uint8_t  threshold = static_cast<std::uint8_t>( | ||||||
|       std::clamp<std::uint16_t>(descriptionBlock->threshold(), |       std::clamp<std::uint16_t>(descriptionBlock->threshold(), | ||||||
|                                 std::numeric_limits<std::uint8_t>::min(), |                                 std::numeric_limits<std::uint8_t>::min(), | ||||||
|  | @ -266,6 +272,9 @@ void Level3ProductView::UpdateColorTableLut() | ||||||
|    if (p->savedColorTable_ == p->colorTable_ && //
 |    if (p->savedColorTable_ == p->colorTable_ && //
 | ||||||
|        p->savedOffset_ == offset &&             //
 |        p->savedOffset_ == offset &&             //
 | ||||||
|        p->savedScale_ == scale &&               //
 |        p->savedScale_ == scale &&               //
 | ||||||
|  |        p->savedLogOffset_ == logOffset &&       //
 | ||||||
|  |        p->savedLogScale_ == logScale &&         //
 | ||||||
|  |        p->savedLogStart_ == logStart &&         //
 | ||||||
|        numberOfLevels > 16) |        numberOfLevels > 16) | ||||||
|    { |    { | ||||||
|       // The color table LUT does not need updated
 |       // The color table LUT does not need updated
 | ||||||
|  | @ -335,6 +344,9 @@ void Level3ProductView::UpdateColorTableLut() | ||||||
|    p->savedColorTable_ = p->colorTable_; |    p->savedColorTable_ = p->colorTable_; | ||||||
|    p->savedOffset_     = offset; |    p->savedOffset_     = offset; | ||||||
|    p->savedScale_      = scale; |    p->savedScale_      = scale; | ||||||
|  |    p->savedLogOffset_  = logOffset; | ||||||
|  |    p->savedLogScale_   = logScale; | ||||||
|  |    p->savedLogStart_   = logStart; | ||||||
| 
 | 
 | ||||||
|    Q_EMIT ColorTableLutUpdated(); |    Q_EMIT ColorTableLutUpdated(); | ||||||
| } | } | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat