Fixed scaling for int32

This commit is contained in:
2023-11-21 18:31:07 +01:00
parent 50c070b169
commit b9bf6bf183
3 changed files with 22 additions and 9 deletions
+4 -9
View File
@@ -115,16 +115,11 @@ void ImageWidget::setImage(std::shared_ptr<RawImage> image, int index)
m_unit_scale[0] = 1.0f;
m_unit_scale[1] = 0.0f;
auto &stats = image->imageStats();
if(image->type() == RawImage::FLOAT32 || image->type() == RawImage::FLOAT64)
if(image->type() == RawImage::FLOAT32)
{
float min = *std::min_element(stats.m_min, stats.m_min + 4);
float max = *std::max_element(stats.m_max, stats.m_max + 4);
if(min < 0.0f || max > 1.0f)
{
m_unit_scale[0] = 1.0f / (max - min);
m_unit_scale[1] = min * m_unit_scale[0];
}
auto unitScaling = image->unitScale();
m_unit_scale[0] = unitScaling.first;
m_unit_scale[1] = unitScaling.second;
}
if(m_debayerTex)