/** * @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 { checkParams(no, buf, x, y, w, h); MetadataRetrieve meta = getMetadataRetrieve(); BufferedImage image = AWTImageTools.makeImage(buf, interleaved, meta, series); savePlane(no, image, x, y, w, h); }
/** * @see loci.formats.IFormatWriter#savePlane(int, Object, int, int, int, int) */ @Override public void savePlane(int no, Object plane, int x, int y, int w, int h) throws FormatException, IOException { if (!(plane instanceof Image)) { throw new IllegalArgumentException( "Object to save must be a java.awt.Image"); } if (!isFullPlane(x, y, w, h)) { throw new FormatException("ImageIOWriter does not support writing tiles"); } BufferedImage img = AWTImageTools.makeBuffered((Image) plane, cm); ImageIO.write(img, kind, out); }
/** * @see loci.formats.IFormatWriter#savePlane(int, Object, int, int, int, int) */ @Override public void savePlane(int no, Object plane, int x, int y, int w, int h) throws FormatException, IOException { if (!(plane instanceof Image)) { throw new IllegalArgumentException( "Object to save must be a java.awt.Image"); } if (!isFullPlane(x, y, w, h)) { throw new FormatException("ImageIOWriter does not support writing tiles"); } BufferedImage img = AWTImageTools.makeBuffered((Image) plane, cm); ImageIO.write(img, kind, out); }
/** * @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 { checkParams(no, buf, x, y, w, h); MetadataRetrieve meta = getMetadataRetrieve(); BufferedImage image = AWTImageTools.makeImage(buf, interleaved, meta, series); savePlane(no, image, x, y, w, h); }