Add scaling to 16-level thresholds

This commit is contained in:
Dan Paulat 2022-04-10 20:55:46 -05:00
parent f8765e0d2d
commit 5aa27c7fe7

View file

@ -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