mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 22:40:05 +00:00
Add scaling to 16-level thresholds
This commit is contained in:
parent
f8765e0d2d
commit
5aa27c7fe7
1 changed files with 21 additions and 1 deletions
|
|
@ -221,8 +221,28 @@ void Level3ProductView::UpdateColorTable()
|
||||||
uint16_t th = descriptionBlock->data_level_threshold(i);
|
uint16_t th = descriptionBlock->data_level_threshold(i);
|
||||||
if ((th & 0x8000u) == 0)
|
if ((th & 0x8000u) == 0)
|
||||||
{
|
{
|
||||||
|
float scale = 1.0f;
|
||||||
|
|
||||||
|
if (th & 0x4000u)
|
||||||
|
{
|
||||||
|
scale *= 0.01f;
|
||||||
|
}
|
||||||
|
if (th & 0x2000u)
|
||||||
|
{
|
||||||
|
scale *= 0.05f;
|
||||||
|
}
|
||||||
|
if (th & 0x1000u)
|
||||||
|
{
|
||||||
|
scale *= 0.1f;
|
||||||
|
}
|
||||||
|
if (th & 0x0100u)
|
||||||
|
{
|
||||||
|
scale *= -1.0f;
|
||||||
|
}
|
||||||
|
|
||||||
// If bit 0 is zero, then the LSB is numeric
|
// If bit 0 is zero, then the LSB is numeric
|
||||||
f = static_cast<float>(th & 0x00ffu);
|
f = static_cast<float>(th & 0x00ffu) * scale;
|
||||||
|
|
||||||
lut[lutIndex] = p->colorTable_->Color(f);
|
lut[lutIndex] = p->colorTable_->Color(f);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue