< prev index next >
src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 2000, 2018, 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) 2000, 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
*** 276,285 ****
--- 276,286 ----
} finally {
cbLock.unlock();
}
}
+ @Override
public void setInput(Object input,
boolean seekForwardOnly,
boolean ignoreMetadata)
{
setThreadLock();
*** 382,391 ****
--- 383,393 ----
iis.flushBefore(pos.longValue());
}
tablesOnlyChecked = true;
}
+ @Override
public int getNumImages(boolean allowSearch) throws IOException {
setThreadLock();
try { // locked thread
cbLock.check();
*** 828,837 ****
--- 830,840 ----
}
}
}
}
+ @Override
public int getWidth(int imageIndex) throws IOException {
setThreadLock();
try {
if (currentImage != imageIndex) {
cbLock.check();
*** 841,850 ****
--- 844,854 ----
} finally {
clearThreadLock();
}
}
+ @Override
public int getHeight(int imageIndex) throws IOException {
setThreadLock();
try {
if (currentImage != imageIndex) {
cbLock.check();
*** 869,878 ****
--- 873,883 ----
ret = ImageTypeProducer.getTypeProducer(code);
}
return ret;
}
+ @Override
public ImageTypeSpecifier getRawImageType(int imageIndex)
throws IOException {
setThreadLock();
try {
if (currentImage != imageIndex) {
*** 886,895 ****
--- 891,901 ----
} finally {
clearThreadLock();
}
}
+ @Override
public Iterator<ImageTypeSpecifier> getImageTypes(int imageIndex)
throws IOException {
setThreadLock();
try {
return getImageTypesOnThread(imageIndex);
*** 1056,1069 ****
--- 1062,1077 ----
*/
private native void setOutColorSpace(long structPointer, int id);
/////// End of Color Conversion & Image Types
+ @Override
public ImageReadParam getDefaultReadParam() {
return new JPEGImageReadParam();
}
+ @Override
public IIOMetadata getStreamMetadata() throws IOException {
setThreadLock();
try {
if (!tablesOnlyChecked) {
cbLock.check();
*** 1073,1082 ****
--- 1081,1091 ----
} finally {
clearThreadLock();
}
}
+ @Override
public IIOMetadata getImageMetadata(int imageIndex)
throws IOException {
setThreadLock();
try {
// imageMetadataIndex will always be either a valid index or
*** 1099,1108 ****
--- 1108,1118 ----
} finally {
clearThreadLock();
}
}
+ @Override
public BufferedImage read(int imageIndex, ImageReadParam param)
throws IOException {
setThreadLock();
try {
cbLock.check();
*** 1491,1500 ****
--- 1501,1511 ----
* We should call clearNativeReadAbortFlag() before we start reading
* jpeg image as image processing happens at native side.
*/
private native void clearNativeReadAbortFlag(long structPointer);
+ @Override
public void abort() {
setThreadLock();
try {
/**
* NB: we do not check the call back lock here,
*** 1512,1525 ****
--- 1523,1538 ----
private native void abortRead(long structPointer);
/** Resets library state when an exception occurred during a read. */
private native void resetLibraryState(long structPointer);
+ @Override
public boolean canReadRaster() {
return true;
}
+ @Override
public Raster readRaster(int imageIndex, ImageReadParam param)
throws IOException {
setThreadLock();
Raster retval = null;
try {
*** 1554,1567 ****
--- 1567,1582 ----
clearThreadLock();
}
return retval;
}
+ @Override
public boolean readerSupportsThumbnails() {
return true;
}
+ @Override
public int getNumThumbnails(int imageIndex) throws IOException {
setThreadLock();
try {
cbLock.check();
*** 1579,1588 ****
--- 1594,1604 ----
} finally {
clearThreadLock();
}
}
+ @Override
public int getThumbnailWidth(int imageIndex, int thumbnailIndex)
throws IOException {
setThreadLock();
try {
cbLock.check();
*** 1599,1608 ****
--- 1615,1625 ----
} finally {
clearThreadLock();
}
}
+ @Override
public int getThumbnailHeight(int imageIndex, int thumbnailIndex)
throws IOException {
setThreadLock();
try {
cbLock.check();
*** 1619,1628 ****
--- 1636,1646 ----
} finally {
clearThreadLock();
}
}
+ @Override
public BufferedImage readThumbnail(int imageIndex,
int thumbnailIndex)
throws IOException {
setThreadLock();
try {
*** 1663,1672 ****
--- 1681,1691 ----
tablesOnlyChecked = false;
iccCS = null;
initProgressData();
}
+ @Override
public void reset() {
setThreadLock();
try {
cbLock.check();
super.reset();
*** 1675,1684 ****
--- 1694,1704 ----
}
}
private native void resetReader(long structPointer);
+ @Override
public void dispose() {
setThreadLock();
try {
cbLock.check();
*** 1698,1707 ****
--- 1718,1728 ----
public JPEGReaderDisposerRecord(long pData) {
this.pData = pData;
}
+ @Override
public synchronized void dispose() {
if (pData != 0) {
disposeReader(pData);
pData = 0;
}
< prev index next >