/** * Sets the bound and resolution of the processing area. If the client * does not explicitly set the processing area the default is used * (first destination or source image bounds and resolution). * * @param worldBounds bounds in world units * @param xres pixel width in world units * @param yres pixel height in world units * * @return the instance of this class to allow method chaining */ public JiffleBuilder worldAndRes(Rectangle2D worldBounds, double xres, double yres) { if (worldBounds == null || worldBounds.isEmpty()) { throw new IllegalArgumentException("bounds must not be null or empty"); } if (xres <= EPS) { throw new IllegalArgumentException("xres must be greater than zero"); } if (xres <= EPS) { throw new IllegalArgumentException("xres must be greater than zero"); } return doSetWorld(worldBounds, xres, yres); }
/** * Sets the bound and resolution of the processing area. If the client * does not explicitly set the processing area the default is used * (first destination or source image bounds and resolution). * * @param worldBounds bounds in world units * @param xres pixel width in world units * @param yres pixel height in world units * * @return the instance of this class to allow method chaining */ public JiffleBuilder worldAndRes(Rectangle2D worldBounds, double xres, double yres) { if (worldBounds == null || worldBounds.isEmpty()) { throw new IllegalArgumentException("bounds must not be null or empty"); } if (xres <= EPS) { throw new IllegalArgumentException("xres must be greater than zero"); } if (xres <= EPS) { throw new IllegalArgumentException("xres must be greater than zero"); } return doSetWorld(worldBounds, xres, yres); }
/** * Sets the bound and resolution of the processing area. If the client * does not explicitly set the processing area the default is used * (first destination or source image bounds and resolution). * * @param worldBounds bounds in world units * @param numX number of pixels in the X direction * @param numY number of pixels in the Y direction * * @return the instance of this class to allow method chaining */ public JiffleBuilder worldAndNumPixels(Rectangle2D worldBounds, int numX, int numY) { if (worldBounds == null || worldBounds.isEmpty()) { throw new IllegalArgumentException("bounds must not be null or empty"); } if (numX <= 0) { throw new IllegalArgumentException("numX must be greater than zero"); } if (numY <= 0) { throw new IllegalArgumentException("numY must be greater than zero"); } double xres = worldBounds.getWidth() / numX; double yres = worldBounds.getHeight() / numY; return doSetWorld(worldBounds, xres, yres); }
/** * Sets the bound and resolution of the processing area. If the client * does not explicitly set the processing area the default is used * (first destination or source image bounds and resolution). * * @param worldBounds bounds in world units * @param numX number of pixels in the X direction * @param numY number of pixels in the Y direction * * @return the instance of this class to allow method chaining */ public JiffleBuilder worldAndNumPixels(Rectangle2D worldBounds, int numX, int numY) { if (worldBounds == null || worldBounds.isEmpty()) { throw new IllegalArgumentException("bounds must not be null or empty"); } if (numX <= 0) { throw new IllegalArgumentException("numX must be greater than zero"); } if (numY <= 0) { throw new IllegalArgumentException("numY must be greater than zero"); } double xres = worldBounds.getWidth() / numX; double yres = worldBounds.getHeight() / numY; return doSetWorld(worldBounds, xres, yres); }