Merge pull request #5458 from rom9/filmneg_fix_spot_size

Fixed sampling loop ranges in `channelsAvg`.
This commit is contained in:
Ingo Weyrich
2019-09-18 22:56:05 +02:00
committed by GitHub

View File

@@ -77,8 +77,8 @@ bool channelsAvg(
}
std::array<int, 3> pxCount = {}; // Per-channel sample counts
for (int c = spotPos.x - spotSize; c < spotPos.x + spotSize; ++c) {
for (int r = spotPos.y - spotSize; r < spotPos.y + spotSize; ++r) {
for (int c = x1; c < x2; ++c) {
for (int r = y1; r < y2; ++r) {
const int ch = ri->getSensorType() == rtengine::ST_BAYER ? ri->FC(r,c) : ri->XTRANSFC(r,c);
++pxCount[ch];