public int getRescaleHeight(int height) { return (int) Math.ceil(height * getRescaleY() - 0.5); }
public ZoomOp getRectifyAspectRatioZoomOp() { // Rectify non square pixel image in the first operation if (MathUtil.isDifferent(pixelSizeX, pixelSizeY)) { ZoomOp node = new ZoomOp(); node.setName("rectifyAspectRatio"); //$NON-NLS-1$ node.setParam(ZoomOp.P_RATIO_X, getRescaleX()); node.setParam(ZoomOp.P_RATIO_Y, getRescaleY()); return node; } return null; }
protected Rectangle getImageBounds(E img) { if (img != null) { PlanarImage source = getPreprocessedImage(img); // Get the displayed width (adapted in case of the aspect ratio is not 1/1) boolean nosquarePixel = MathUtil.isDifferent(img.getRescaleX(), img.getRescaleY()); int width = source == null || nosquarePixel ? img.getRescaleWidth(getImageSize(img, TagW.ImageWidth, TagW.get("Columns"))) : source.width(); //$NON-NLS-1$ int height = source == null || nosquarePixel ? img.getRescaleHeight(getImageSize(img, TagW.ImageHeight, TagW.get("Rows"))) : source.height(); //$NON-NLS-1$ return new Rectangle(0, 0, width, height); } return new Rectangle(0, 0, 512, 512); }
(int) Math.min(zoomFactor * source.height() * image.getRescaleY(), bound.height / 2.0));
if (bestfit || originSize == null) { canvasWidth = img.width() * image.getImage().getRescaleX(); canvasHeight = img.height() * image.getImage().getRescaleY(); } else { canvasWidth = originSize.getWidth() / originZoom;
if (bestfit || originSize == null) { canvasWidth = img.width() * image.getImage().getRescaleX(); canvasHeight = img.height() * image.getImage().getRescaleY(); } else { canvasWidth = originSize.getWidth() / originZoom;