Easier subsampling with xSub == 1 as no-op

This commit is contained in:
Harald Kuhr
2021-03-27 14:37:33 +01:00
parent 3b34d6e7ce
commit bb650e5280
4 changed files with 59 additions and 40 deletions
@@ -171,11 +171,9 @@ final class XWDImageReader extends ImageReaderBase {
}
}
if (xSub != 1) {
// Horizontal subsampling
int samplesPerPixel = header.numComponents();
subsampleRow(row, srcRegion.x * samplesPerPixel, srcRegion.width, row, srcRegion.x * samplesPerPixel, samplesPerPixel, header.bitsPerRGB, xSub);
}
// Horizontal subsampling
int samplesPerPixel = header.numComponents();
subsampleRow(row, srcRegion.x * samplesPerPixel, srcRegion.width, row, srcRegion.x * samplesPerPixel, samplesPerPixel, header.bitsPerRGB, xSub);
raster.setDataElements(0, (y - srcRegion.y) / ySub, rowRaster);