Use src/dst prefixes instead of from/to.
This commit is contained in:
parent
cb5296a6b0
commit
32cf0968a1
1 changed files with 7 additions and 7 deletions
|
|
@ -41,15 +41,15 @@ FrameGenerator::Frame ImageFrameGenerator::renderNext(
|
||||||
|
|
||||||
const auto skipx = (size.width() - scaled.width()) / 2;
|
const auto skipx = (size.width() - scaled.width()) / 2;
|
||||||
const auto skipy = (size.height() - scaled.height()) / 2;
|
const auto skipy = (size.height() - scaled.height()) / 2;
|
||||||
const auto fromPerLine = scaled.bytesPerLine();
|
const auto srcPerLine = scaled.bytesPerLine();
|
||||||
const auto toPerLine = result.bytesPerLine();
|
const auto dstPerLine = result.bytesPerLine();
|
||||||
const auto lineBytes = scaled.width() * 4;
|
const auto lineBytes = scaled.width() * 4;
|
||||||
auto from = scaled.constBits();
|
auto src = scaled.constBits();
|
||||||
auto to = result.bits() + (skipx * 4) + (skipy * fromPerLine);
|
auto dst = result.bits() + (skipx * 4) + (skipy * srcPerLine);
|
||||||
for (auto y = 0, height = scaled.height(); y != height; ++y) {
|
for (auto y = 0, height = scaled.height(); y != height; ++y) {
|
||||||
memcpy(to, from, lineBytes);
|
memcpy(dst, src, lineBytes);
|
||||||
from += fromPerLine;
|
src += srcPerLine;
|
||||||
to += toPerLine;
|
dst += dstPerLine;
|
||||||
}
|
}
|
||||||
|
|
||||||
return { .image = std::move(result) };
|
return { .image = std::move(result) };
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue