@Override public int getOptimalTileHeight() { FormatTools.assertId(currentId, true, 1); if (getCoreIndex() < core.size() - 1) { return tileY.get(getCoreIndex()); } int ifdIndex = 1 - (core.size() - getCoreIndex()); try { return (int) ifds.get(ifdIndex).getTileLength(); } catch (FormatException e) { LOGGER.debug("Could not retrieve tile height", e); } return super.getOptimalTileHeight(); }
@Override public int getOptimalTileWidth() { FormatTools.assertId(currentId, true, 1); if (getCoreIndex() < core.size() - 1) { return tileX.get(getCoreIndex()); } int ifdIndex = 1 - (core.size() - getCoreIndex()); try { return (int) ifds.get(ifdIndex).getTileWidth(); } catch (FormatException e) { LOGGER.debug("Could not retrieve tile width", e); } return super.getOptimalTileWidth(); }
@Override public int getOptimalTileHeight() { FormatTools.assertId(currentId, true, 1); if (getCoreIndex() < core.size() - 1) { return tileY.get(getCoreIndex()); } int ifdIndex = 1 - (core.size() - getCoreIndex()); try { return (int) ifds.get(ifdIndex).getTileLength(); } catch (FormatException e) { LOGGER.debug("Could not retrieve tile height", e); } return super.getOptimalTileHeight(); }
@Override public int getOptimalTileWidth() { FormatTools.assertId(currentId, true, 1); if (getCoreIndex() < core.size() - 1) { return tileX.get(getCoreIndex()); } int ifdIndex = 1 - (core.size() - getCoreIndex()); try { return (int) ifds.get(ifdIndex).getTileWidth(); } catch (FormatException e) { LOGGER.debug("Could not retrieve tile width", e); } return super.getOptimalTileWidth(); }
private int getTileSize() { int channels = getRGBChannelCount(); int bpp = FormatTools.getBytesPerPixel(getPixelType()); int index = getCoreIndex(); return bpp * channels * tileX.get(index) * tileY.get(index); }
private int getTileSize() { int channels = getRGBChannelCount(); int bpp = FormatTools.getBytesPerPixel(getPixelType()); int index = getCoreIndex(); return bpp * channels * tileX.get(index) * tileY.get(index); }
if (getCoreIndex() < core.size() - 1) { int tileRows = rows.get(getCoreIndex()); int tileCols = cols.get(getCoreIndex()); int width = tileX.get(getCoreIndex()); int height = tileY.get(getCoreIndex()); Region tile = new Region(col * width, row * height, width, height); if (!tile.intersects(image)) { int ifdIndex = 1 - (core.size() - getCoreIndex()); return parser.getSamples(ifds.get(ifdIndex), buf, x, y, w, h);
if (getCoreIndex() < core.size() - 1) { int tileRows = rows.get(getCoreIndex()); int tileCols = cols.get(getCoreIndex()); int width = tileX.get(getCoreIndex()); int height = tileY.get(getCoreIndex()); Region tile = new Region(col * width, row * height, width, height); if (!tile.intersects(image)) { int ifdIndex = 1 - (core.size() - getCoreIndex()); return parser.getSamples(ifds.get(ifdIndex), buf, x, y, w, h);
@Override public byte[] openThumbBytes(int no) throws FormatException, IOException { FormatTools.assertId(currentId, true, 1); int currentIndex = getCoreIndex(); int thumbSize = getThumbSizeX() * getThumbSizeY() * FormatTools.getBytesPerPixel(getPixelType()) * getRGBChannelCount(); if (getCoreIndex() >= fileMap.size() || usedFiles.length >= core.size()) { return super.openThumbBytes(no); } setCoreIndex(fileMap.size()); byte[] thumb = FormatTools.openThumbBytes(this, 0); setCoreIndex(currentIndex); if (thumb.length == thumbSize) { return thumb; } return super.openThumbBytes(no); }
@Override public byte[] openThumbBytes(int no) throws FormatException, IOException { FormatTools.assertId(currentId, true, 1); int currentIndex = getCoreIndex(); int thumbSize = getThumbSizeX() * getThumbSizeY() * FormatTools.getBytesPerPixel(getPixelType()) * getRGBChannelCount(); if (getCoreIndex() >= fileMap.size() || usedFiles.length >= core.size()) { return super.openThumbBytes(no); } setCoreIndex(fileMap.size()); byte[] thumb = FormatTools.openThumbBytes(this, 0); setCoreIndex(currentIndex); if (thumb.length == thumbSize) { return thumb; } return super.openThumbBytes(no); }
if (tileMap.get(getCoreIndex()) == null) { return new byte[getTileSize()]; TileCoordinate t = new TileCoordinate(nDimensions.get(getCoreIndex())); t.coordinate[0] = col; t.coordinate[1] = row; ArrayList<TileCoordinate> map = tileMap.get(getCoreIndex()); Integer index = map.indexOf(t); if (index == null || index < 0) { byte[] color = backgroundColor.get(getCoreIndex()); if (color != null) { for (int q=0; q<getTileSize(); q+=color.length) { Long offset = tileOffsets.get(getCoreIndex())[index]; byte[] buf = null; IFormatReader reader = null; try (RandomAccessInputStream ets = new RandomAccessInputStream(fileMap.get(getCoreIndex()))) { ets.seek(offset); CodecOptions options = new CodecOptions(); int tileSize = getTileSize(); if (tileSize == 0) { tileSize = tileX.get(getCoreIndex()) * tileY.get(getCoreIndex()) * 10; long end = index < tileOffsets.get(getCoreIndex()).length - 1 ? tileOffsets.get(getCoreIndex())[index + 1] : ets.length();
if (tileMap.get(getCoreIndex()) == null) { return new byte[getTileSize()]; TileCoordinate t = new TileCoordinate(nDimensions.get(getCoreIndex())); t.coordinate[0] = col; t.coordinate[1] = row; ArrayList<TileCoordinate> map = tileMap.get(getCoreIndex()); Integer index = map.indexOf(t); if (index == null || index < 0) { byte[] color = backgroundColor.get(getCoreIndex()); if (color != null) { for (int q=0; q<getTileSize(); q+=color.length) { Long offset = tileOffsets.get(getCoreIndex())[index]; byte[] buf = null; IFormatReader reader = null; try (RandomAccessInputStream ets = new RandomAccessInputStream(fileMap.get(getCoreIndex()))) { ets.seek(offset); CodecOptions options = new CodecOptions(); int tileSize = getTileSize(); if (tileSize == 0) { tileSize = tileX.get(getCoreIndex()) * tileY.get(getCoreIndex()) * 10; long end = index < tileOffsets.get(getCoreIndex()).length - 1 ? tileOffsets.get(getCoreIndex())[index + 1] : ets.length();
CoreMetadata ms = core.get(getCoreIndex()); etsFile.read(color); backgroundColor.put(getCoreIndex(), color);
CoreMetadata ms = core.get(getCoreIndex()); etsFile.read(color); backgroundColor.put(getCoreIndex(), color);