Add support for FLOAT16 image downscale

This commit is contained in:
2024-08-27 11:28:09 +02:00
parent d6e257e201
commit 5e18c591f7
3 changed files with 27 additions and 5 deletions
+5 -1
View File
@@ -117,7 +117,11 @@ void ImageWidget::setImage(std::shared_ptr<RawImage> image, int index)
makeCurrent();
m_rawImage = image;
if((int)image->width() > m_maxTextureSize || (int)image->height() > m_maxTextureSize)
m_rawImage->resize(std::min(m_maxTextureSize, (int)image->width()), std::min(m_maxTextureSize, (int)image->height()));
{
uint32_t newW = std::min(image->width() * m_maxTextureSize / image->width(), image->width() * m_maxTextureSize / image->height());
uint32_t newH = std::min(image->height() * m_maxTextureSize / image->width(), image->height() * m_maxTextureSize / image->height());
m_rawImage->resize(newW, newH);
}
m_imgWidth = image->width();
m_imgHeight = image->height();