protected static void flipVertically( final ImageReadParam param, final int srcHeight, final Rectangle srcRegion) { final int spaceLeft = srcRegion.y; srcRegion.y = srcHeight - (srcRegion.y + srcRegion.height); /* * After the flip performed by the above line, we still have 'spaceLeft' pixels left for a downward translation. We usually don't need to care * about if, except if the source region is very close to the bottom of the source image, in which case the correction computed below may be * greater than the space left. * * We are done if there is no vertical subsampling. But if there is subsampling, then we need an adjustment. The flipping performed above must * be computed as if the source region had exactly the size needed for reading nothing more than the last line, i.e. 'srcRegion.height' must * be a multiple of 'sourceYSubsampling' plus 1. The "offset" correction is computed below accordingly. */ if (param != null) { int offset = (srcRegion.height - 1) % param.getSourceYSubsampling(); srcRegion.y += offset; offset -= spaceLeft; if (offset > 0) { // Happen only if we are very close to image border and // the above translation bring us outside the image area. srcRegion.height -= offset; } } }
private Dimension getSourceRenderSizeFromSubsamping(ImageReadParam pParam, Dimension pOrigSize) { if (pParam.getSourceXSubsampling() > 1 || pParam.getSourceYSubsampling() > 1) { return new Dimension((int) (pOrigSize.width / (float) pParam.getSourceXSubsampling()), (int) (pOrigSize.height / (float) pParam.getSourceYSubsampling())); } return null; }
if (pParam != null) { subX = pParam.getSourceXSubsampling(); subY = pParam.getSourceYSubsampling();
.append(baseReadParameters.getSourceXSubsampling()) .append(" ") .append(baseReadParameters.getSourceYSubsampling()) .toString()); 0, (level.resolutionY / baseLevel.resolutionY) * baseReadParameters.getSourceYSubsampling(), 0, 0);
int ySub = param != null ? param.getSourceYSubsampling() : 1;
int yOff = param.getSubsamplingYOffset(); int xSub = param.getSourceXSubsampling(); int ySub = param.getSourceYSubsampling();
sourceYSubsampling = pParam.getSourceYSubsampling();
int ySub = param == null ? 1 : param.getSourceYSubsampling();
.toString())); final int ssx = readParameters.getSourceXSubsampling(); final int ssy = readParameters.getSourceYSubsampling(); final int newSubSamplingFactor = ImageIOUtilities.getSubSamplingFactor2(ssx, ssy); if (newSubSamplingFactor != 0) {
int ySub = param != null ? param.getSourceYSubsampling() : 1;
int ySub = param != null ? param.getSourceYSubsampling() : 1;
if (param != null) { strideX = param.getSourceXSubsampling(); strideY = param.getSourceYSubsampling(); dstBands = param.getDestinationBands(); } else {
int ySub = param != null ? param.getSourceYSubsampling() : 1;
sourceYSubsampling = pParam.getSourceYSubsampling();
int sourceYSubsampling = param.getSourceYSubsampling();
int ySub = param != null ? param.getSourceYSubsampling() : 1;
ySub = param.getSourceYSubsampling();
int ySub = param != null ? param.getSourceYSubsampling() : 1;
readParam.setSourceSubsampling( originalParams.getSourceXSubsampling(), originalParams.getSourceYSubsampling(), originalParams.getSubsamplingXOffset(), originalParams.getSubsamplingYOffset());
param.getSourceYSubsampling(), param.getSubsamplingXOffset(), param.getSubsamplingYOffset());