/** * Saves the given image to the specified (possibly already open) file. * The IFD hashtable allows specification of TIFF parameters such as bit * depth, compression and units. */ public void saveBytes(int no, byte[] buf, IFD ifd) throws IOException, FormatException { int w = getSizeX(); int h = getSizeY(); saveBytes(no, buf, ifd, 0, 0, w, h); }
/** * @see loci.formats.IFormatWriter#saveBytes(int, byte[], int, int, int, int) */ @Override public void saveBytes(int no, byte[] buf, int x, int y, int w, int h) throws FormatException, IOException { // always save to full image saveBytes(no, buf); }
@Override public int getPlaneCount() { return getPlaneCount(series); }
@Override public void setId(String id) throws FormatException, IOException { if (id.equals(currentId)) return; super.setId(id); if (imageLocations == null) { MetadataRetrieve r = getMetadataRetrieve(); imageLocations = new String[r.getImageCount()][]; for (int i=0; i<imageLocations.length; i++) { setSeries(i); imageLocations[i] = new String[planeCount()]; } setSeries(0); } }
/** * @see loci.formats.IFormatWriter#saveBytes(int, byte[], int, int, int, int) */ @Override public void saveBytes(int no, byte[] buf, IFD ifd, int x, int y, int w, int h) throws FormatException, IOException { super.saveBytes(no, buf, ifd, x, y, w, h); int index = no; while (imageLocations[series][index] != null) { if (index < imageLocations[series].length - 1) { index++; } else { break; } } imageLocations[series][index] = currentId; }
@Override public void setId(String id) throws FormatException, IOException { log.debug("setId(" + id + ")"); super.setId(id); }
/** * @see loci.formats.IFormatWriter#saveBytes(int, byte[], int, int, int, int) */ @Override public void saveBytes(int no, byte[] buf, int x, int y, int w, int h) throws FormatException, IOException { saveBytes(no, buf, null, x, y, w, h); }
@Override public boolean isThisType(String name) { if (!super.isThisType(name)) { return false; } if (resolutionData.size() > 0) { return true; } MetadataRetrieve r = getMetadataRetrieve(); if (!(r instanceof IPyramidStore)) { return false; } return ((IPyramidStore) r).getResolutionCount(0) > 1; }
private int crc(byte[] buf) { return crc(buf, 0, buf.length); }
/** * @see loci.formats.IFormatWriter#saveBytes(int, byte[], int, int, int, int) */ @Override public void saveBytes(int no, byte[] buf, int x, int y, int w, int h) throws FormatException, IOException { if(wlz != null) { checkParams(no, buf, x, y, w, h); wlz.saveBytes(no, buf, x, y, w, h); } }
public String getCompanion() { MetadataOptions options = getMetadataOptions(); if (options instanceof DynamicMetadataOptions) { return ((DynamicMetadataOptions) options).get(COMPANION_KEY); } return null; }
@Override public void close() throws IOException { if (out != null) writeFooter(); super.close(); }
@Override public void setId(String id) throws FormatException, IOException { if (id.equals(currentId)) return; super.setId(id); if (imageLocations == null) { MetadataRetrieve r = getMetadataRetrieve(); imageLocations = new String[r.getImageCount()][]; for (int i=0; i<imageLocations.length; i++) { setSeries(i); imageLocations[i] = new String[planeCount()]; } setSeries(0); } }
/** * Saves the given image to the specified (possibly already open) file. * The IFD hashtable allows specification of TIFF parameters such as bit * depth, compression and units. */ public void saveBytes(int no, byte[] buf, IFD ifd) throws IOException, FormatException { int w = getSizeX(); int h = getSizeY(); saveBytes(no, buf, ifd, 0, 0, w, h); }
/** * @see loci.formats.IFormatWriter#saveBytes(int, byte[], int, int, int, int) */ @Override public void saveBytes(int no, byte[] buf, int x, int y, int w, int h) throws FormatException, IOException { saveBytes(no, buf, null, x, y, w, h); }
@Override public int getPlaneCount() { return getPlaneCount(series); }
@Override public boolean isThisType(String name) { if (!super.isThisType(name)) { return false; } if (resolutionData.size() > 0) { return true; } MetadataRetrieve r = getMetadataRetrieve(); if (!(r instanceof IPyramidStore)) { return false; } return ((IPyramidStore) r).getResolutionCount(0) > 1; }
/** * @see loci.formats.IFormatWriter#saveBytes(int, byte[], int, int, int, int) */ @Override public void saveBytes(int no, byte[] buf, int x, int y, int w, int h) throws FormatException, IOException { // always save to full image saveBytes(no, buf); }
private int crc(byte[] buf) { return crc(buf, 0, buf.length); }
/** * @see loci.formats.IFormatWriter#saveBytes(int, byte[], int, int, int, int) */ @Override public void saveBytes(int no, byte[] buf, int x, int y, int w, int h) throws FormatException, IOException { if(wlz != null) { checkParams(no, buf, x, y, w, h); wlz.saveBytes(no, buf, x, y, w, h); } }