int sizeY = pixelBuffer.getSizeY(); if (rd.getWidth() + rd.getX() > sizeX)
|| tileHeight == source.getSizeY() || tileDimensionTooSmall) source.getSizeZ() * source.getSizeC() * source.getSizeT() * (Math.ceil(source.getSizeX() / tileSize.getWidth())) * (Math.ceil(source.getSizeY() / tileSize.getHeight())); final int tenPercent = Math.max((int) totalTiles / 10, 1); Utils.forEachTile(new TileLoopIteration() {
/** * Iterates over every tile in a given pixel buffer based on the * over arching dimensions and a requested maximum tile width and height. * @param iteration Invoker to call for each tile. * @param pixelBuffer Pixel buffer which is backing the pixel data. * @param tileWidth <b>Maximum</b> width of the tile requested. The tile * request itself will be smaller than the original tile width requested if * <code>x + tileWidth > sizeX</code>. * @param tileHeight <b>Maximum</b> height of the tile requested. The tile * request itself will be smaller if <code>y + tileHeight > sizeY</code>. * @throws FailedTileLoopException if the tile loop was aborted; exception bears completed tile count * @return The total number of tiles iterated over. */ public static int forEachTile(TileLoopIteration iteration, PixelBuffer pixelBuffer, int tileWidth, int tileHeight) throws FailedTileLoopException { int sizeX = pixelBuffer.getSizeX(); int sizeY = pixelBuffer.getSizeY(); int sizeZ = pixelBuffer.getSizeZ(); int sizeC = pixelBuffer.getSizeC(); int sizeT = pixelBuffer.getSizeT(); return forEachTile(iteration, sizeX, sizeY, sizeZ, sizeC, sizeT, tileWidth, tileHeight); }
/** * Checks the region definition to ensure that the requested tile width * and height are valid with respect to the current resolution level. * @param rd Requested region definition. */ private void checkRegionDef(RegionDef rd) { if (rd == null) { return; } // We're using the buffer X and Y size because of the // possibility that we're on a resolution level where // Pixels.Size[X,Y] != PixelBuffer.Size[X,Y]. int sizeX = buffer.getSizeX(); int sizeY = buffer.getSizeY(); int x = rd.getX(); int y = rd.getY(); if ((rd.getWidth() + x) > sizeX) { rd.setWidth(sizeX - x); } if ((rd.getHeight() + y) > sizeY) { rd.setHeight(sizeY - y); } }
int originalSizeY = pixels.getSizeY(); int pixelBufferSizeX = pixelBuffer.getSizeX(); int pixelBufferSizeY = pixelBuffer.getSizeY(); if (pixelBuffer.getResolutionLevels() > 1) renderer.setResolutionLevel(resolutionLevel); pixelBufferSizeX = pixelBuffer.getSizeX(); pixelBufferSizeY = pixelBuffer.getSizeY(); if (pixelBufferSizeX <= thumbnailMetadata.getSizeX() || pixelBufferSizeY <= thumbnailMetadata.getSizeY())
int h = (plane != null && plane.getRegion() != null && plane .getRegion().getHeight() > 0) ? plane.getRegion().getHeight() : buffer.getSizeY();