Implement lanczos for upscaling to get crispier images

This commit is contained in:
Luis Ángel San Martín
2024-08-31 13:04:39 +02:00
parent a3f3149764
commit 819f456d6e
5 changed files with 401 additions and 27 deletions

View File

@ -0,0 +1,20 @@
#ifndef RESIZE_IMAGE_H
#define RESIZE_IMAGE_H
#include <cmath>
#include <QPixmap>
#include <QImage>
enum class ScaleMethod {
QtFast,
QtSmooth, // Bilinear
Bicubic,
Lanczos,
Area
};
QPixmap smartScalePixmap(const QPixmap &pixmap, int width, int height);
QPixmap scalePixmap(const QPixmap &pixmap, int width, int height, ScaleMethod method = ScaleMethod::QtSmooth);
#endif // RESIZE_IMAGE_H