MCPcopy Create free account
hub / github.com/YACReader/yacreader / scaleImage

Function scaleImage

image_processing/resize_image.cpp:46–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44// ---- QImage API (avoids QPixmap round-trip in ContinuousPageWidget) ---------
45
46QImage scaleImage(const QImage &image, int width, int height, ScaleMethod method)
47{
48 if ((image.width() == width && image.height() == height) || image.isNull())
49 return image;
50
51 switch (method) {
52 case ScaleMethod::Nearest:
53 return image.scaled(width, height, Qt::IgnoreAspectRatio, Qt::FastTransformation);
54 case ScaleMethod::Bilinear:
55 return image.scaled(width, height, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
56 case ScaleMethod::Lanczos:
57 return scaleImageLancir(image, width, height);
58 }
59 return image;
60}

Callers 1

runMethod · 0.85

Calls 1

scaleImageLancirFunction · 0.85

Tested by

no test coverage detected