Class<? extends IFormatWriter> imageWriterClass) throws FormatException WriterWrapper wrapperCopy = duplicateRecurse(imageWriterClass); boolean interleaved = isInterleaved(); ColorModel cm = getColorModel(); int rate = getFramesPerSecond(); String compress = getCompression(); int tileSizeX = getTileSizeX(); int tileSizeY = getTileSizeY(); wrapperCopy.setInterleaved(interleaved); wrapperCopy.setColorModel(cm); wrapperCopy.setFramesPerSecond(rate); wrapperCopy.setCompression(compress); wrapperCopy.setTileSizeX(tileSizeX); wrapperCopy.setTileSizeY(tileSizeY); return wrapperCopy;
/** * Unwraps nested wrapped writers until the given writer class is found. * * @param writerClass Class of the desired nested writer. If null, the * core writer (i.e., deepest wrapped writer) will be returned. * @param id Id to use as a basis when unwrapping any nested * {@link ImageWriter}s. If null, the current id is used. */ public IFormatWriter unwrap(Class<? extends IFormatWriter> writerClass, String id) throws FormatException, IOException { IFormatWriter w = this; while (w instanceof WriterWrapper || w instanceof ImageWriter) { if (writerClass != null && writerClass.isInstance(w)) break; if (w instanceof ImageWriter) { ImageWriter iw = (ImageWriter) w; w = id == null ? iw.getWriter() : iw.getWriter(id); } else w = ((WriterWrapper) w).getWriter(); } if (writerClass != null && !writerClass.isInstance(w)) return null; return w; }
if (writer instanceof WriterWrapper) { childCopy = ((WriterWrapper) writer).duplicateRecurse(imageWriterClass);
/** * Unwraps nested wrapped writers until the given writer class is found. * * @param writerClass Class of the desired nested writer. If null, the * core writer (i.e., deepest wrapped writer) will be returned. * @param id Id to use as a basis when unwrapping any nested * {@link ImageWriter}s. If null, the current id is used. */ public IFormatWriter unwrap(Class<? extends IFormatWriter> writerClass, String id) throws FormatException, IOException { IFormatWriter w = this; while (w instanceof WriterWrapper || w instanceof ImageWriter) { if (writerClass != null && writerClass.isInstance(w)) break; if (w instanceof ImageWriter) { ImageWriter iw = (ImageWriter) w; w = id == null ? iw.getWriter() : iw.getWriter(id); } else w = ((WriterWrapper) w).getWriter(); } if (writerClass != null && !writerClass.isInstance(w)) return null; return w; }
if (writer instanceof WriterWrapper) { childCopy = ((WriterWrapper) writer).duplicateRecurse(imageWriterClass);
Class<? extends IFormatWriter> imageWriterClass) throws FormatException WriterWrapper wrapperCopy = duplicateRecurse(imageWriterClass); boolean interleaved = isInterleaved(); ColorModel cm = getColorModel(); int rate = getFramesPerSecond(); String compress = getCompression(); int tileSizeX = getTileSizeX(); int tileSizeY = getTileSizeY(); wrapperCopy.setInterleaved(interleaved); wrapperCopy.setColorModel(cm); wrapperCopy.setFramesPerSecond(rate); wrapperCopy.setCompression(compress); wrapperCopy.setTileSizeX(tileSizeX); wrapperCopy.setTileSizeY(tileSizeY); return wrapperCopy;
handler = ((WriterWrapper) handler).getWriter();
handler = ((WriterWrapper) handler).getWriter();