< prev index next >
src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFImageReader.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 2005, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
*** 134,143 ****
--- 134,144 ----
public TIFFImageReader(ImageReaderSpi originatingProvider) {
super(originatingProvider);
}
+ @Override
public void setInput(Object input,
boolean seekForwardOnly,
boolean ignoreMetadata) {
super.setInput(input, seekForwardOnly, ignoreMetadata);
*** 243,252 ****
--- 244,254 ----
}
currIndex = imageIndex;
return imageIndex;
}
+ @Override
public int getNumImages(boolean allowSearch) throws IOException {
if (stream == null) {
throw new IllegalStateException("Input not set!");
}
if (seekForwardOnly && allowSearch) {
*** 260,269 ****
--- 262,272 ----
this.numImages = locateImage(Integer.MAX_VALUE) + 1;
}
return numImages;
}
+ @Override
public IIOMetadata getStreamMetadata() throws IIOException {
readHeader();
return streamMetadata;
}
*** 485,499 ****
--- 488,504 ----
} else {
return f.getAsInt(0);
}
}
+ @Override
public int getWidth(int imageIndex) throws IOException {
seekToImage(imageIndex);
return getWidth();
}
+ @Override
public int getHeight(int imageIndex) throws IOException {
seekToImage(imageIndex);
return getHeight();
}
*** 697,706 ****
--- 702,712 ----
if (f != null) {
extraSamples = f.getAsInts();
}
}
+ @Override
public Iterator<ImageTypeSpecifier> getImageTypes(int imageIndex) throws IIOException {
List<ImageTypeSpecifier> l; // List of ImageTypeSpecifiers
Integer imageIndexInteger = Integer.valueOf(imageIndex);
if (imageTypeMap.containsKey(imageIndexInteger)) {
*** 824,833 ****
--- 830,840 ----
}
return l.iterator();
}
+ @Override
public IIOMetadata getImageMetadata(int imageIndex) throws IIOException {
seekToImage(imageIndex);
TIFFImageMetadata im
= new TIFFImageMetadata(imageMetadata.getRootIFD().getTagSetList());
Node root
*** 842,851 ****
--- 849,859 ----
Node root = sm.getAsTree(TIFFStreamMetadata.NATIVE_METADATA_FORMAT_NAME);
sm.setFromTree(TIFFStreamMetadata.NATIVE_METADATA_FORMAT_NAME, root);
return sm;
}
+ @Override
public boolean isRandomAccessEasy(int imageIndex) throws IOException {
if (currIndex != -1) {
seekToImage(currIndex);
return getCompression() == BaselineTIFFTagSet.COMPRESSION_NONE;
} else {
*** 856,895 ****
--- 864,910 ----
// Thumbnails
public boolean readSupportsThumbnails() {
return false;
}
+ @Override
public boolean hasThumbnails(int imageIndex) {
return false;
}
+ @Override
public int getNumThumbnails(int imageIndex) throws IOException {
return 0;
}
+ @Override
public ImageReadParam getDefaultReadParam() {
return new TIFFImageReadParam();
}
+ @Override
public boolean isImageTiled(int imageIndex) throws IOException {
seekToImage(imageIndex);
TIFFField f
= imageMetadata.getTIFFField(BaselineTIFFTagSet.TAG_TILE_WIDTH);
return f != null;
}
+ @Override
public int getTileWidth(int imageIndex) throws IOException {
seekToImage(imageIndex);
return getTileOrStripWidth();
}
+ @Override
public int getTileHeight(int imageIndex) throws IOException {
seekToImage(imageIndex);
return getTileOrStripHeight();
}
+ @Override
public BufferedImage readTile(int imageIndex, int tileX, int tileY)
throws IOException {
int w = getWidth(imageIndex);
int h = getHeight(imageIndex);
*** 916,929 ****
--- 931,946 ----
param.setSourceRegion(tileRect);
return read(imageIndex, param);
}
+ @Override
public boolean canReadRaster() {
return false;
}
+ @Override
public Raster readRaster(int imageIndex, ImageReadParam param)
throws IOException {
throw new UnsupportedOperationException();
}
*** 1007,1016 ****
--- 1024,1034 ----
"Destination band out of range!");
}
}
}
+ @Override
public RenderedImage readAsRenderedImage(int imageIndex,
ImageReadParam param)
throws IOException {
prepareRead(imageIndex, param);
return new TIFFRenderedImage(this, imageIndex, imageReadParam,
*** 1133,1142 ****
--- 1151,1161 ----
dstMinX, dstMinY, dstWidth, dstHeight,
1, 1,
destinationBands);
}
+ @Override
public BufferedImage read(int imageIndex, ImageReadParam param)
throws IOException {
prepareRead(imageIndex, param);
this.theImage = getDestination(param,
getImageTypes(imageIndex),
*** 1351,1360 ****
--- 1370,1380 ----
}
processImageComplete();
return theImage;
}
+ @Override
public void reset() {
super.reset();
resetLocal();
}
< prev index next >