public J2KRenderedImage(ImageInputStream iis, J2KImageReadParamJava param, J2KImageReader reader) throws IOException { this(new J2KReadState(iis, param, reader)); }
public J2KRenderedImage(ImageInputStream iis, J2KImageReadParamJava param, J2KMetadata metadata, J2KImageReader reader) throws IOException { this(new J2KReadState(iis, param, metadata, reader)); }
public Raster readRaster(int imageIndex, ImageReadParam param) throws IOException { checkIndex(imageIndex); processImageStarted(imageIndex); if (param == null) { param = getDefaultReadParam(); } param = new J2KImageReadParamJava(param); if (!ignoreMetadata) { imageMetadata = new J2KMetadata(); iis.seek(streamPosition0); readState = new J2KReadState(iis, (J2KImageReadParamJava)param, imageMetadata, this); } else { iis.seek(streamPosition0); readState = new J2KReadState(iis, (J2KImageReadParamJava)param, this); } Raster ras = readState.readAsRaster(); if (abortRequested()) processReadAborted(); else processImageComplete(); return ras; }
public void readHeader() { if (gotHeader) return; if (readState == null) { try { iis.seek(streamPosition0); } catch(IOException e) { // XXX ignore } readState = new J2KReadState(iis, new J2KImageReadParamJava(getDefaultReadParam()), this); } hd = readState.getHeader(); gotHeader = true; this.width = hd.getImgWidth(); this.height = hd.getImgHeight(); }
public BufferedImage read(int imageIndex, ImageReadParam param) throws IOException { checkIndex(imageIndex); clearAbortRequest(); processImageStarted(imageIndex); if (param == null) param = getDefaultReadParam(); param = new J2KImageReadParamJava(param); if (!ignoreMetadata) { imageMetadata = new J2KMetadata(); iis.seek(streamPosition0); readState = new J2KReadState(iis, (J2KImageReadParamJava)param, imageMetadata, this); } else { iis.seek(streamPosition0); readState = new J2KReadState(iis, (J2KImageReadParamJava)param, this); } BufferedImage bi = readState.readBufferedImage(); if (abortRequested()) processReadAborted(); else processImageComplete(); return bi; }