Fix 90CW rotation is flipped

This commit is contained in:
Ming Ming 2022-09-11 14:34:01 +08:00
parent 348802efc5
commit 0862f9af6e

View file

@ -101,7 +101,7 @@ vector<uint8_t> Orientation::apply90Cw(const uint8_t *rgba8, const size_t width,
const auto yI = y * width * 4; const auto yI = y * width * 4;
for (size_t x = 0; x < width; ++x) { for (size_t x = 0; x < width; ++x) {
const auto p = x * 4 + yI; const auto p = x * 4 + yI;
const auto desY = width - x - 1; const auto desY = x;
const auto desX = height - y - 1; const auto desX = height - y - 1;
const auto desP = (desY * height + desX) * 4; const auto desP = (desY * height + desX) * 4;
output[desP + 0] = rgba8[p + 0]; output[desP + 0] = rgba8[p + 0];