/** Gets the local reader index for use with the given image plane. */ public int getAdjustedIndex(int no) throws FormatException, IOException { if (noStitch) return no; int[] q = computeIndices(no); int ino = q[1]; return ino; }
/** Gets the local reader index for use with the given image plane. */ public int getAdjustedIndex(int no) throws FormatException, IOException { if (noStitch) return no; int[] q = computeIndices(no); int ino = q[1]; return ino; }
/** Gets the reader appropriate for use with the given image plane. */ public IFormatReader getReader(int no) throws FormatException, IOException { if (noStitch) return reader; int[] q = computeIndices(no); int fno = q[0]; return getReader(getCoreIndex(), fno); }
/** Gets the reader appropriate for use with the given image plane. */ public IFormatReader getReader(int no) throws FormatException, IOException { if (noStitch) return reader; int[] q = computeIndices(no); int fno = q[0]; return getReader(getCoreIndex(), fno); }
@Override public byte[] openBytes(int no, byte[] buf, int x, int y, int w, int h) throws FormatException, IOException { FormatTools.assertId(getCurrentFile(), true, 2); int[] pos = computeIndices(no); IFormatReader r = getReader(getCoreIndex(), pos[0]); int ino = pos[1]; if (ino < r.getImageCount()) { byte[] b = r.openBytes(ino, buf, x, y, w, h); if (!noStitch && ino == r.getImageCount() - 1) { r.close(); } return b; } // return a blank image to cover for the fact that // this file does not contain enough image planes Arrays.fill(buf, (byte) 0); return buf; }
@Override public byte[] openBytes(int no, byte[] buf, int x, int y, int w, int h) throws FormatException, IOException { FormatTools.assertId(getCurrentFile(), true, 2); int[] pos = computeIndices(no); IFormatReader r = getReader(getCoreIndex(), pos[0]); int ino = pos[1]; if (ino < r.getImageCount()) { byte[] b = r.openBytes(ino, buf, x, y, w, h); if (!noStitch && ino == r.getImageCount() - 1) { r.close(); } return b; } // return a blank image to cover for the fact that // this file does not contain enough image planes Arrays.fill(buf, (byte) 0); return buf; }