/** * Returns true if the point specified by the given X and Y coordinates * is contained within this region. * * @param xc the integer X coordinate of a point * @param yc the integer Y coordinate of a point * @return true if this Region encloses the given point */ public boolean containsPoint(int xc, int yc) { return intersects(new Region(xc, yc, 1, 1)); }
/** * Returns true if the point specified by the given X and Y coordinates * is contained within this region. */ public boolean containsPoint(int xc, int yc) { return intersects(new Region(xc, yc, 1, 1)); }
public byte[] get(int x, int y, int w, int h) throws CodecException, IOException { Region[] keys = compressedTiles.keySet().toArray(new Region[0]); Region r = new Region(x, y, w, h); for (Region key : keys) { if (key.intersects(r)) { r = key; } } if (!r.equals(lastRegion)) { lastRegion = r; byte[] compressed = null; compressed = compressedTiles.get(r); if (compressed == null) return null; lastTile = codec.decompress(compressed, options); } int pixel = options.channels * (options.bitsPerSample / 8); byte[] buf = new byte[w * h * pixel]; for (int i=0; i<h; i++) { System.arraycopy(lastTile, r.width * pixel * (i + y - r.y) + (x - r.x), buf, i * w * pixel, pixel * w); } return buf; } }
tileBoundary.x = col * tileDim; tileBoundary.width = col < xTiles - 1 ? tileDim : imageWidth - (tileDim*col); if (tileBoundary.intersects(image)) { intersection = image.intersection(tileBoundary); tile = getTile(col, row);
tileBoundary.x = col * tileDim; tileBoundary.width = col < xTiles - 1 ? tileDim : imageWidth - (tileDim*col); if (tileBoundary.intersects(image)) { intersection = image.intersection(tileBoundary); tile = getTile(col, row);
int height = tileY.get(getCoreIndex()); Region tile = new Region(col * width, row * height, width, height); if (!tile.intersects(image)) { continue;
int height = tileY.get(getCoreIndex()); Region tile = new Region(col * width, row * height, width, height); if (!tile.intersects(image)) { continue;
Region tile = new Region(tx * tw, ty * th, tw, th); if (!tile.intersects(image)) { continue;
tile.y /= res; if (tile.intersects(image)) { emptyTile = false; byte[] rawData = new SubBlock(plane).readPixelData();
Region tile = new Region(tx * tw, ty * th, tw, th); if (!tile.intersects(image)) { continue;
tile.y /= res; if (tile.intersects(image)) { emptyTile = false; byte[] rawData = new SubBlock(plane).readPixelData();
Region tile = new Region(col * tileWidth, row * tileHeight, tileWidth, tileHeight); if (!tile.intersects(image)) continue;
col == nCols - 1 ? getSizeX() % MAX_JPEG_SIZE : MAX_JPEG_SIZE, row == nRows - 1 ? getSizeY() % MAX_JPEG_SIZE : MAX_JPEG_SIZE); if (!tile.intersects(image)) { continue;
Region tile = new Region(col * tileWidth, row * tileHeight, tileWidth, tileHeight); if (!tile.intersects(image)) continue;
if (!imageBounds.intersects(tileBounds)) continue;
col == nCols - 1 ? getSizeX() % MAX_JPEG_SIZE : MAX_JPEG_SIZE, row == nRows - 1 ? getSizeY() % MAX_JPEG_SIZE : MAX_JPEG_SIZE); if (!tile.intersects(image)) { continue;
if (!imageBounds.intersects(tileBounds)) continue;