int yStartReading = y==roi.y ? Math.max(roi.y-kHeight/2, 0) : y+kHeight/2; for (int yNew = yStartReading; yNew<=y+kHeight/2; yNew++) { //only 1 line except at start readLineToCacheOrPad(pixels, width, height, roi.y, xminInside, widthInside, cache, cacheWidth, cacheHeight, padLeft, padRight, colorChannel, kHeight, yNew); while (highestYinCache < arrayMinNonNegative(yForThread) - kHeight/2 + cacheHeight - 1) { int yNew = highestYinCache + 1; readLineToCacheOrPad(pixels, width, height, roi.y, xminInside, widthInside, cache, cacheWidth, cacheHeight, padLeft, padRight, colorChannel, kHeight, yNew); highestYinCache = yNew;
int yStartReading = y==roi.y ? Math.max(roi.y-kHeight/2, 0) : y+kHeight/2; for (int yNew = yStartReading; yNew<=y+kHeight/2; yNew++) { //only 1 line except at start readLineToCacheOrPad(pixels, width, height, roi.y, xminInside, widthInside, cache, cacheWidth, cacheHeight, padLeft, padRight, colorChannel, kHeight, yNew); while (highestYinCache < arrayMinNonNegative(yForThread) - kHeight/2 + cacheHeight - 1) { int yNew = highestYinCache + 1; readLineToCacheOrPad(pixels, width, height, roi.y, xminInside, widthInside, cache, cacheWidth, cacheHeight, padLeft, padRight, colorChannel, kHeight, yNew); highestYinCache = yNew;