From 9bb331a1c1757d84efcdab64ab19f870df192df7 Mon Sep 17 00:00:00 2001 From: Alexander Rath Date: Tue, 2 Jan 2024 18:56:28 +0100 Subject: [PATCH] fix unraveling of index --- src/ImageCanvas.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ImageCanvas.cpp b/src/ImageCanvas.cpp index 400826a..92d04d2 100644 --- a/src/ImageCanvas.cpp +++ b/src/ImageCanvas.cpp @@ -922,7 +922,7 @@ Task> ImageCanvas::computeCanvasStatistics( tasks.emplace_back( ThreadPool::global().parallelForAsync(0, numPixels, [&, i](size_t j) { int x = (j % regionSize.x()) + region.min.x(); - int y = (j / regionSize.y()) + region.min.y(); + int y = (j / regionSize.x()) + region.min.y(); indices[j + i * numPixels] = valToBin(channel.at(Vector2i{x, y})); }, priority) );