@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); }
private int getTileSize() { int channels = getRGBChannelCount(); int bpp = FormatTools.getBytesPerPixel(getPixelType()); int index = getCoreIndex(); return bpp * channels * tileX.get(index) * tileY.get(index); }
if (!checkSuffix(id, "vsi")) { Location current = new Location(id).getAbsoluteFile(); Location parent = current.getParentFile(); vsi.order(parser.getStream().isLittleEndian()); vsi.seek(8); readTags(vsi, false, ""); Arrays.sort(pixelsFiles); for (String pixelsFile : pixelsFiles) { if (checkSuffix(pixelsFile, "ets")) { files.add(new Location(stackDir, pixelsFile).getAbsolutePath()); if (failOnMissingETS()) { throw new FormatException(message); setCoreIndex(index); String ff = files.get(s); try (RandomAccessInputStream stream = new RandomAccessInputStream(ff)) { parseETSFile(stream, ff, s); if (getSizeX() > newX || getSizeY() > newY) { ms.sizeX = newX; ms.sizeY = newY; setCoreIndex(0); ms.littleEndian = ifd.isLittleEndian(); ms.indexed = p == PhotoInterp.RGB_PALETTE &&
if (tileMap.get(getCoreIndex()) == null) { return new byte[getTileSize()]; int[] zct = getZCTCoords(no); TileCoordinate t = new TileCoordinate(nDimensions.get(getCoreIndex())); t.coordinate[0] = col; t.coordinate[1] = row; int resIndex = getResolution(); int pyramidIndex = getSeries(); if (hasFlattenedResolutions()) { int index = 0; pyramidIndex = 0; for (int i=0; i<core.size(); ) { if (index + core.get(i).resolutionCount <= getSeries()) { index += core.get(i).resolutionCount; i += core.get(i).resolutionCount; resIndex = getSeries() - index; break; ArrayList<TileCoordinate> map = tileMap.get(getCoreIndex()); Integer index = map.indexOf(t); if (index == null || index < 0) { byte[] tile = new byte[getTileSize()]; byte[] color = backgroundColor.get(getCoreIndex()); if (color != null) { for (int q=0; q<getTileSize(); q+=color.length) {
readTags(vsi, populateMetadata || inDimensionProperties, getVolumeName(tag)); long end = vsi.getFilePointer(); if (start >= end) { getVolumeName(tag) : tagPrefix; readTags(vsi, tag != 2037, tagName); long end = vsi.getFilePointer(); if (start == end) { String tagName = getTagName(tag); String value = inlineData ? String.valueOf(dataSize) : " "; try { if (tag == STACK_TYPE) { value = getStackType(value); value = getDeviceSubtype(value); pyramid.deviceTypes.add(value); addMetaList(tagPrefix + tagName, value, pyramids.get(metadataIndex).originalMetadata); addGlobalMetaList(tagPrefix + tagName, value);
if (getCoreIndex() < core.size() - 1) { int tileRows = rows.get(getCoreIndex()); int tileCols = cols.get(getCoreIndex()); getRGBChannelCount() * FormatTools.getBytesPerPixel(getPixelType()); int outputRowLen = w * pixel; int width = tileX.get(getCoreIndex()); int height = tileY.get(getCoreIndex()); Region tile = new Region(col * width, row * height, width, height); if (!tile.intersects(image)) { tileBuf = decodeTile(no, row, col); int ifdIndex = 1 - (core.size() - getCoreIndex()); return parser.getSamples(ifds.get(ifdIndex), buf, x, y, w, h);
CoreMetadata ms = core.get(getCoreIndex()); ms.sizeC * FormatTools.getBytesPerPixel(convertPixelType(pixelType))]; etsFile.read(color); backgroundColor.put(getCoreIndex(), color); ms.pixelType = convertPixelType(pixelType); if (usePyramid) { int finalResolution = 1;
@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(); }
if (!checkSuffix(id, "vsi")) { Location current = new Location(id).getAbsoluteFile(); Location parent = current.getParentFile(); vsi.order(parser.getStream().isLittleEndian()); vsi.seek(8); readTags(vsi, false, ""); Arrays.sort(pixelsFiles); for (String pixelsFile : pixelsFiles) { if (checkSuffix(pixelsFile, "ets")) { files.add(new Location(stackDir, pixelsFile).getAbsolutePath()); if (failOnMissingETS()) { throw new FormatException(message); setCoreIndex(index); String ff = files.get(s); try (RandomAccessInputStream stream = new RandomAccessInputStream(ff)) { parseETSFile(stream, ff, s); if (getSizeX() > newX || getSizeY() > newY) { ms.sizeX = newX; ms.sizeY = newY; setCoreIndex(0); ms.littleEndian = ifd.isLittleEndian(); ms.indexed = p == PhotoInterp.RGB_PALETTE &&
if (tileMap.get(getCoreIndex()) == null) { return new byte[getTileSize()]; int[] zct = getZCTCoords(no); TileCoordinate t = new TileCoordinate(nDimensions.get(getCoreIndex())); t.coordinate[0] = col; t.coordinate[1] = row; int resIndex = getResolution(); int pyramidIndex = getSeries(); if (hasFlattenedResolutions()) { int index = 0; pyramidIndex = 0; for (int i=0; i<core.size(); ) { if (index + core.get(i).resolutionCount <= getSeries()) { index += core.get(i).resolutionCount; i += core.get(i).resolutionCount; resIndex = getSeries() - index; break; ArrayList<TileCoordinate> map = tileMap.get(getCoreIndex()); Integer index = map.indexOf(t); if (index == null || index < 0) { byte[] tile = new byte[getTileSize()]; byte[] color = backgroundColor.get(getCoreIndex()); if (color != null) { for (int q=0; q<getTileSize(); q+=color.length) {
readTags(vsi, populateMetadata || inDimensionProperties, getVolumeName(tag)); long end = vsi.getFilePointer(); if (start >= end) { getVolumeName(tag) : tagPrefix; readTags(vsi, tag != 2037, tagName); long end = vsi.getFilePointer(); if (start == end) { String tagName = getTagName(tag); String value = inlineData ? String.valueOf(dataSize) : " "; try { if (tag == STACK_TYPE) { value = getStackType(value); value = getDeviceSubtype(value); pyramid.deviceTypes.add(value); addMetaList(tagPrefix + tagName, value, pyramids.get(metadataIndex).originalMetadata); addGlobalMetaList(tagPrefix + tagName, value);
if (getCoreIndex() < core.size() - 1) { int tileRows = rows.get(getCoreIndex()); int tileCols = cols.get(getCoreIndex()); getRGBChannelCount() * FormatTools.getBytesPerPixel(getPixelType()); int outputRowLen = w * pixel; int width = tileX.get(getCoreIndex()); int height = tileY.get(getCoreIndex()); Region tile = new Region(col * width, row * height, width, height); if (!tile.intersects(image)) { tileBuf = decodeTile(no, row, col); int ifdIndex = 1 - (core.size() - getCoreIndex()); return parser.getSamples(ifds.get(ifdIndex), buf, x, y, w, h);
private int getTileSize() { int channels = getRGBChannelCount(); int bpp = FormatTools.getBytesPerPixel(getPixelType()); int index = getCoreIndex(); return bpp * channels * tileX.get(index) * tileY.get(index); }
CoreMetadata ms = core.get(getCoreIndex()); ms.sizeC * FormatTools.getBytesPerPixel(convertPixelType(pixelType))]; etsFile.read(color); backgroundColor.put(getCoreIndex(), color); ms.pixelType = convertPixelType(pixelType); if (usePyramid) { int finalResolution = 1;
@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 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 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(); }