< prev index next >

src/java.desktop/share/classes/com/sun/imageio/plugins/wbmp/WBMPImageReader.java

Print this page

        

*** 75,115 **** --- 75,120 ---- public WBMPImageReader(ImageReaderSpi originator) { super(originator); } /** Overrides the method defined in the superclass. */ + @Override public void setInput(Object input, boolean seekForwardOnly, boolean ignoreMetadata) { super.setInput(input, seekForwardOnly, ignoreMetadata); iis = (ImageInputStream) input; // Always works gotHeader = false; } /** Overrides the method defined in the superclass. */ + @Override public int getNumImages(boolean allowSearch) throws IOException { if (iis == null) { throw new IllegalStateException(I18N.getString("GetNumImages0")); } if (seekForwardOnly && allowSearch) { throw new IllegalStateException(I18N.getString("GetNumImages1")); } return 1; } + @Override public int getWidth(int imageIndex) throws IOException { checkIndex(imageIndex); readHeader(); return width; } + @Override public int getHeight(int imageIndex) throws IOException { checkIndex(imageIndex); readHeader(); return height; } + @Override public boolean isRandomAccessEasy(int imageIndex) throws IOException { checkIndex(imageIndex); return true; }
*** 150,159 **** --- 155,165 ---- metadata.height = height; gotHeader = true; } + @Override public Iterator<ImageTypeSpecifier> getImageTypes(int imageIndex) throws IOException { checkIndex(imageIndex); readHeader();
*** 162,188 **** --- 168,198 ---- ArrayList<ImageTypeSpecifier> list = new ArrayList<>(1); list.add(new ImageTypeSpecifier(bi)); return list.iterator(); } + @Override public ImageReadParam getDefaultReadParam() { return new ImageReadParam(); } + @Override public IIOMetadata getImageMetadata(int imageIndex) throws IOException { checkIndex(imageIndex); if (metadata == null) { readHeader(); } return metadata; } + @Override public IIOMetadata getStreamMetadata() throws IOException { return null; } + @Override public BufferedImage read(int imageIndex, ImageReadParam param) throws IOException { if (iis == null) { throw new IllegalStateException(I18N.getString("WBMPImageReader1"));
*** 294,313 **** --- 304,326 ---- else processImageComplete(); return bi; } + @Override public boolean canReadRaster() { return true; } + @Override public Raster readRaster(int imageIndex, ImageReadParam param) throws IOException { BufferedImage bi = read(imageIndex, param); return bi.getData(); } + @Override public void reset() { super.reset(); iis = null; gotHeader = false; }
< prev index next >