mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 03:20:05 +00:00 
			
		
		
		
	Properly unpack levels from RLE data
This commit is contained in:
		
							parent
							
								
									6fc1f89fb1
								
							
						
					
					
						commit
						5e20ff9311
					
				
					 1 changed files with 13 additions and 6 deletions
				
			
		|  | @ -218,13 +218,20 @@ bool RadialDataPacket::Parse(std::istream& is) | ||||||
|             radial.data_.pop_back(); |             radial.data_.pop_back(); | ||||||
|          } |          } | ||||||
| 
 | 
 | ||||||
|          radial.level_.resize(radial.data_.size()); |          // Unpack the levels from the Run Length Encoded data
 | ||||||
|  |          radial.level_.resize(p->numberOfRangeBins_); | ||||||
| 
 | 
 | ||||||
|          std::transform(std::execution::par_unseq, |          uint16_t b = 0; | ||||||
|                         radial.data_.cbegin(), |          for (auto it = radial.data_.cbegin(); it != radial.data_.cend(); it++) | ||||||
|                         radial.data_.cend(), |          { | ||||||
|                         radial.level_.begin(), |             uint8_t run   = *it >> 4; | ||||||
|                         [](uint8_t data) -> uint8_t { return data & 0x0f; }); |             uint8_t level = *it & 0x0f; | ||||||
|  | 
 | ||||||
|  |             for (int i = 0; i < run && b < p->numberOfRangeBins_; i++) | ||||||
|  |             { | ||||||
|  |                radial.level_[b++] = level; | ||||||
|  |             } | ||||||
|  |          } | ||||||
|       } |       } | ||||||
|    } |    } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat