Add support for FLOAT16 image downscale
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user