Fixed scaling for int32
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user