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

Function scaleImageLancir

image_processing/resize_image.cpp:5–24  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3#include "lancir.h"
4
5static QImage scaleImageLancir(const QImage &image, int width, int height)
6{
7 QImage src = (image.format() == QImage::Format_ARGB32)
8 ? image
9 : image.convertToFormat(QImage::Format_ARGB32);
10
11 QImage dst(width, height, QImage::Format_ARGB32);
12
13 // SrcSSize / NewSSize are in elements; for uint8_t that equals bytes,
14 // so bytesPerLine() covers any Qt row-alignment padding correctly.
15 avir::CLancIRParams params(src.bytesPerLine(), dst.bytesPerLine());
16 params.la = 4.0; // Lanczos4
17
18 avir::CLancIR lancir;
19 lancir.resizeImage<uint8_t, uint8_t>(
20 src.constBits(), src.width(), src.height(),
21 dst.bits(), width, height, 4, &params);
22
23 return dst;
24}
25
26// ---- QPixmap API ------------------------------------------------------------
27

Callers 2

scalePixmapFunction · 0.85
scaleImageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected