mirror of
https://github.com/openjdk/jdk.git
synced 2026-02-09 01:48:34 +00:00
8371759: Add missing @Override annotations in com.sun.imageio package
Reviewed-by: tr, jdv, azvegint
This commit is contained in:
parent
195b36f90b
commit
0c6d1b9c8b
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2025, 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
|
||||
@ -61,6 +61,7 @@ public class BMPImageReaderSpi extends ImageReaderSpi {
|
||||
null, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRegistration(ServiceRegistry registry,
|
||||
Class<?> category) {
|
||||
if (registered) {
|
||||
@ -69,10 +70,12 @@ public class BMPImageReaderSpi extends ImageReaderSpi {
|
||||
registered = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription(Locale locale) {
|
||||
return "Standard BMP Image Reader";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canDecodeInput(Object source) throws IOException {
|
||||
if (!(source instanceof ImageInputStream)) {
|
||||
return false;
|
||||
@ -87,6 +90,7 @@ public class BMPImageReaderSpi extends ImageReaderSpi {
|
||||
return full && (b[0] == 0x42) && (b[1] == 0x4d);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ImageReader createReaderInstance(Object extension)
|
||||
throws IIOException {
|
||||
return new BMPImageReader(this);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2025, 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
|
||||
@ -66,10 +66,12 @@ public class BMPImageWriterSpi extends ImageWriterSpi {
|
||||
null, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription(Locale locale) {
|
||||
return "Standard BMP Image Writer";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRegistration(ServiceRegistry registry,
|
||||
Class<?> category) {
|
||||
if (registered) {
|
||||
@ -79,6 +81,7 @@ public class BMPImageWriterSpi extends ImageWriterSpi {
|
||||
registered = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canEncodeImage(ImageTypeSpecifier type) {
|
||||
int dataType= type.getSampleModel().getDataType();
|
||||
if (dataType < DataBuffer.TYPE_BYTE || dataType > DataBuffer.TYPE_INT)
|
||||
@ -99,6 +102,7 @@ public class BMPImageWriterSpi extends ImageWriterSpi {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ImageWriter createWriterInstance(Object extension)
|
||||
throws IIOException {
|
||||
return new BMPImageWriter(this);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2025, 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
|
||||
@ -94,10 +94,12 @@ public class BMPMetadata extends IIOMetadata implements BMPConstants {
|
||||
null, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isReadOnly() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Node getAsTree(String formatName) {
|
||||
if (formatName.equals(nativeMetadataFormatName)) {
|
||||
return getNativeTree();
|
||||
@ -177,6 +179,7 @@ public class BMPMetadata extends IIOMetadata implements BMPConstants {
|
||||
}
|
||||
|
||||
// Standard tree node methods
|
||||
@Override
|
||||
protected IIOMetadataNode getStandardChromaNode() {
|
||||
|
||||
if ((palette != null) && (paletteSize > 0)) {
|
||||
@ -202,6 +205,7 @@ public class BMPMetadata extends IIOMetadata implements BMPConstants {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected IIOMetadataNode getStandardCompressionNode() {
|
||||
IIOMetadataNode node = new IIOMetadataNode("Compression");
|
||||
|
||||
@ -212,6 +216,7 @@ public class BMPMetadata extends IIOMetadata implements BMPConstants {
|
||||
return node;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected IIOMetadataNode getStandardDataNode() {
|
||||
IIOMetadataNode node = new IIOMetadataNode("Data");
|
||||
|
||||
@ -230,6 +235,7 @@ public class BMPMetadata extends IIOMetadata implements BMPConstants {
|
||||
return node;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected IIOMetadataNode getStandardDimensionNode() {
|
||||
if (yPixelsPerMeter > 0.0F && xPixelsPerMeter > 0.0F) {
|
||||
IIOMetadataNode node = new IIOMetadataNode("Dimension");
|
||||
@ -251,14 +257,17 @@ public class BMPMetadata extends IIOMetadata implements BMPConstants {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFromTree(String formatName, Node root) {
|
||||
throw new IllegalStateException(I18N.getString("BMPMetadata1"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mergeTree(String formatName, Node root) {
|
||||
throw new IllegalStateException(I18N.getString("BMPMetadata1"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset() {
|
||||
throw new IllegalStateException(I18N.getString("BMPMetadata1"));
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2025, 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
|
||||
@ -194,6 +194,7 @@ public class BMPMetadataFormat extends IIOMetadataFormatImpl {
|
||||
DATATYPE_STRING, true, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canNodeAppear(String elementName,
|
||||
ImageTypeSpecifier imageType) {
|
||||
return true;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2025, 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
|
||||
@ -33,6 +33,7 @@ public class BMPMetadataFormatResources extends ListResourceBundle {
|
||||
|
||||
public BMPMetadataFormatResources() {}
|
||||
|
||||
@Override
|
||||
protected Object[][] getContents() {
|
||||
return new Object[][] {
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2025, 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
|
||||
@ -79,6 +79,7 @@ public class BogusColorSpace extends ColorSpace {
|
||||
// specified behavior of the methods vis-a-vis exceptions.
|
||||
//
|
||||
|
||||
@Override
|
||||
public float[] toRGB(float[] colorvalue) {
|
||||
if(colorvalue.length < getNumComponents()) {
|
||||
throw new ArrayIndexOutOfBoundsException
|
||||
@ -93,6 +94,7 @@ public class BogusColorSpace extends ColorSpace {
|
||||
return rgbvalue;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float[] fromRGB(float[] rgbvalue) {
|
||||
if(rgbvalue.length < 3) {
|
||||
throw new ArrayIndexOutOfBoundsException
|
||||
@ -107,6 +109,7 @@ public class BogusColorSpace extends ColorSpace {
|
||||
return colorvalue;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float[] toCIEXYZ(float[] colorvalue) {
|
||||
if(colorvalue.length < getNumComponents()) {
|
||||
throw new ArrayIndexOutOfBoundsException
|
||||
@ -121,6 +124,7 @@ public class BogusColorSpace extends ColorSpace {
|
||||
return xyzvalue;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float[] fromCIEXYZ(float[] xyzvalue) {
|
||||
if(xyzvalue.length < 3) {
|
||||
throw new ArrayIndexOutOfBoundsException
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2025, 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
|
||||
@ -39,10 +39,12 @@ public class InputStreamAdapter extends InputStream {
|
||||
this.stream = stream;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int read() throws IOException {
|
||||
return stream.read();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int read(byte[] b, int off, int len) throws IOException {
|
||||
return stream.read(b, off, len);
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2025, 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
|
||||
@ -58,14 +58,17 @@ public final class SimpleCMYKColorSpace extends ColorSpace {
|
||||
csRGB = ColorSpace.getInstance(ColorSpace.CS_LINEAR_RGB);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
return o instanceof SimpleCMYKColorSpace;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return System.identityHashCode(theInstance);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float[] toRGB(float[] colorvalue) {
|
||||
float C = colorvalue[0];
|
||||
float M = colorvalue[1];
|
||||
@ -97,6 +100,7 @@ public final class SimpleCMYKColorSpace extends ColorSpace {
|
||||
return rgbvalue;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float[] fromRGB(float[] rgbvalue) {
|
||||
// Convert from sRGB to linear RGB.
|
||||
for (int i = 0; i < 3; i++) {
|
||||
@ -128,10 +132,12 @@ public final class SimpleCMYKColorSpace extends ColorSpace {
|
||||
return new float[] {C, M, Y, K};
|
||||
}
|
||||
|
||||
@Override
|
||||
public float[] toCIEXYZ(float[] colorvalue) {
|
||||
return csRGB.toCIEXYZ(toRGB(colorvalue));
|
||||
}
|
||||
|
||||
@Override
|
||||
public float[] fromCIEXYZ(float[] xyzvalue) {
|
||||
return fromRGB(csRGB.fromCIEXYZ(xyzvalue));
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2025, 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
|
||||
@ -74,6 +74,7 @@ public abstract class SimpleRenderedImage implements RenderedImage {
|
||||
protected Hashtable<String,Object> properties = new Hashtable<String,Object>();
|
||||
|
||||
/** Returns the X coordinate of the leftmost column of the image. */
|
||||
@Override
|
||||
public int getMinX() {
|
||||
return minX;
|
||||
}
|
||||
@ -89,6 +90,7 @@ public abstract class SimpleRenderedImage implements RenderedImage {
|
||||
}
|
||||
|
||||
/** Returns the X coordinate of the uppermost row of the image. */
|
||||
@Override
|
||||
public int getMinY() {
|
||||
return minY;
|
||||
}
|
||||
@ -104,11 +106,13 @@ public abstract class SimpleRenderedImage implements RenderedImage {
|
||||
}
|
||||
|
||||
/** Returns the width of the image. */
|
||||
@Override
|
||||
public int getWidth() {
|
||||
return width;
|
||||
}
|
||||
|
||||
/** Returns the height of the image. */
|
||||
@Override
|
||||
public int getHeight() {
|
||||
return height;
|
||||
}
|
||||
@ -119,11 +123,13 @@ public abstract class SimpleRenderedImage implements RenderedImage {
|
||||
}
|
||||
|
||||
/** Returns the width of a tile. */
|
||||
@Override
|
||||
public int getTileWidth() {
|
||||
return tileWidth;
|
||||
}
|
||||
|
||||
/** Returns the height of a tile. */
|
||||
@Override
|
||||
public int getTileHeight() {
|
||||
return tileHeight;
|
||||
}
|
||||
@ -131,6 +137,7 @@ public abstract class SimpleRenderedImage implements RenderedImage {
|
||||
/**
|
||||
* Returns the X coordinate of the upper-left pixel of tile (0, 0).
|
||||
*/
|
||||
@Override
|
||||
public int getTileGridXOffset() {
|
||||
return tileGridXOffset;
|
||||
}
|
||||
@ -138,6 +145,7 @@ public abstract class SimpleRenderedImage implements RenderedImage {
|
||||
/**
|
||||
* Returns the Y coordinate of the upper-left pixel of tile (0, 0).
|
||||
*/
|
||||
@Override
|
||||
public int getTileGridYOffset() {
|
||||
return tileGridYOffset;
|
||||
}
|
||||
@ -147,6 +155,7 @@ public abstract class SimpleRenderedImage implements RenderedImage {
|
||||
* getMinTileX() is implemented in terms of getMinX()
|
||||
* and so does not need to be implemented by subclasses.
|
||||
*/
|
||||
@Override
|
||||
public int getMinTileX() {
|
||||
return XToTileX(getMinX());
|
||||
}
|
||||
@ -166,6 +175,7 @@ public abstract class SimpleRenderedImage implements RenderedImage {
|
||||
* of getMinTileX() and getMaxTileX() and so does not need to be
|
||||
* implemented by subclasses.
|
||||
*/
|
||||
@Override
|
||||
public int getNumXTiles() {
|
||||
return getMaxTileX() - getMinTileX() + 1;
|
||||
}
|
||||
@ -175,6 +185,7 @@ public abstract class SimpleRenderedImage implements RenderedImage {
|
||||
* is implemented in terms of getMinY() and so does not need to be
|
||||
* implemented by subclasses.
|
||||
*/
|
||||
@Override
|
||||
public int getMinTileY() {
|
||||
return YToTileY(getMinY());
|
||||
}
|
||||
@ -194,16 +205,19 @@ public abstract class SimpleRenderedImage implements RenderedImage {
|
||||
* of getMinTileY() and getMaxTileY() and so does not need to be
|
||||
* implemented by subclasses.
|
||||
*/
|
||||
@Override
|
||||
public int getNumYTiles() {
|
||||
return getMaxTileY() - getMinTileY() + 1;
|
||||
}
|
||||
|
||||
/** Returns the SampleModel of the image. */
|
||||
@Override
|
||||
public SampleModel getSampleModel() {
|
||||
return sampleModel;
|
||||
}
|
||||
|
||||
/** Returns the ColorModel of the image. */
|
||||
@Override
|
||||
public ColorModel getColorModel() {
|
||||
return colorModel;
|
||||
}
|
||||
@ -218,6 +232,7 @@ public abstract class SimpleRenderedImage implements RenderedImage {
|
||||
* <code>Object</code>, or the value
|
||||
* <code>java.awt.Image.UndefinedProperty.</code>
|
||||
*/
|
||||
@Override
|
||||
public Object getProperty(String name) {
|
||||
name = name.toLowerCase();
|
||||
Object value = properties.get(name);
|
||||
@ -232,6 +247,7 @@ public abstract class SimpleRenderedImage implements RenderedImage {
|
||||
* @return an array of <code>String</code>s representing valid
|
||||
* property names.
|
||||
*/
|
||||
@Override
|
||||
public String[] getPropertyNames() {
|
||||
String[] names = null;
|
||||
|
||||
@ -379,6 +395,7 @@ public abstract class SimpleRenderedImage implements RenderedImage {
|
||||
return ty*tileHeight + tileGridYOffset;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Vector<RenderedImage> getSources() {
|
||||
return null;
|
||||
}
|
||||
@ -399,6 +416,7 @@ public abstract class SimpleRenderedImage implements RenderedImage {
|
||||
*
|
||||
* @return a Raster containing a copy of this image's data.
|
||||
*/
|
||||
@Override
|
||||
public Raster getData() {
|
||||
Rectangle rect = new Rectangle(getMinX(), getMinY(),
|
||||
getWidth(), getHeight());
|
||||
@ -422,6 +440,7 @@ public abstract class SimpleRenderedImage implements RenderedImage {
|
||||
*
|
||||
* @param bounds the region of the RenderedImage to be returned.
|
||||
*/
|
||||
@Override
|
||||
public Raster getData(Rectangle bounds) {
|
||||
// Get the image bounds.
|
||||
Rectangle imageBounds = getBounds();
|
||||
@ -511,6 +530,7 @@ public abstract class SimpleRenderedImage implements RenderedImage {
|
||||
* @return a reference to the supplied WritableRaster, or to a
|
||||
* new WritableRaster if the supplied one was null.
|
||||
*/
|
||||
@Override
|
||||
public WritableRaster copyData(WritableRaster dest) {
|
||||
// Get the image bounds.
|
||||
Rectangle imageBounds = getBounds();
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2025, 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
|
||||
@ -58,6 +58,7 @@ public class SingleTileRenderedImage extends SimpleRenderedImage {
|
||||
/**
|
||||
* Returns the image's Raster as tile (0, 0).
|
||||
*/
|
||||
@Override
|
||||
public Raster getTile(int tileX, int tileY) {
|
||||
if (tileX != 0 || tileY != 0) {
|
||||
throw new IllegalArgumentException("tileX != 0 || tileY != 0");
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2001, 2025, 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
|
||||
@ -492,6 +492,7 @@ public class StandardMetadataFormat extends IIOMetadataFormatImpl {
|
||||
null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canNodeAppear(String elementName,
|
||||
ImageTypeSpecifier imageType) {
|
||||
return true;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2001, 2025, 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
|
||||
@ -31,6 +31,7 @@ public class StandardMetadataFormatResources extends ListResourceBundle {
|
||||
|
||||
public StandardMetadataFormatResources() {}
|
||||
|
||||
@Override
|
||||
protected Object[][] getContents() {
|
||||
return new Object[][] {
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2025, 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
|
||||
@ -43,6 +43,7 @@ public final class SubImageInputStream extends ImageInputStreamImpl {
|
||||
this.startingLength = this.length = length;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int read() throws IOException {
|
||||
if (length == 0) { // Local EOF
|
||||
return -1;
|
||||
@ -52,6 +53,7 @@ public final class SubImageInputStream extends ImageInputStreamImpl {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int read(byte[] b, int off, int len) throws IOException {
|
||||
if (length == 0) { // Local EOF
|
||||
return -1;
|
||||
@ -63,10 +65,12 @@ public final class SubImageInputStream extends ImageInputStreamImpl {
|
||||
return bytes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long length() {
|
||||
return startingLength;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void seek(long pos) throws IOException {
|
||||
stream.seek(pos - startingPos);
|
||||
streamPos = pos;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2025, 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
|
||||
@ -115,10 +115,12 @@ public class GIFImageMetadata extends GIFMetadata {
|
||||
null, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isReadOnly() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Node getAsTree(String formatName) {
|
||||
if (formatName.equals(nativeMetadataFormatName)) {
|
||||
return getNativeTree();
|
||||
@ -252,6 +254,7 @@ public class GIFImageMetadata extends GIFMetadata {
|
||||
return root;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIOMetadataNode getStandardChromaNode() {
|
||||
IIOMetadataNode chroma_node = new IIOMetadataNode("Chroma");
|
||||
IIOMetadataNode node = null; // scratch node
|
||||
@ -294,6 +297,7 @@ public class GIFImageMetadata extends GIFMetadata {
|
||||
return chroma_node;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIOMetadataNode getStandardCompressionNode() {
|
||||
IIOMetadataNode compression_node = new IIOMetadataNode("Compression");
|
||||
IIOMetadataNode node = null; // scratch node
|
||||
@ -315,6 +319,7 @@ public class GIFImageMetadata extends GIFMetadata {
|
||||
return compression_node;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIOMetadataNode getStandardDataNode() {
|
||||
IIOMetadataNode data_node = new IIOMetadataNode("Data");
|
||||
IIOMetadataNode node = null; // scratch node
|
||||
@ -332,6 +337,7 @@ public class GIFImageMetadata extends GIFMetadata {
|
||||
return data_node;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIOMetadataNode getStandardDimensionNode() {
|
||||
IIOMetadataNode dimension_node = new IIOMetadataNode("Dimension");
|
||||
IIOMetadataNode node = null; // scratch node
|
||||
@ -365,6 +371,7 @@ public class GIFImageMetadata extends GIFMetadata {
|
||||
|
||||
// Document not in image
|
||||
|
||||
@Override
|
||||
public IIOMetadataNode getStandardTextNode() {
|
||||
if (comments == null) {
|
||||
return null;
|
||||
@ -391,6 +398,7 @@ public class GIFImageMetadata extends GIFMetadata {
|
||||
return text_node;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIOMetadataNode getStandardTransparencyNode() {
|
||||
if (!transparentColorFlag) {
|
||||
return null;
|
||||
@ -414,22 +422,26 @@ public class GIFImageMetadata extends GIFMetadata {
|
||||
return transparency_node;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFromTree(String formatName, Node root)
|
||||
throws IIOInvalidTreeException
|
||||
{
|
||||
throw new IllegalStateException("Metadata is read-only!");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void mergeNativeTree(Node root) throws IIOInvalidTreeException
|
||||
{
|
||||
throw new IllegalStateException("Metadata is read-only!");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void mergeStandardTree(Node root) throws IIOInvalidTreeException
|
||||
{
|
||||
throw new IllegalStateException("Metadata is read-only!");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset() {
|
||||
throw new IllegalStateException("Metadata is read-only!");
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2001, 2025, 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
|
||||
@ -157,6 +157,7 @@ public class GIFImageMetadataFormat extends IIOMetadataFormatImpl {
|
||||
DATATYPE_STRING, true, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canNodeAppear(String elementName,
|
||||
ImageTypeSpecifier imageType) {
|
||||
return true;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2005, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2001, 2025, 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
|
||||
@ -31,6 +31,7 @@ public class GIFImageMetadataFormatResources extends ListResourceBundle {
|
||||
|
||||
public GIFImageMetadataFormatResources() {}
|
||||
|
||||
@Override
|
||||
protected Object[][] getContents() {
|
||||
return new Object[][] {
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2025, 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
|
||||
@ -71,10 +71,12 @@ public class GIFImageReaderSpi extends ImageReaderSpi {
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription(Locale locale) {
|
||||
return "Standard GIF image reader";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canDecodeInput(Object input) throws IOException {
|
||||
if (!(input instanceof ImageInputStream)) {
|
||||
return false;
|
||||
@ -91,6 +93,7 @@ public class GIFImageReaderSpi extends ImageReaderSpi {
|
||||
(b[4] == '7' || b[4] == '9') && b[5] == 'a';
|
||||
}
|
||||
|
||||
@Override
|
||||
public ImageReader createReaderInstance(Object extension) {
|
||||
return new GIFImageReader(this);
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2025, 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
|
||||
@ -73,6 +73,7 @@ public class GIFImageWriterSpi extends ImageWriterSpi {
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canEncodeImage(ImageTypeSpecifier type) {
|
||||
if (type == null) {
|
||||
throw new IllegalArgumentException("type == null!");
|
||||
@ -94,10 +95,12 @@ public class GIFImageWriterSpi extends ImageWriterSpi {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription(Locale locale) {
|
||||
return "Standard GIF image writer";
|
||||
}
|
||||
|
||||
@Override
|
||||
public ImageWriter createWriterInstance(Object extension) {
|
||||
return new GIFImageWriter(this);
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2025, 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
|
||||
@ -242,6 +242,7 @@ abstract class GIFMetadata extends IIOMetadata {
|
||||
extraMetadataFormatClassNames);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mergeTree(String formatName, Node root)
|
||||
throws IIOInvalidTreeException {
|
||||
if (formatName.equals(nativeMetadataFormatName)) {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2025, 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
|
||||
@ -77,10 +77,12 @@ public class GIFStreamMetadata extends GIFMetadata {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isReadOnly() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Node getAsTree(String formatName) {
|
||||
if (formatName.equals(nativeMetadataFormatName)) {
|
||||
return getNativeTree();
|
||||
@ -149,6 +151,7 @@ public class GIFStreamMetadata extends GIFMetadata {
|
||||
return root;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIOMetadataNode getStandardChromaNode() {
|
||||
IIOMetadataNode chroma_node = new IIOMetadataNode("Chroma");
|
||||
IIOMetadataNode node = null; // scratch node
|
||||
@ -190,6 +193,7 @@ public class GIFStreamMetadata extends GIFMetadata {
|
||||
return chroma_node;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIOMetadataNode getStandardCompressionNode() {
|
||||
IIOMetadataNode compression_node = new IIOMetadataNode("Compression");
|
||||
IIOMetadataNode node = null; // scratch node
|
||||
@ -208,6 +212,7 @@ public class GIFStreamMetadata extends GIFMetadata {
|
||||
return compression_node;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIOMetadataNode getStandardDataNode() {
|
||||
IIOMetadataNode data_node = new IIOMetadataNode("Data");
|
||||
IIOMetadataNode node = null; // scratch node
|
||||
@ -230,6 +235,7 @@ public class GIFStreamMetadata extends GIFMetadata {
|
||||
return data_node;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIOMetadataNode getStandardDimensionNode() {
|
||||
IIOMetadataNode dimension_node = new IIOMetadataNode("Dimension");
|
||||
IIOMetadataNode node = null; // scratch node
|
||||
@ -270,6 +276,7 @@ public class GIFStreamMetadata extends GIFMetadata {
|
||||
return dimension_node;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIOMetadataNode getStandardDocumentNode() {
|
||||
IIOMetadataNode document_node = new IIOMetadataNode("Document");
|
||||
IIOMetadataNode node = null; // scratch node
|
||||
@ -285,32 +292,38 @@ public class GIFStreamMetadata extends GIFMetadata {
|
||||
return document_node;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIOMetadataNode getStandardTextNode() {
|
||||
// Not in stream
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIOMetadataNode getStandardTransparencyNode() {
|
||||
// Not in stream
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFromTree(String formatName, Node root)
|
||||
throws IIOInvalidTreeException
|
||||
{
|
||||
throw new IllegalStateException("Metadata is read-only!");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void mergeNativeTree(Node root) throws IIOInvalidTreeException
|
||||
{
|
||||
throw new IllegalStateException("Metadata is read-only!");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void mergeStandardTree(Node root) throws IIOInvalidTreeException
|
||||
{
|
||||
throw new IllegalStateException("Metadata is read-only!");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset() {
|
||||
throw new IllegalStateException("Metadata is read-only!");
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2004, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2001, 2025, 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
|
||||
@ -92,6 +92,7 @@ public class GIFStreamMetadataFormat extends IIOMetadataFormatImpl {
|
||||
"0", "255", true, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canNodeAppear(String elementName,
|
||||
ImageTypeSpecifier imageType) {
|
||||
return true;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2005, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2001, 2025, 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
|
||||
@ -31,6 +31,7 @@ public class GIFStreamMetadataFormatResources extends ListResourceBundle {
|
||||
|
||||
public GIFStreamMetadataFormatResources() {}
|
||||
|
||||
@Override
|
||||
protected Object[][] getContents() {
|
||||
return new Object[][] {
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2025, 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
|
||||
@ -49,10 +49,12 @@ class GIFWritableImageMetadata extends GIFImageMetadata {
|
||||
null, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isReadOnly() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset() {
|
||||
// Fields from Image Descriptor
|
||||
imageLeftPosition = 0;
|
||||
@ -96,6 +98,7 @@ class GIFWritableImageMetadata extends GIFImageMetadata {
|
||||
return data.getBytes(ISO_8859_1);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void mergeNativeTree(Node root) throws IIOInvalidTreeException {
|
||||
Node node = root;
|
||||
if (!node.getNodeName().equals(nativeMetadataFormatName)) {
|
||||
@ -292,6 +295,7 @@ class GIFWritableImageMetadata extends GIFImageMetadata {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void mergeStandardTree(Node root)
|
||||
throws IIOInvalidTreeException {
|
||||
Node node = root;
|
||||
@ -389,6 +393,7 @@ class GIFWritableImageMetadata extends GIFImageMetadata {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFromTree(String formatName, Node root)
|
||||
throws IIOInvalidTreeException
|
||||
{
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2025, 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
|
||||
@ -55,10 +55,12 @@ class GIFWritableStreamMetadata extends GIFStreamMetadata {
|
||||
reset();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isReadOnly() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mergeTree(String formatName, Node root)
|
||||
throws IIOInvalidTreeException {
|
||||
if (formatName.equals(nativeMetadataFormatName)) {
|
||||
@ -77,6 +79,7 @@ class GIFWritableStreamMetadata extends GIFStreamMetadata {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset() {
|
||||
version = null;
|
||||
|
||||
@ -90,6 +93,7 @@ class GIFWritableStreamMetadata extends GIFStreamMetadata {
|
||||
globalColorTable = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void mergeNativeTree(Node root) throws IIOInvalidTreeException {
|
||||
Node node = root;
|
||||
if (!node.getNodeName().equals(nativeMetadataFormatName)) {
|
||||
@ -164,6 +168,7 @@ class GIFWritableStreamMetadata extends GIFStreamMetadata {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void mergeStandardTree(Node root)
|
||||
throws IIOInvalidTreeException {
|
||||
Node node = root;
|
||||
@ -258,6 +263,7 @@ class GIFWritableStreamMetadata extends GIFStreamMetadata {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFromTree(String formatName, Node root)
|
||||
throws IIOInvalidTreeException
|
||||
{
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2001, 2025, 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
|
||||
@ -73,6 +73,7 @@ class AdobeMarkerSegment extends MarkerSegment {
|
||||
updateFromNativeNode(node, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
IIOMetadataNode getNativeNode() {
|
||||
IIOMetadataNode node = new IIOMetadataNode("app14Adobe");
|
||||
node.setAttribute("version", Integer.toString(version));
|
||||
@ -108,6 +109,7 @@ class AdobeMarkerSegment extends MarkerSegment {
|
||||
* Writes the data for this segment to the stream in
|
||||
* valid JPEG format.
|
||||
*/
|
||||
@Override
|
||||
void write(ImageOutputStream ios) throws IOException {
|
||||
length = 14;
|
||||
writeTag(ios);
|
||||
@ -124,6 +126,7 @@ class AdobeMarkerSegment extends MarkerSegment {
|
||||
(new AdobeMarkerSegment(transform)).write(ios);
|
||||
}
|
||||
|
||||
@Override
|
||||
void print () {
|
||||
printTag("Adobe APP14");
|
||||
System.out.print("Version: ");
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2001, 2025, 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
|
||||
@ -104,6 +104,7 @@ class COMMarkerSegment extends MarkerSegment {
|
||||
* as a user object and a string encoded using ISO-8895-1, as an
|
||||
* attribute.
|
||||
*/
|
||||
@Override
|
||||
IIOMetadataNode getNativeNode() {
|
||||
IIOMetadataNode node = new IIOMetadataNode("com");
|
||||
node.setAttribute("comment", getComment());
|
||||
@ -117,12 +118,14 @@ class COMMarkerSegment extends MarkerSegment {
|
||||
* Writes the data for this segment to the stream in
|
||||
* valid JPEG format, directly from the data array.
|
||||
*/
|
||||
@Override
|
||||
void write(ImageOutputStream ios) throws IOException {
|
||||
length = 2 + data.length;
|
||||
writeTag(ios);
|
||||
ios.write(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
void print() {
|
||||
printTag("COM");
|
||||
System.out.println("<" + getComment() + ">");
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2001, 2025, 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
|
||||
@ -90,6 +90,7 @@ class DHTMarkerSegment extends MarkerSegment {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Object clone() {
|
||||
DHTMarkerSegment newGuy = (DHTMarkerSegment) super.clone();
|
||||
newGuy.tables = new ArrayList<>(tables.size());
|
||||
@ -99,6 +100,7 @@ class DHTMarkerSegment extends MarkerSegment {
|
||||
return newGuy;
|
||||
}
|
||||
|
||||
@Override
|
||||
IIOMetadataNode getNativeNode() {
|
||||
IIOMetadataNode node = new IIOMetadataNode("dht");
|
||||
for (int i= 0; i<tables.size(); i++) {
|
||||
@ -112,10 +114,12 @@ class DHTMarkerSegment extends MarkerSegment {
|
||||
* Writes the data for this segment to the stream in
|
||||
* valid JPEG format.
|
||||
*/
|
||||
@Override
|
||||
void write(ImageOutputStream ios) throws IOException {
|
||||
// We don't write DHT segments; the IJG library does.
|
||||
}
|
||||
|
||||
@Override
|
||||
void print() {
|
||||
printTag("DHT");
|
||||
System.out.println("Num tables: " + tables.size());
|
||||
@ -201,6 +205,7 @@ class DHTMarkerSegment extends MarkerSegment {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Object clone() {
|
||||
Htable newGuy = null;
|
||||
try {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2001, 2025, 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
|
||||
@ -83,6 +83,7 @@ class DQTMarkerSegment extends MarkerSegment {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Object clone() {
|
||||
DQTMarkerSegment newGuy = (DQTMarkerSegment) super.clone();
|
||||
newGuy.tables = new ArrayList<>(tables.size());
|
||||
@ -92,6 +93,7 @@ class DQTMarkerSegment extends MarkerSegment {
|
||||
return newGuy;
|
||||
}
|
||||
|
||||
@Override
|
||||
IIOMetadataNode getNativeNode() {
|
||||
IIOMetadataNode node = new IIOMetadataNode("dqt");
|
||||
for (int i= 0; i<tables.size(); i++) {
|
||||
@ -105,10 +107,12 @@ class DQTMarkerSegment extends MarkerSegment {
|
||||
* Writes the data for this segment to the stream in
|
||||
* valid JPEG format.
|
||||
*/
|
||||
@Override
|
||||
void write(ImageOutputStream ios) throws IOException {
|
||||
// We don't write DQT segments; the IJG library does.
|
||||
}
|
||||
|
||||
@Override
|
||||
void print() {
|
||||
printTag("DQT");
|
||||
System.out.println("Num tables: " + tables.size());
|
||||
@ -264,6 +268,7 @@ class DQTMarkerSegment extends MarkerSegment {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Object clone() {
|
||||
Qtable newGuy = null;
|
||||
try {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2001, 2025, 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
|
||||
@ -55,6 +55,7 @@ class DRIMarkerSegment extends MarkerSegment {
|
||||
updateFromNativeNode(node, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
IIOMetadataNode getNativeNode() {
|
||||
IIOMetadataNode node = new IIOMetadataNode("dri");
|
||||
node.setAttribute("interval", Integer.toString(restartInterval));
|
||||
@ -71,10 +72,12 @@ class DRIMarkerSegment extends MarkerSegment {
|
||||
* Writes the data for this segment to the stream in
|
||||
* valid JPEG format.
|
||||
*/
|
||||
@Override
|
||||
void write(ImageOutputStream ios) throws IOException {
|
||||
// We don't write DRI segments; the IJG library does.
|
||||
}
|
||||
|
||||
@Override
|
||||
void print() {
|
||||
printTag("DRI");
|
||||
System.out.println("Interval: " + restartInterval);
|
||||
|
||||
@ -154,6 +154,7 @@ class JFIFMarkerSegment extends MarkerSegment {
|
||||
/**
|
||||
* Returns a deep-copy clone of this object.
|
||||
*/
|
||||
@Override
|
||||
protected Object clone() {
|
||||
JFIFMarkerSegment newGuy = (JFIFMarkerSegment) super.clone();
|
||||
if (!extSegments.isEmpty()) { // Clone the list with a deep copy
|
||||
@ -216,6 +217,7 @@ class JFIFMarkerSegment extends MarkerSegment {
|
||||
* Returns a tree of DOM nodes representing this object and any
|
||||
* subordinate JFXX extension or ICC Profile segments.
|
||||
*/
|
||||
@Override
|
||||
IIOMetadataNode getNativeNode() {
|
||||
IIOMetadataNode node = new IIOMetadataNode("app0JFIF");
|
||||
node.setAttribute("majorVersion", Integer.toString(majorVersion));
|
||||
@ -622,6 +624,7 @@ class JFIFMarkerSegment extends MarkerSegment {
|
||||
/**
|
||||
* Prints out the contents of this object to System.out for debugging.
|
||||
*/
|
||||
@Override
|
||||
void print() {
|
||||
printTag("JFIF");
|
||||
System.out.print("Version ");
|
||||
@ -767,6 +770,7 @@ class JFIFMarkerSegment extends MarkerSegment {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Object clone() {
|
||||
JFIFExtensionMarkerSegment newGuy =
|
||||
(JFIFExtensionMarkerSegment) super.clone();
|
||||
@ -776,6 +780,7 @@ class JFIFMarkerSegment extends MarkerSegment {
|
||||
return newGuy;
|
||||
}
|
||||
|
||||
@Override
|
||||
IIOMetadataNode getNativeNode() {
|
||||
IIOMetadataNode node = new IIOMetadataNode("app0JFXX");
|
||||
node.setAttribute("extensionCode", Integer.toString(code));
|
||||
@ -793,6 +798,7 @@ class JFIFMarkerSegment extends MarkerSegment {
|
||||
thumb.write(ios, writer);
|
||||
}
|
||||
|
||||
@Override
|
||||
void print() {
|
||||
printTag("JFXX");
|
||||
thumb.print();
|
||||
@ -826,6 +832,7 @@ class JFIFMarkerSegment extends MarkerSegment {
|
||||
abstract void write(ImageOutputStream ios,
|
||||
JPEGImageWriter writer) throws IOException;
|
||||
|
||||
@Override
|
||||
protected Object clone() {
|
||||
try {
|
||||
return super.clone();
|
||||
@ -907,14 +914,17 @@ class JFIFMarkerSegment extends MarkerSegment {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
int getWidth() {
|
||||
return thumbWidth;
|
||||
}
|
||||
|
||||
@Override
|
||||
int getHeight() {
|
||||
return thumbHeight;
|
||||
}
|
||||
|
||||
@Override
|
||||
IIOMetadataNode getNativeNode() {
|
||||
IIOMetadataNode node = new IIOMetadataNode(name);
|
||||
node.setAttribute("thumbWidth", Integer.toString(thumbWidth));
|
||||
@ -922,6 +932,7 @@ class JFIFMarkerSegment extends MarkerSegment {
|
||||
return node;
|
||||
}
|
||||
|
||||
@Override
|
||||
void write(ImageOutputStream ios,
|
||||
JPEGImageWriter writer) throws IOException {
|
||||
if ((thumbWidth > MAX_THUMB_WIDTH)
|
||||
@ -949,6 +960,7 @@ class JFIFMarkerSegment extends MarkerSegment {
|
||||
writeThumbnailData(ios, data, writer);
|
||||
}
|
||||
|
||||
@Override
|
||||
void print() {
|
||||
System.out.print(name + " width: ");
|
||||
System.out.println(thumbWidth);
|
||||
@ -978,10 +990,12 @@ class JFIFMarkerSegment extends MarkerSegment {
|
||||
super(thumb);
|
||||
}
|
||||
|
||||
@Override
|
||||
int getLength() {
|
||||
return (thumbWidth*thumbHeight*3);
|
||||
}
|
||||
|
||||
@Override
|
||||
BufferedImage getThumbnail(ImageInputStream iis,
|
||||
JPEGImageReader reader)
|
||||
throws IOException {
|
||||
@ -1014,6 +1028,7 @@ class JFIFMarkerSegment extends MarkerSegment {
|
||||
null);
|
||||
}
|
||||
|
||||
@Override
|
||||
void write(ImageOutputStream ios,
|
||||
JPEGImageWriter writer) throws IOException {
|
||||
super.write(ios, writer); // width and height
|
||||
@ -1050,10 +1065,12 @@ class JFIFMarkerSegment extends MarkerSegment {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
int getLength() {
|
||||
return (thumbWidth*thumbHeight + PALETTE_SIZE);
|
||||
}
|
||||
|
||||
@Override
|
||||
BufferedImage getThumbnail(ImageInputStream iis,
|
||||
JPEGImageReader reader)
|
||||
throws IOException {
|
||||
@ -1091,6 +1108,7 @@ class JFIFMarkerSegment extends MarkerSegment {
|
||||
null);
|
||||
}
|
||||
|
||||
@Override
|
||||
void write(ImageOutputStream ios,
|
||||
JPEGImageWriter writer) throws IOException {
|
||||
super.write(ios, writer); // width and height
|
||||
@ -1221,6 +1239,7 @@ class JFIFMarkerSegment extends MarkerSegment {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
int getWidth() {
|
||||
int retval = 0;
|
||||
SOFMarkerSegment sof =
|
||||
@ -1232,6 +1251,7 @@ class JFIFMarkerSegment extends MarkerSegment {
|
||||
return retval;
|
||||
}
|
||||
|
||||
@Override
|
||||
int getHeight() {
|
||||
int retval = 0;
|
||||
SOFMarkerSegment sof =
|
||||
@ -1249,21 +1269,31 @@ class JFIFMarkerSegment extends MarkerSegment {
|
||||
ThumbnailReadListener (JPEGImageReader reader) {
|
||||
this.reader = reader;
|
||||
}
|
||||
@Override
|
||||
public void sequenceStarted(ImageReader source, int minIndex) {}
|
||||
@Override
|
||||
public void sequenceComplete(ImageReader source) {}
|
||||
@Override
|
||||
public void imageStarted(ImageReader source, int imageIndex) {}
|
||||
@Override
|
||||
public void imageProgress(ImageReader source,
|
||||
float percentageDone) {
|
||||
reader.thumbnailProgress(percentageDone);
|
||||
}
|
||||
@Override
|
||||
public void imageComplete(ImageReader source) {}
|
||||
@Override
|
||||
public void thumbnailStarted(ImageReader source,
|
||||
int imageIndex, int thumbnailIndex) {}
|
||||
@Override
|
||||
public void thumbnailProgress(ImageReader source, float percentageDone) {}
|
||||
@Override
|
||||
public void thumbnailComplete(ImageReader source) {}
|
||||
@Override
|
||||
public void readAborted(ImageReader source) {}
|
||||
}
|
||||
|
||||
@Override
|
||||
BufferedImage getThumbnail(ImageInputStream iis,
|
||||
JPEGImageReader reader)
|
||||
throws IOException {
|
||||
@ -1279,6 +1309,7 @@ class JFIFMarkerSegment extends MarkerSegment {
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Object clone() {
|
||||
JFIFThumbJPEG newGuy = (JFIFThumbJPEG) super.clone();
|
||||
if (thumbMetadata != null) {
|
||||
@ -1287,6 +1318,7 @@ class JFIFMarkerSegment extends MarkerSegment {
|
||||
return newGuy;
|
||||
}
|
||||
|
||||
@Override
|
||||
IIOMetadataNode getNativeNode() {
|
||||
IIOMetadataNode node = new IIOMetadataNode("JFIFthumbJPEG");
|
||||
if (thumbMetadata != null) {
|
||||
@ -1295,6 +1327,7 @@ class JFIFMarkerSegment extends MarkerSegment {
|
||||
return node;
|
||||
}
|
||||
|
||||
@Override
|
||||
int getLength() {
|
||||
if (data == null) {
|
||||
return 0;
|
||||
@ -1303,6 +1336,7 @@ class JFIFMarkerSegment extends MarkerSegment {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
void write(ImageOutputStream ios,
|
||||
JPEGImageWriter writer) throws IOException {
|
||||
int progInterval = data.length / 20; // approx. every 5%
|
||||
@ -1322,6 +1356,7 @@ class JFIFMarkerSegment extends MarkerSegment {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
void print () {
|
||||
System.out.println("JFIF thumbnail stored as JPEG");
|
||||
}
|
||||
@ -1445,6 +1480,7 @@ class JFIFMarkerSegment extends MarkerSegment {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Object clone () {
|
||||
ICCMarkerSegment newGuy = (ICCMarkerSegment) super.clone();
|
||||
if (profile != null) {
|
||||
@ -1541,6 +1577,7 @@ class JFIFMarkerSegment extends MarkerSegment {
|
||||
return retval;
|
||||
}
|
||||
|
||||
@Override
|
||||
IIOMetadataNode getNativeNode() {
|
||||
IIOMetadataNode node = new IIOMetadataNode("app2ICC");
|
||||
if (profile != null) {
|
||||
@ -1553,10 +1590,12 @@ class JFIFMarkerSegment extends MarkerSegment {
|
||||
* No-op. Profiles are never written from metadata.
|
||||
* They are written from the ColorSpace of the image.
|
||||
*/
|
||||
@Override
|
||||
void write(ImageOutputStream ios) throws IOException {
|
||||
// No-op
|
||||
}
|
||||
|
||||
@Override
|
||||
void print () {
|
||||
printTag("ICC Profile APP2");
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2001, 2025, 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
|
||||
@ -337,6 +337,7 @@ public class JPEGImageMetadataFormat extends JPEGMetadataFormat {
|
||||
tabids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canNodeAppear(String elementName,
|
||||
ImageTypeSpecifier imageType) {
|
||||
// All images can have these
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2005, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2001, 2025, 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
|
||||
@ -122,6 +122,7 @@ public class JPEGImageMetadataFormatResources
|
||||
|
||||
public JPEGImageMetadataFormatResources() {}
|
||||
|
||||
@Override
|
||||
protected Object[][] getContents() {
|
||||
// return a copy of the combined commonContents and imageContents;
|
||||
// in theory we want a deep clone of the combined arrays,
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2005, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2001, 2025, 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
|
||||
@ -31,6 +31,7 @@ public class JPEGImageReaderResources extends ListResourceBundle {
|
||||
|
||||
public JPEGImageReaderResources() {}
|
||||
|
||||
@Override
|
||||
protected Object[][] getContents() {
|
||||
return new Object[][] {
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2025, 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
|
||||
@ -59,10 +59,12 @@ public class JPEGImageReaderSpi extends ImageReaderSpi {
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription(Locale locale) {
|
||||
return "Standard JPEG Image Reader";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canDecodeInput(Object source) throws IOException {
|
||||
if (!(source instanceof ImageInputStream)) {
|
||||
return false;
|
||||
@ -80,6 +82,7 @@ public class JPEGImageReaderSpi extends ImageReaderSpi {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ImageReader createReaderInstance(Object extension)
|
||||
throws IIOException {
|
||||
return new JPEGImageReader(this);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2005, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2001, 2025, 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
|
||||
@ -31,6 +31,7 @@ public class JPEGImageWriterResources extends ListResourceBundle {
|
||||
|
||||
public JPEGImageWriterResources() {}
|
||||
|
||||
@Override
|
||||
protected Object[][] getContents() {
|
||||
return new Object[][] {
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2025, 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
|
||||
@ -63,14 +63,17 @@ public class JPEGImageWriterSpi extends ImageWriterSpi {
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription(Locale locale) {
|
||||
return "Standard JPEG Image Writer";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFormatLossless() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canEncodeImage(ImageTypeSpecifier type) {
|
||||
SampleModel sampleModel = type.getSampleModel();
|
||||
ColorModel cm = type.getColorModel();
|
||||
@ -95,6 +98,7 @@ public class JPEGImageWriterSpi extends ImageWriterSpi {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ImageWriter createWriterInstance(Object extension)
|
||||
throws IIOException {
|
||||
return new JPEGImageWriter(this);
|
||||
|
||||
@ -725,6 +725,7 @@ public class JPEGMetadata extends IIOMetadata implements Cloneable {
|
||||
|
||||
// Implement Cloneable, but restrict access
|
||||
|
||||
@Override
|
||||
protected Object clone() {
|
||||
JPEGMetadata newGuy = null;
|
||||
try {
|
||||
@ -755,6 +756,7 @@ public class JPEGMetadata extends IIOMetadata implements Cloneable {
|
||||
|
||||
// Tree methods
|
||||
|
||||
@Override
|
||||
public Node getAsTree(String formatName) {
|
||||
if (formatName == null) {
|
||||
throw new IllegalArgumentException("null formatName!");
|
||||
@ -810,6 +812,7 @@ public class JPEGMetadata extends IIOMetadata implements Cloneable {
|
||||
|
||||
// Standard tree node methods
|
||||
|
||||
@Override
|
||||
protected IIOMetadataNode getStandardChromaNode() {
|
||||
hasAlpha = false; // Unless we find otherwise
|
||||
|
||||
@ -950,6 +953,7 @@ public class JPEGMetadata extends IIOMetadata implements Cloneable {
|
||||
return chroma;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected IIOMetadataNode getStandardCompressionNode() {
|
||||
|
||||
IIOMetadataNode compression = new IIOMetadataNode("Compression");
|
||||
@ -980,6 +984,7 @@ public class JPEGMetadata extends IIOMetadata implements Cloneable {
|
||||
return compression;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected IIOMetadataNode getStandardDimensionNode() {
|
||||
// If we have a JFIF marker segment, we know a little
|
||||
// otherwise all we know is the orientation, which is always normal
|
||||
@ -1055,6 +1060,7 @@ public class JPEGMetadata extends IIOMetadata implements Cloneable {
|
||||
return doc;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected IIOMetadataNode getStandardTextNode() {
|
||||
IIOMetadataNode text = null;
|
||||
// Add a text entry for each COM Marker Segment
|
||||
@ -1073,6 +1079,7 @@ public class JPEGMetadata extends IIOMetadata implements Cloneable {
|
||||
return text;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected IIOMetadataNode getStandardTransparencyNode() {
|
||||
IIOMetadataNode trans = null;
|
||||
if (hasAlpha == true) {
|
||||
@ -1086,10 +1093,12 @@ public class JPEGMetadata extends IIOMetadata implements Cloneable {
|
||||
|
||||
// Editing
|
||||
|
||||
@Override
|
||||
public boolean isReadOnly() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mergeTree(String formatName, Node root)
|
||||
throws IIOInvalidTreeException {
|
||||
if (formatName == null) {
|
||||
@ -2160,6 +2169,7 @@ public class JPEGMetadata extends IIOMetadata implements Cloneable {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setFromTree(String formatName, Node root)
|
||||
throws IIOInvalidTreeException {
|
||||
if (formatName == null) {
|
||||
@ -2404,6 +2414,7 @@ public class JPEGMetadata extends IIOMetadata implements Cloneable {
|
||||
|
||||
//// End of writer support
|
||||
|
||||
@Override
|
||||
public void reset() {
|
||||
if (resetSequence != null) { // Otherwise no need to reset
|
||||
markerSequence = resetSequence;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2001, 2025, 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
|
||||
@ -123,6 +123,7 @@ abstract class JPEGMetadataFormat extends IIOMetadataFormatImpl {
|
||||
addObjectValue("unknown", byte[].class, 1, MAX_JPEG_DATA_SIZE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canNodeAppear(String elementName,
|
||||
ImageTypeSpecifier imageType) {
|
||||
// Just check if it appears in the format
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2005, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2001, 2025, 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
|
||||
@ -32,6 +32,7 @@ public class JPEGStreamMetadataFormatResources
|
||||
|
||||
public JPEGStreamMetadataFormatResources() {}
|
||||
|
||||
@Override
|
||||
protected Object[][] getContents() {
|
||||
// return a copy of commonContents; in theory we want a deep clone
|
||||
// of commonContents, but since it only contains (immutable) Strings,
|
||||
|
||||
@ -110,6 +110,7 @@ class MarkerSegment implements Cloneable {
|
||||
/**
|
||||
* Deep copy of data array.
|
||||
*/
|
||||
@Override
|
||||
protected Object clone() {
|
||||
MarkerSegment newGuy = null;
|
||||
try {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2001, 2025, 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
|
||||
@ -95,6 +95,7 @@ class SOFMarkerSegment extends MarkerSegment {
|
||||
updateFromNativeNode(node, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Object clone() {
|
||||
SOFMarkerSegment newGuy = (SOFMarkerSegment) super.clone();
|
||||
if (componentSpecs != null) {
|
||||
@ -107,6 +108,7 @@ class SOFMarkerSegment extends MarkerSegment {
|
||||
return newGuy;
|
||||
}
|
||||
|
||||
@Override
|
||||
IIOMetadataNode getNativeNode() {
|
||||
IIOMetadataNode node = new IIOMetadataNode("sof");
|
||||
node.setAttribute("process", Integer.toString(tag-JPEG.SOF0));
|
||||
@ -154,10 +156,12 @@ class SOFMarkerSegment extends MarkerSegment {
|
||||
* Writes the data for this segment to the stream in
|
||||
* valid JPEG format.
|
||||
*/
|
||||
@Override
|
||||
void write(ImageOutputStream ios) throws IOException {
|
||||
// We don't write SOF segments; the IJG library does.
|
||||
}
|
||||
|
||||
@Override
|
||||
void print () {
|
||||
printTag("SOF");
|
||||
System.out.print("Sample precision: ");
|
||||
@ -231,6 +235,7 @@ class SOFMarkerSegment extends MarkerSegment {
|
||||
0, 3, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Object clone() {
|
||||
try {
|
||||
return super.clone();
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2001, 2025, 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
|
||||
@ -89,6 +89,7 @@ class SOSMarkerSegment extends MarkerSegment {
|
||||
updateFromNativeNode(node, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Object clone () {
|
||||
SOSMarkerSegment newGuy = (SOSMarkerSegment) super.clone();
|
||||
if (componentSpecs != null) {
|
||||
@ -101,6 +102,7 @@ class SOSMarkerSegment extends MarkerSegment {
|
||||
return newGuy;
|
||||
}
|
||||
|
||||
@Override
|
||||
IIOMetadataNode getNativeNode() {
|
||||
IIOMetadataNode node = new IIOMetadataNode("sos");
|
||||
node.setAttribute("numScanComponents",
|
||||
@ -152,10 +154,12 @@ class SOSMarkerSegment extends MarkerSegment {
|
||||
* Writes the data for this segment to the stream in
|
||||
* valid JPEG format.
|
||||
*/
|
||||
@Override
|
||||
void write(ImageOutputStream ios) throws IOException {
|
||||
// We don't write SOS segments; the IJG library does.
|
||||
}
|
||||
|
||||
@Override
|
||||
void print () {
|
||||
printTag("SOS");
|
||||
System.out.print("Start spectral selection: ");
|
||||
@ -208,6 +212,7 @@ class SOSMarkerSegment extends MarkerSegment {
|
||||
0, 3, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Object clone() {
|
||||
try {
|
||||
return super.clone();
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2025, 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
|
||||
@ -70,10 +70,12 @@ public class PNGImageReaderSpi extends ImageReaderSpi {
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription(Locale locale) {
|
||||
return "Standard PNG image reader";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canDecodeInput(Object input) throws IOException {
|
||||
if (!(input instanceof ImageInputStream)) {
|
||||
return false;
|
||||
@ -96,6 +98,7 @@ public class PNGImageReaderSpi extends ImageReaderSpi {
|
||||
b[7] == (byte)10);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ImageReader createReaderInstance(Object extension) {
|
||||
return new PNGImageReader(this);
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2025, 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
|
||||
@ -74,6 +74,7 @@ public class PNGImageWriterSpi extends ImageWriterSpi {
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canEncodeImage(ImageTypeSpecifier type) {
|
||||
SampleModel sampleModel = type.getSampleModel();
|
||||
ColorModel colorModel = type.getColorModel();
|
||||
@ -116,10 +117,12 @@ public class PNGImageWriterSpi extends ImageWriterSpi {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription(Locale locale) {
|
||||
return "Standard PNG image writer";
|
||||
}
|
||||
|
||||
@Override
|
||||
public ImageWriter createWriterInstance(Object extension) {
|
||||
return new PNGImageWriter(this);
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2025, 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
|
||||
@ -463,6 +463,7 @@ public class PNGMetadata extends IIOMetadata implements Cloneable {
|
||||
IHDR_present = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isReadOnly() {
|
||||
return false;
|
||||
}
|
||||
@ -480,6 +481,7 @@ public class PNGMetadata extends IIOMetadata implements Cloneable {
|
||||
}
|
||||
|
||||
// Deep clone
|
||||
@Override
|
||||
public Object clone() {
|
||||
PNGMetadata metadata;
|
||||
try {
|
||||
@ -495,6 +497,7 @@ public class PNGMetadata extends IIOMetadata implements Cloneable {
|
||||
return metadata;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Node getAsTree(String formatName) {
|
||||
if (formatName.equals(nativeMetadataFormatName)) {
|
||||
return getNativeTree();
|
||||
@ -847,6 +850,7 @@ public class PNGMetadata extends IIOMetadata implements Cloneable {
|
||||
return numChannels;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIOMetadataNode getStandardChromaNode() {
|
||||
IIOMetadataNode chroma_node = new IIOMetadataNode("Chroma");
|
||||
IIOMetadataNode node = null; // scratch node
|
||||
@ -919,6 +923,7 @@ public class PNGMetadata extends IIOMetadata implements Cloneable {
|
||||
return chroma_node;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIOMetadataNode getStandardCompressionNode() {
|
||||
IIOMetadataNode compression_node = new IIOMetadataNode("Compression");
|
||||
IIOMetadataNode node = null; // scratch node
|
||||
@ -952,6 +957,7 @@ public class PNGMetadata extends IIOMetadata implements Cloneable {
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIOMetadataNode getStandardDataNode() {
|
||||
IIOMetadataNode data_node = new IIOMetadataNode("Data");
|
||||
IIOMetadataNode node = null; // scratch node
|
||||
@ -998,6 +1004,7 @@ public class PNGMetadata extends IIOMetadata implements Cloneable {
|
||||
return data_node;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIOMetadataNode getStandardDimensionNode() {
|
||||
IIOMetadataNode dimension_node = new IIOMetadataNode("Dimension");
|
||||
IIOMetadataNode node = null; // scratch node
|
||||
@ -1027,6 +1034,7 @@ public class PNGMetadata extends IIOMetadata implements Cloneable {
|
||||
return dimension_node;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIOMetadataNode getStandardDocumentNode() {
|
||||
IIOMetadataNode document_node = null;
|
||||
|
||||
@ -1067,6 +1075,7 @@ public class PNGMetadata extends IIOMetadata implements Cloneable {
|
||||
return document_node;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIOMetadataNode getStandardTextNode() {
|
||||
int numEntries = tEXt_keyword.size() +
|
||||
iTXt_keyword.size() + zTXt_keyword.size();
|
||||
@ -1114,6 +1123,7 @@ public class PNGMetadata extends IIOMetadata implements Cloneable {
|
||||
return text_node;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIOMetadataNode getStandardTransparencyNode() {
|
||||
IIOMetadataNode transparency_node =
|
||||
new IIOMetadataNode("Transparency");
|
||||
@ -1285,6 +1295,7 @@ public class PNGMetadata extends IIOMetadata implements Cloneable {
|
||||
return getAttribute(node, name, null, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mergeTree(String formatName, Node root)
|
||||
throws IIOInvalidTreeException {
|
||||
if (formatName.equals(nativeMetadataFormatName)) {
|
||||
@ -2267,6 +2278,7 @@ public class PNGMetadata extends IIOMetadata implements Cloneable {
|
||||
}
|
||||
|
||||
// Reset all instance variables to their initial state
|
||||
@Override
|
||||
public void reset() {
|
||||
IHDR_present = false;
|
||||
PLTE_present = false;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2004, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2001, 2025, 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
|
||||
@ -486,6 +486,7 @@ public class PNGMetadataFormat extends IIOMetadataFormatImpl {
|
||||
addObjectValue("UnknownChunk", byte.class, 0, Integer.MAX_VALUE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canNodeAppear(String elementName,
|
||||
ImageTypeSpecifier imageType) {
|
||||
return true;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2005, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2001, 2025, 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
|
||||
@ -31,6 +31,7 @@ public class PNGMetadataFormatResources extends ListResourceBundle {
|
||||
|
||||
public PNGMetadataFormatResources() {}
|
||||
|
||||
@Override
|
||||
protected Object[][] getContents() {
|
||||
return new Object[][] {
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2025, 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
|
||||
@ -335,6 +335,7 @@ public abstract class TIFFBaseJPEGCompressor extends TIFFCompressor {
|
||||
return JPEGImageMetadata;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final int encode(byte[] b, int off,
|
||||
int width, int height,
|
||||
int[] bitsPerSample,
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2025, 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
|
||||
@ -56,6 +56,7 @@ public class TIFFCIELabColorConverter extends TIFFColorConverter {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fromRGB(float r, float g, float b, float[] result) {
|
||||
float X = 0.412453f*r + 0.357580f*g + 0.180423f*b;
|
||||
float Y = 0.212671f*r + 0.715160f*g + 0.072169f*b;
|
||||
@ -100,6 +101,7 @@ public class TIFFCIELabColorConverter extends TIFFColorConverter {
|
||||
result[2] = clamp2(bStar);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toRGB(float x0, float x1, float x2, float[] rgb) {
|
||||
float LStar = x0*100.0f/255.0f;
|
||||
float aStar = (x1 > 128.0f) ? (x1 - 256.0f) : x1;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2025, 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
|
||||
@ -48,6 +48,7 @@ public class TIFFDeflateDecompressor extends TIFFDecompressor {
|
||||
this.predictor = predictor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void decodeRaw(byte[] b,
|
||||
int dstOffset,
|
||||
int bitsPerPixel,
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2025, 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
|
||||
@ -58,6 +58,7 @@ public class TIFFDeflater extends TIFFCompressor {
|
||||
this.deflater = new Deflater(deflateLevel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int encode(byte[] b, int off,
|
||||
int width, int height,
|
||||
int[] bitsPerSample,
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2025, 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
|
||||
@ -39,6 +39,7 @@ public class TIFFExifJPEGCompressor extends TIFFBaseJPEGCompressor {
|
||||
param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMetadata(IIOMetadata metadata) {
|
||||
// Set the metadata.
|
||||
super.setMetadata(metadata);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2025, 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
|
||||
@ -242,6 +242,7 @@ abstract class TIFFFaxCompressor extends TIFFCompressor {
|
||||
*
|
||||
* @see #getMetadata()
|
||||
*/
|
||||
@Override
|
||||
public void setMetadata(IIOMetadata metadata) {
|
||||
super.setMetadata(metadata);
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2025, 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
|
||||
@ -591,6 +591,7 @@ class TIFFFaxDecompressor extends TIFFDecompressor {
|
||||
* Invokes the superclass method and then sets instance variables on
|
||||
* the basis of the metadata set on this decompressor.
|
||||
*/
|
||||
@Override
|
||||
public void beginDecoding() {
|
||||
super.beginDecoding();
|
||||
|
||||
@ -627,6 +628,7 @@ class TIFFFaxDecompressor extends TIFFDecompressor {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void decodeRaw(byte[] b, int dstOffset,
|
||||
int pixelBitStride, // will always be 1
|
||||
int scanlineStride) throws IOException {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2025, 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
|
||||
@ -162,6 +162,7 @@ public class TIFFFieldNode extends IIOMetadataNode {
|
||||
|
||||
// Need to override this method to avoid a stack overflow exception
|
||||
// which will occur if super.appendChild is called from initialize().
|
||||
@Override
|
||||
public Node appendChild(Node newChild) {
|
||||
if (newChild == null) {
|
||||
throw new NullPointerException("newChild == null!");
|
||||
@ -172,53 +173,63 @@ public class TIFFFieldNode extends IIOMetadataNode {
|
||||
|
||||
// Override all methods which refer to child nodes.
|
||||
|
||||
@Override
|
||||
public boolean hasChildNodes() {
|
||||
initialize();
|
||||
return super.hasChildNodes();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLength() {
|
||||
initialize();
|
||||
return super.getLength();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Node getFirstChild() {
|
||||
initialize();
|
||||
return super.getFirstChild();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Node getLastChild() {
|
||||
initialize();
|
||||
return super.getLastChild();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Node getPreviousSibling() {
|
||||
initialize();
|
||||
return super.getPreviousSibling();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Node getNextSibling() {
|
||||
initialize();
|
||||
return super.getNextSibling();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Node insertBefore(Node newChild,
|
||||
Node refChild) {
|
||||
initialize();
|
||||
return super.insertBefore(newChild, refChild);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Node replaceChild(Node newChild,
|
||||
Node oldChild) {
|
||||
initialize();
|
||||
return super.replaceChild(newChild, oldChild);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Node removeChild(Node oldChild) {
|
||||
initialize();
|
||||
return super.removeChild(oldChild);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Node cloneNode(boolean deep) {
|
||||
initialize();
|
||||
return super.cloneNode(deep);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2025, 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
|
||||
@ -93,6 +93,7 @@ public class TIFFImageMetadata extends IIOMetadata {
|
||||
rootIFD.addTIFFField(field);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isReadOnly() {
|
||||
return false;
|
||||
}
|
||||
@ -149,6 +150,7 @@ public class TIFFImageMetadata extends IIOMetadata {
|
||||
return IFDRoot;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Node getAsTree(String formatName) {
|
||||
if (formatName.equals(nativeMetadataFormatName)) {
|
||||
return getNativeTree();
|
||||
@ -181,6 +183,7 @@ public class TIFFImageMetadata extends IIOMetadata {
|
||||
"Lab", // ICCLab
|
||||
};
|
||||
|
||||
@Override
|
||||
public IIOMetadataNode getStandardChromaNode() {
|
||||
IIOMetadataNode chroma_node = new IIOMetadataNode("Chroma");
|
||||
IIOMetadataNode node = null; // scratch node
|
||||
@ -278,6 +281,7 @@ public class TIFFImageMetadata extends IIOMetadata {
|
||||
return chroma_node;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIOMetadataNode getStandardCompressionNode() {
|
||||
IIOMetadataNode compression_node = new IIOMetadataNode("Compression");
|
||||
IIOMetadataNode node = null; // scratch node
|
||||
@ -336,6 +340,7 @@ public class TIFFImageMetadata extends IIOMetadata {
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIOMetadataNode getStandardDataNode() {
|
||||
IIOMetadataNode data_node = new IIOMetadataNode("Data");
|
||||
IIOMetadataNode node = null; // scratch node
|
||||
@ -476,6 +481,7 @@ public class TIFFImageMetadata extends IIOMetadata {
|
||||
"Rotate90",
|
||||
};
|
||||
|
||||
@Override
|
||||
public IIOMetadataNode getStandardDimensionNode() {
|
||||
IIOMetadataNode dimension_node = new IIOMetadataNode("Dimension");
|
||||
IIOMetadataNode node = null; // scratch node
|
||||
@ -604,6 +610,7 @@ public class TIFFImageMetadata extends IIOMetadata {
|
||||
return dimension_node;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIOMetadataNode getStandardDocumentNode() {
|
||||
IIOMetadataNode document_node = new IIOMetadataNode("Document");
|
||||
IIOMetadataNode node = null; // scratch node
|
||||
@ -669,6 +676,7 @@ public class TIFFImageMetadata extends IIOMetadata {
|
||||
return document_node;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIOMetadataNode getStandardTextNode() {
|
||||
IIOMetadataNode text_node = null;
|
||||
IIOMetadataNode node = null; // scratch node
|
||||
@ -705,6 +713,7 @@ public class TIFFImageMetadata extends IIOMetadata {
|
||||
return text_node;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIOMetadataNode getStandardTransparencyNode() {
|
||||
IIOMetadataNode transparency_node =
|
||||
new IIOMetadataNode("Transparency");
|
||||
@ -1579,6 +1588,7 @@ public class TIFFImageMetadata extends IIOMetadata {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mergeTree(String formatName, Node root)
|
||||
throws IIOInvalidTreeException{
|
||||
if (formatName.equals(nativeMetadataFormatName)) {
|
||||
@ -1597,6 +1607,7 @@ public class TIFFImageMetadata extends IIOMetadata {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset() {
|
||||
rootIFD = new TIFFIFD(tagSets);
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2025, 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
|
||||
@ -34,6 +34,7 @@ public class TIFFImageMetadataFormat extends TIFFMetadataFormat {
|
||||
static {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canNodeAppear(String elementName,
|
||||
ImageTypeSpecifier imageType) {
|
||||
return false;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2025, 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
|
||||
@ -96,6 +96,7 @@ public class TIFFImageMetadataFormatResources extends ListResourceBundle {
|
||||
public TIFFImageMetadataFormatResources() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object[][] getContents() {
|
||||
return contents.clone();
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2025, 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
|
||||
@ -56,10 +56,12 @@ public class TIFFImageReaderSpi extends ImageReaderSpi {
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription(Locale locale) {
|
||||
return "Standard TIFF image reader";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canDecodeInput(Object input) throws IOException {
|
||||
if (!(input instanceof ImageInputStream)) {
|
||||
return false;
|
||||
@ -78,10 +80,12 @@ public class TIFFImageReaderSpi extends ImageReaderSpi {
|
||||
b[2] == (byte)0x00 && b[3] == (byte)0x2a));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ImageReader createReaderInstance(Object extension) {
|
||||
return new TIFFImageReader(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRegistration(ServiceRegistry registry,
|
||||
Class<?> category) {
|
||||
if (registered) {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2025, 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
|
||||
@ -55,18 +55,22 @@ public class TIFFImageWriterSpi extends ImageWriterSpi {
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canEncodeImage(ImageTypeSpecifier type) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription(Locale locale) {
|
||||
return "Standard TIFF image writer";
|
||||
}
|
||||
|
||||
@Override
|
||||
public ImageWriter createWriterInstance(Object extension) {
|
||||
return new TIFFImageWriter(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRegistration(ServiceRegistry registry,
|
||||
Class<?> category) {
|
||||
if (registered) {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2025, 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
|
||||
@ -54,6 +54,7 @@ public class TIFFJPEGCompressor extends TIFFBaseJPEGCompressor {
|
||||
private static class JPEGSPIFilter implements ServiceRegistry.Filter {
|
||||
JPEGSPIFilter() {}
|
||||
|
||||
@Override
|
||||
public boolean filter(Object provider) {
|
||||
ImageReaderSpi readerSPI = (ImageReaderSpi)provider;
|
||||
|
||||
@ -112,6 +113,7 @@ public class TIFFJPEGCompressor extends TIFFBaseJPEGCompressor {
|
||||
*
|
||||
* @see #getMetadata()
|
||||
*/
|
||||
@Override
|
||||
public void setMetadata(IIOMetadata metadata) {
|
||||
super.setMetadata(metadata);
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2025, 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
|
||||
@ -54,6 +54,7 @@ public class TIFFJPEGDecompressor extends TIFFDecompressor {
|
||||
|
||||
public TIFFJPEGDecompressor() {}
|
||||
|
||||
@Override
|
||||
public void beginDecoding() {
|
||||
// Initialize the JPEG reader if needed.
|
||||
if(this.JPEGReader == null) {
|
||||
@ -90,6 +91,7 @@ public class TIFFJPEGDecompressor extends TIFFDecompressor {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void decodeRaw(byte[] b,
|
||||
int dstOffset,
|
||||
int bitsPerPixel,
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2025, 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
|
||||
@ -36,6 +36,7 @@ public class TIFFLSBCompressor extends TIFFCompressor {
|
||||
super("", BaselineTIFFTagSet.COMPRESSION_NONE, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int encode(byte[] b, int off,
|
||||
int width, int height,
|
||||
int[] bitsPerSample,
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2025, 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
|
||||
@ -35,6 +35,7 @@ public class TIFFLSBDecompressor extends TIFFDecompressor {
|
||||
|
||||
public TIFFLSBDecompressor() {}
|
||||
|
||||
@Override
|
||||
public void decodeRaw(byte[] b,
|
||||
int dstOffset,
|
||||
int bitsPerPixel,
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2025, 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
|
||||
@ -41,10 +41,12 @@ public class TIFFLZWCompressor extends TIFFCompressor {
|
||||
this.predictor = predictorValue;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setStream(ImageOutputStream stream) {
|
||||
super.setStream(stream);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int encode(byte[] b, int off,
|
||||
int width, int height,
|
||||
int[] bitsPerSample,
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2025, 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
|
||||
@ -76,6 +76,7 @@ class TIFFLZWDecompressor extends TIFFDecompressor {
|
||||
flipBits = fillOrder == BaselineTIFFTagSet.FILL_ORDER_RIGHT_TO_LEFT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void decodeRaw(byte[] b,
|
||||
int dstOffset,
|
||||
int bitsPerPixel,
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2025, 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
|
||||
@ -39,6 +39,7 @@ public abstract class TIFFMetadataFormat implements IIOMetadataFormat {
|
||||
protected String resourceBaseName;
|
||||
protected String rootName;
|
||||
|
||||
@Override
|
||||
public String getRootName() {
|
||||
return rootName;
|
||||
}
|
||||
@ -85,16 +86,19 @@ public abstract class TIFFMetadataFormat implements IIOMetadataFormat {
|
||||
return info;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getElementMinChildren(String elementName) {
|
||||
TIFFElementInfo info = getElementInfo(elementName);
|
||||
return info.minChildren;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getElementMaxChildren(String elementName) {
|
||||
TIFFElementInfo info = getElementInfo(elementName);
|
||||
return info.maxChildren;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getElementDescription(String elementName, Locale locale) {
|
||||
if (!elementInfoMap.containsKey(elementName)) {
|
||||
throw new IllegalArgumentException("No such element: " +
|
||||
@ -103,64 +107,77 @@ public abstract class TIFFMetadataFormat implements IIOMetadataFormat {
|
||||
return getResource(elementName, locale);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getChildPolicy(String elementName) {
|
||||
TIFFElementInfo info = getElementInfo(elementName);
|
||||
return info.childPolicy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getChildNames(String elementName) {
|
||||
TIFFElementInfo info = getElementInfo(elementName);
|
||||
return info.childNames;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getAttributeNames(String elementName) {
|
||||
TIFFElementInfo info = getElementInfo(elementName);
|
||||
return info.attributeNames;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAttributeValueType(String elementName, String attrName) {
|
||||
TIFFAttrInfo info = getAttrInfo(elementName, attrName);
|
||||
return info.valueType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAttributeDataType(String elementName, String attrName) {
|
||||
TIFFAttrInfo info = getAttrInfo(elementName, attrName);
|
||||
return info.dataType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAttributeRequired(String elementName, String attrName) {
|
||||
TIFFAttrInfo info = getAttrInfo(elementName, attrName);
|
||||
return info.isRequired;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAttributeDefaultValue(String elementName,
|
||||
String attrName) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getAttributeEnumerations(String elementName,
|
||||
String attrName) {
|
||||
throw new IllegalArgumentException("The attribute is not an enumeration.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAttributeMinValue(String elementName, String attrName) {
|
||||
throw new IllegalArgumentException("The attribute is not a range.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAttributeMaxValue(String elementName, String attrName) {
|
||||
throw new IllegalArgumentException("The attribute is not a range.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAttributeListMinLength(String elementName, String attrName) {
|
||||
TIFFAttrInfo info = getAttrInfo(elementName, attrName);
|
||||
return info.listMinLength;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAttributeListMaxLength(String elementName, String attrName) {
|
||||
TIFFAttrInfo info = getAttrInfo(elementName, attrName);
|
||||
return info.listMaxLength;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAttributeDescription(String elementName, String attrName,
|
||||
Locale locale) {
|
||||
String key = elementName + "/" + attrName;
|
||||
@ -170,11 +187,13 @@ public abstract class TIFFMetadataFormat implements IIOMetadataFormat {
|
||||
return getResource(key, locale);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getObjectValueType(String elementName) {
|
||||
TIFFElementInfo info = getElementInfo(elementName);
|
||||
return info.objectValueType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getObjectClass(String elementName) {
|
||||
TIFFElementInfo info = getElementInfo(elementName);
|
||||
if (info.objectValueType == VALUE_NONE) {
|
||||
@ -184,6 +203,7 @@ public abstract class TIFFMetadataFormat implements IIOMetadataFormat {
|
||||
return info.objectClass;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getObjectDefaultValue(String elementName) {
|
||||
TIFFElementInfo info = getElementInfo(elementName);
|
||||
if (info.objectValueType == VALUE_NONE) {
|
||||
@ -193,6 +213,7 @@ public abstract class TIFFMetadataFormat implements IIOMetadataFormat {
|
||||
return info.objectDefaultValue;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object[] getObjectEnumerations(String elementName) {
|
||||
TIFFElementInfo info = getElementInfo(elementName);
|
||||
if (info.objectValueType == VALUE_NONE) {
|
||||
@ -202,6 +223,7 @@ public abstract class TIFFMetadataFormat implements IIOMetadataFormat {
|
||||
return info.objectEnumerations;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Comparable<Object> getObjectMinValue(String elementName) {
|
||||
TIFFElementInfo info = getElementInfo(elementName);
|
||||
if (info.objectValueType == VALUE_NONE) {
|
||||
@ -211,6 +233,7 @@ public abstract class TIFFMetadataFormat implements IIOMetadataFormat {
|
||||
return info.objectMinValue;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Comparable<Object> getObjectMaxValue(String elementName) {
|
||||
TIFFElementInfo info = getElementInfo(elementName);
|
||||
if (info.objectValueType == VALUE_NONE) {
|
||||
@ -220,6 +243,7 @@ public abstract class TIFFMetadataFormat implements IIOMetadataFormat {
|
||||
return info.objectMaxValue;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getObjectArrayMinLength(String elementName) {
|
||||
TIFFElementInfo info = getElementInfo(elementName);
|
||||
if (info.objectValueType == VALUE_NONE) {
|
||||
@ -229,6 +253,7 @@ public abstract class TIFFMetadataFormat implements IIOMetadataFormat {
|
||||
return info.objectArrayMinLength;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getObjectArrayMaxLength(String elementName) {
|
||||
TIFFElementInfo info = getElementInfo(elementName);
|
||||
if (info.objectValueType == VALUE_NONE) {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2025, 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
|
||||
@ -33,6 +33,7 @@ public class TIFFNullCompressor extends TIFFCompressor {
|
||||
super("", BaselineTIFFTagSet.COMPRESSION_NONE, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int encode(byte[] b, int off,
|
||||
int width, int height,
|
||||
int[] bitsPerSample,
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2025, 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
|
||||
@ -56,6 +56,7 @@ public class TIFFNullDecompressor extends TIFFDecompressor {
|
||||
// change beginDecoding() and decode() to use the active region values
|
||||
// when random access is easy and the entire region values otherwise.
|
||||
//
|
||||
@Override
|
||||
public void beginDecoding() {
|
||||
// Determine number of bits per pixel.
|
||||
int bitsPerPixel = 0;
|
||||
@ -89,6 +90,7 @@ public class TIFFNullDecompressor extends TIFFDecompressor {
|
||||
super.beginDecoding();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void decode() throws IOException {
|
||||
super.decode();
|
||||
|
||||
@ -105,6 +107,7 @@ public class TIFFNullDecompressor extends TIFFDecompressor {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void decodeRaw(byte[] b,
|
||||
int dstOffset,
|
||||
int bitsPerPixel,
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2025, 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
|
||||
@ -545,6 +545,7 @@ public class TIFFOldJPEGDecompressor extends TIFFJPEGDecompressor {
|
||||
// The strategy for cases 4-5 is to concatenate a tables stream created
|
||||
// in initialize() with the entropy coded data in each strip or tile.
|
||||
//
|
||||
@Override
|
||||
public void decodeRaw(byte[] b,
|
||||
int dstOffset,
|
||||
int bitsPerPixel,
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2025, 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
|
||||
@ -86,6 +86,7 @@ public class TIFFPackBitsCompressor extends TIFFCompressor {
|
||||
return outOffset;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int encode(byte[] b, int off,
|
||||
int width, int height,
|
||||
int[] bitsPerSample,
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2025, 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
|
||||
@ -72,6 +72,7 @@ public class TIFFPackBitsDecompressor extends TIFFDecompressor {
|
||||
return dstIndex - dstOffset;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void decodeRaw(byte[] b,
|
||||
int dstOffset,
|
||||
int bitsPerPixel,
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2025, 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
|
||||
@ -87,6 +87,7 @@ public class TIFFRLECompressor extends TIFFFaxCompressor {
|
||||
return outIndex;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int encode(byte[] b, int off,
|
||||
int width, int height,
|
||||
int[] bitsPerSample,
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2025, 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
|
||||
@ -130,74 +130,92 @@ public class TIFFRenderedImage implements RenderedImage {
|
||||
return newParam;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Vector<RenderedImage> getSources() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getProperty(String name) {
|
||||
return java.awt.Image.UndefinedProperty;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getPropertyNames() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ColorModel getColorModel() {
|
||||
return its.getColorModel();
|
||||
}
|
||||
|
||||
@Override
|
||||
public SampleModel getSampleModel() {
|
||||
return its.getSampleModel();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getWidth() {
|
||||
return width;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getHeight() {
|
||||
return height;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMinX() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMinY() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getNumXTiles() {
|
||||
return (width + tileWidth - 1)/tileWidth;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getNumYTiles() {
|
||||
return (height + tileHeight - 1)/tileHeight;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMinTileX() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMinTileY() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTileWidth() {
|
||||
return tileWidth;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTileHeight() {
|
||||
return tileHeight;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTileGridXOffset() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTileGridYOffset() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Raster getTile(int tileX, int tileY) {
|
||||
Rectangle tileRect = new Rectangle(tileX*tileWidth,
|
||||
tileY*tileHeight,
|
||||
@ -206,10 +224,12 @@ public class TIFFRenderedImage implements RenderedImage {
|
||||
return getData(tileRect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Raster getData() {
|
||||
return read(new Rectangle(0, 0, getWidth(), getHeight()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Raster getData(Rectangle rect) {
|
||||
return read(rect);
|
||||
}
|
||||
@ -236,6 +256,7 @@ public class TIFFRenderedImage implements RenderedImage {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public WritableRaster copyData(WritableRaster raster) {
|
||||
if (raster == null) {
|
||||
return read(new Rectangle(0, 0, getWidth(), getHeight()));
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2025, 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
|
||||
@ -54,6 +54,7 @@ public class TIFFStreamMetadata extends IIOMetadata {
|
||||
null, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isReadOnly() {
|
||||
return false;
|
||||
}
|
||||
@ -64,6 +65,7 @@ public class TIFFStreamMetadata extends IIOMetadata {
|
||||
throw new IIOInvalidTreeException(reason, node);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Node getAsTree(String formatName) {
|
||||
IIOMetadataNode root = new IIOMetadataNode(nativeMetadataFormatName);
|
||||
|
||||
@ -103,6 +105,7 @@ public class TIFFStreamMetadata extends IIOMetadata {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mergeTree(String formatName, Node root)
|
||||
throws IIOInvalidTreeException {
|
||||
if (formatName.equals(nativeMetadataFormatName)) {
|
||||
@ -115,6 +118,7 @@ public class TIFFStreamMetadata extends IIOMetadata {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset() {
|
||||
this.byteOrder = ByteOrder.BIG_ENDIAN;
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2025, 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
|
||||
@ -31,6 +31,7 @@ public class TIFFStreamMetadataFormat extends TIFFMetadataFormat {
|
||||
|
||||
private static TIFFStreamMetadataFormat theInstance = null;
|
||||
|
||||
@Override
|
||||
public boolean canNodeAppear(String elementName,
|
||||
ImageTypeSpecifier imageType) {
|
||||
return false;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2025, 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
|
||||
@ -36,6 +36,7 @@ public class TIFFStreamMetadataFormatResources extends ListResourceBundle {
|
||||
public TIFFStreamMetadataFormatResources() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object[][] getContents() {
|
||||
return contents.clone();
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2025, 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
|
||||
@ -52,6 +52,7 @@ public class TIFFT4Compressor extends TIFFFaxCompressor {
|
||||
*
|
||||
* @see #getMetadata()
|
||||
*/
|
||||
@Override
|
||||
public void setMetadata(IIOMetadata metadata) {
|
||||
super.setMetadata(metadata);
|
||||
|
||||
@ -214,6 +215,7 @@ public class TIFFT4Compressor extends TIFFFaxCompressor {
|
||||
return outIndex;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int encode(byte[] b, int off,
|
||||
int width, int height,
|
||||
int[] bitsPerSample,
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2025, 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
|
||||
@ -146,6 +146,7 @@ public class TIFFT6Compressor extends TIFFFaxCompressor {
|
||||
return outIndex;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int encode(byte[] b, int off,
|
||||
int width, int height,
|
||||
int[] bitsPerSample,
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2025, 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
|
||||
@ -80,6 +80,7 @@ public class TIFFYCbCrColorConverter extends TIFFColorConverter {
|
||||
/ CodingRange) + ReferenceBlack;
|
||||
|
||||
*/
|
||||
@Override
|
||||
public void fromRGB(float r, float g, float b, float[] result) {
|
||||
// Convert RGB to full-range YCbCr.
|
||||
float Y = (lumaRed*r + lumaGreen*g + lumaBlue*b);
|
||||
@ -95,6 +96,7 @@ public class TIFFYCbCrColorConverter extends TIFFColorConverter {
|
||||
referenceBlackCr;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toRGB(float x0, float x1, float x2, float[] rgb) {
|
||||
// Convert YCbCr code to full-range YCbCr.
|
||||
float Y = (x0 - referenceBlackY)*CODING_RANGE_Y/
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2025, 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
|
||||
@ -95,6 +95,7 @@ public class TIFFYCbCrDecompressor extends TIFFDecompressor {
|
||||
// "Chained" decompressor methods.
|
||||
//
|
||||
|
||||
@Override
|
||||
public void setReader(ImageReader reader) {
|
||||
if(decompressor != null) {
|
||||
decompressor.setReader(reader);
|
||||
@ -102,6 +103,7 @@ public class TIFFYCbCrDecompressor extends TIFFDecompressor {
|
||||
super.setReader(reader);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMetadata(IIOMetadata metadata) {
|
||||
if(decompressor != null) {
|
||||
decompressor.setMetadata(metadata);
|
||||
@ -109,6 +111,7 @@ public class TIFFYCbCrDecompressor extends TIFFDecompressor {
|
||||
super.setMetadata(metadata);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPhotometricInterpretation(int photometricInterpretation) {
|
||||
if(decompressor != null) {
|
||||
decompressor.setPhotometricInterpretation(photometricInterpretation);
|
||||
@ -116,6 +119,7 @@ public class TIFFYCbCrDecompressor extends TIFFDecompressor {
|
||||
super.setPhotometricInterpretation(photometricInterpretation);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCompression(int compression) {
|
||||
if(decompressor != null) {
|
||||
decompressor.setCompression(compression);
|
||||
@ -123,6 +127,7 @@ public class TIFFYCbCrDecompressor extends TIFFDecompressor {
|
||||
super.setCompression(compression);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPlanar(boolean planar) {
|
||||
if(decompressor != null) {
|
||||
decompressor.setPlanar(planar);
|
||||
@ -130,6 +135,7 @@ public class TIFFYCbCrDecompressor extends TIFFDecompressor {
|
||||
super.setPlanar(planar);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSamplesPerPixel(int samplesPerPixel) {
|
||||
if(decompressor != null) {
|
||||
decompressor.setSamplesPerPixel(samplesPerPixel);
|
||||
@ -137,6 +143,7 @@ public class TIFFYCbCrDecompressor extends TIFFDecompressor {
|
||||
super.setSamplesPerPixel(samplesPerPixel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBitsPerSample(int[] bitsPerSample) {
|
||||
if(decompressor != null) {
|
||||
decompressor.setBitsPerSample(bitsPerSample);
|
||||
@ -144,6 +151,7 @@ public class TIFFYCbCrDecompressor extends TIFFDecompressor {
|
||||
super.setBitsPerSample(bitsPerSample);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSampleFormat(int[] sampleFormat) {
|
||||
if(decompressor != null) {
|
||||
decompressor.setSampleFormat(sampleFormat);
|
||||
@ -151,6 +159,7 @@ public class TIFFYCbCrDecompressor extends TIFFDecompressor {
|
||||
super.setSampleFormat(sampleFormat);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setExtraSamples(int[] extraSamples) {
|
||||
if(decompressor != null) {
|
||||
decompressor.setExtraSamples(extraSamples);
|
||||
@ -158,6 +167,7 @@ public class TIFFYCbCrDecompressor extends TIFFDecompressor {
|
||||
super.setExtraSamples(extraSamples);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setColorMap(char[] colorMap) {
|
||||
if(decompressor != null) {
|
||||
decompressor.setColorMap(colorMap);
|
||||
@ -165,6 +175,7 @@ public class TIFFYCbCrDecompressor extends TIFFDecompressor {
|
||||
super.setColorMap(colorMap);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setStream(ImageInputStream stream) {
|
||||
if(decompressor != null) {
|
||||
decompressor.setStream(stream);
|
||||
@ -173,6 +184,7 @@ public class TIFFYCbCrDecompressor extends TIFFDecompressor {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setOffset(long offset) {
|
||||
if(decompressor != null) {
|
||||
decompressor.setOffset(offset);
|
||||
@ -180,6 +192,7 @@ public class TIFFYCbCrDecompressor extends TIFFDecompressor {
|
||||
super.setOffset(offset);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setByteCount(int byteCount) throws IOException {
|
||||
if(decompressor != null) {
|
||||
decompressor.setByteCount(byteCount);
|
||||
@ -187,6 +200,7 @@ public class TIFFYCbCrDecompressor extends TIFFDecompressor {
|
||||
super.setByteCount(byteCount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSrcMinX(int srcMinX) {
|
||||
if(decompressor != null) {
|
||||
decompressor.setSrcMinX(srcMinX);
|
||||
@ -194,6 +208,7 @@ public class TIFFYCbCrDecompressor extends TIFFDecompressor {
|
||||
super.setSrcMinX(srcMinX);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSrcMinY(int srcMinY) {
|
||||
if(decompressor != null) {
|
||||
decompressor.setSrcMinY(srcMinY);
|
||||
@ -201,6 +216,7 @@ public class TIFFYCbCrDecompressor extends TIFFDecompressor {
|
||||
super.setSrcMinY(srcMinY);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSrcWidth(int srcWidth) {
|
||||
if(decompressor != null) {
|
||||
decompressor.setSrcWidth(srcWidth);
|
||||
@ -208,6 +224,7 @@ public class TIFFYCbCrDecompressor extends TIFFDecompressor {
|
||||
super.setSrcWidth(srcWidth);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSrcHeight(int srcHeight) {
|
||||
if(decompressor != null) {
|
||||
decompressor.setSrcHeight(srcHeight);
|
||||
@ -215,6 +232,7 @@ public class TIFFYCbCrDecompressor extends TIFFDecompressor {
|
||||
super.setSrcHeight(srcHeight);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSourceXOffset(int sourceXOffset) {
|
||||
if(decompressor != null) {
|
||||
decompressor.setSourceXOffset(sourceXOffset);
|
||||
@ -222,6 +240,7 @@ public class TIFFYCbCrDecompressor extends TIFFDecompressor {
|
||||
super.setSourceXOffset(sourceXOffset);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDstXOffset(int dstXOffset) {
|
||||
if(decompressor != null) {
|
||||
decompressor.setDstXOffset(dstXOffset);
|
||||
@ -229,6 +248,7 @@ public class TIFFYCbCrDecompressor extends TIFFDecompressor {
|
||||
super.setDstXOffset(dstXOffset);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSourceYOffset(int sourceYOffset) {
|
||||
if(decompressor != null) {
|
||||
decompressor.setSourceYOffset(sourceYOffset);
|
||||
@ -236,6 +256,7 @@ public class TIFFYCbCrDecompressor extends TIFFDecompressor {
|
||||
super.setSourceYOffset(sourceYOffset);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDstYOffset(int dstYOffset) {
|
||||
if(decompressor != null) {
|
||||
decompressor.setDstYOffset(dstYOffset);
|
||||
@ -260,6 +281,7 @@ public class TIFFYCbCrDecompressor extends TIFFDecompressor {
|
||||
}
|
||||
*/
|
||||
|
||||
@Override
|
||||
public void setSourceBands(int[] sourceBands) {
|
||||
if(decompressor != null) {
|
||||
decompressor.setSourceBands(sourceBands);
|
||||
@ -267,6 +289,7 @@ public class TIFFYCbCrDecompressor extends TIFFDecompressor {
|
||||
super.setSourceBands(sourceBands);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDestinationBands(int[] destinationBands) {
|
||||
if(decompressor != null) {
|
||||
decompressor.setDestinationBands(destinationBands);
|
||||
@ -274,6 +297,7 @@ public class TIFFYCbCrDecompressor extends TIFFDecompressor {
|
||||
super.setDestinationBands(destinationBands);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setImage(BufferedImage image) {
|
||||
if(decompressor != null) {
|
||||
ColorModel cm = image.getColorModel();
|
||||
@ -287,6 +311,7 @@ public class TIFFYCbCrDecompressor extends TIFFDecompressor {
|
||||
super.setImage(image);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDstMinX(int dstMinX) {
|
||||
if(decompressor != null) {
|
||||
decompressor.setDstMinX(dstMinX);
|
||||
@ -294,6 +319,7 @@ public class TIFFYCbCrDecompressor extends TIFFDecompressor {
|
||||
super.setDstMinX(dstMinX);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDstMinY(int dstMinY) {
|
||||
if(decompressor != null) {
|
||||
decompressor.setDstMinY(dstMinY);
|
||||
@ -301,6 +327,7 @@ public class TIFFYCbCrDecompressor extends TIFFDecompressor {
|
||||
super.setDstMinY(dstMinY);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDstWidth(int dstWidth) {
|
||||
if(decompressor != null) {
|
||||
decompressor.setDstWidth(dstWidth);
|
||||
@ -308,6 +335,7 @@ public class TIFFYCbCrDecompressor extends TIFFDecompressor {
|
||||
super.setDstWidth(dstWidth);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDstHeight(int dstHeight) {
|
||||
if(decompressor != null) {
|
||||
decompressor.setDstHeight(dstHeight);
|
||||
@ -315,6 +343,7 @@ public class TIFFYCbCrDecompressor extends TIFFDecompressor {
|
||||
super.setDstHeight(dstHeight);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setActiveSrcMinX(int activeSrcMinX) {
|
||||
if(decompressor != null) {
|
||||
decompressor.setActiveSrcMinX(activeSrcMinX);
|
||||
@ -322,6 +351,7 @@ public class TIFFYCbCrDecompressor extends TIFFDecompressor {
|
||||
super.setActiveSrcMinX(activeSrcMinX);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setActiveSrcMinY(int activeSrcMinY) {
|
||||
if(decompressor != null) {
|
||||
decompressor.setActiveSrcMinY(activeSrcMinY);
|
||||
@ -329,6 +359,7 @@ public class TIFFYCbCrDecompressor extends TIFFDecompressor {
|
||||
super.setActiveSrcMinY(activeSrcMinY);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setActiveSrcWidth(int activeSrcWidth) {
|
||||
if(decompressor != null) {
|
||||
decompressor.setActiveSrcWidth(activeSrcWidth);
|
||||
@ -336,6 +367,7 @@ public class TIFFYCbCrDecompressor extends TIFFDecompressor {
|
||||
super.setActiveSrcWidth(activeSrcWidth);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setActiveSrcHeight(int activeSrcHeight) {
|
||||
if(decompressor != null) {
|
||||
decompressor.setActiveSrcHeight(activeSrcHeight);
|
||||
@ -353,6 +385,7 @@ public class TIFFYCbCrDecompressor extends TIFFDecompressor {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beginDecoding() {
|
||||
if(decompressor != null) {
|
||||
decompressor.beginDecoding();
|
||||
@ -445,6 +478,7 @@ public class TIFFYCbCrDecompressor extends TIFFDecompressor {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void decodeRaw(byte[] buf,
|
||||
int dstOffset,
|
||||
int bitsPerPixel,
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2025, 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
|
||||
@ -63,6 +63,7 @@ public class WBMPImageReaderSpi extends ImageReaderSpi {
|
||||
null, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRegistration(ServiceRegistry registry,
|
||||
Class<?> category) {
|
||||
if (registered) {
|
||||
@ -71,10 +72,12 @@ public class WBMPImageReaderSpi extends ImageReaderSpi {
|
||||
registered = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription(Locale locale) {
|
||||
return "Standard WBMP Image Reader";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canDecodeInput(Object source) throws IOException {
|
||||
if (!(source instanceof ImageInputStream)) {
|
||||
return false;
|
||||
@ -149,6 +152,7 @@ public class WBMPImageReaderSpi extends ImageReaderSpi {
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ImageReader createReaderInstance(Object extension)
|
||||
throws IIOException {
|
||||
return new WBMPImageReader(this);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2025, 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
|
||||
@ -63,10 +63,12 @@ public class WBMPImageWriterSpi extends ImageWriterSpi {
|
||||
null, null, null, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription(Locale locale) {
|
||||
return "Standard WBMP Image Writer";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRegistration(ServiceRegistry registry,
|
||||
Class<?> category) {
|
||||
if (registered) {
|
||||
@ -76,6 +78,7 @@ public class WBMPImageWriterSpi extends ImageWriterSpi {
|
||||
registered = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canEncodeImage(ImageTypeSpecifier type) {
|
||||
SampleModel sm = type.getSampleModel();
|
||||
if (!(sm instanceof MultiPixelPackedSampleModel))
|
||||
@ -86,6 +89,7 @@ public class WBMPImageWriterSpi extends ImageWriterSpi {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ImageWriter createWriterInstance(Object extension)
|
||||
throws IIOException {
|
||||
return new WBMPImageWriter(this);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2025, 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
|
||||
@ -50,10 +50,12 @@ public class WBMPMetadata extends IIOMetadata {
|
||||
null, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isReadOnly() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Node getAsTree(String formatName) {
|
||||
if (formatName.equals(nativeMetadataFormatName)) {
|
||||
return getNativeTree();
|
||||
@ -76,14 +78,17 @@ public class WBMPMetadata extends IIOMetadata {
|
||||
return root;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFromTree(String formatName, Node root) {
|
||||
throw new IllegalStateException(I18N.getString("WBMPMetadata1"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mergeTree(String formatName, Node root) {
|
||||
throw new IllegalStateException(I18N.getString("WBMPMetadata1"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset() {
|
||||
throw new IllegalStateException(I18N.getString("WBMPMetadata1"));
|
||||
}
|
||||
@ -101,6 +106,7 @@ public class WBMPMetadata extends IIOMetadata {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected IIOMetadataNode getStandardChromaNode() {
|
||||
|
||||
IIOMetadataNode node = new IIOMetadataNode("Chroma");
|
||||
@ -112,6 +118,7 @@ public class WBMPMetadata extends IIOMetadata {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected IIOMetadataNode getStandardDimensionNode() {
|
||||
IIOMetadataNode dimension_node = new IIOMetadataNode("Dimension");
|
||||
IIOMetadataNode node = null; // scratch node
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2025, 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
|
||||
@ -56,6 +56,7 @@ public class WBMPMetadataFormat extends IIOMetadataFormatImpl {
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public boolean canNodeAppear(String elementName,
|
||||
ImageTypeSpecifier imageType) {
|
||||
return true;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2025, 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
|
||||
@ -43,10 +43,12 @@ public class FileImageInputStreamSpi extends ImageInputStreamSpi {
|
||||
super(vendorName, version, inputClass);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription(Locale locale) {
|
||||
return "Service provider that instantiates a FileImageInputStream from a File";
|
||||
}
|
||||
|
||||
@Override
|
||||
public ImageInputStream createInputStreamInstance(Object input,
|
||||
boolean useCache,
|
||||
File cacheDir) {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2025, 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
|
||||
@ -43,10 +43,12 @@ public class FileImageOutputStreamSpi extends ImageOutputStreamSpi {
|
||||
super(vendorName, version, outputClass);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription(Locale locale) {
|
||||
return "Service provider that instantiates a FileImageOutputStream from a File";
|
||||
}
|
||||
|
||||
@Override
|
||||
public ImageOutputStream createOutputStreamInstance(Object output,
|
||||
boolean useCache,
|
||||
File cacheDir) {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2025, 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
|
||||
@ -46,18 +46,22 @@ public class InputStreamImageInputStreamSpi extends ImageInputStreamSpi {
|
||||
super(vendorName, version, inputClass);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription(Locale locale) {
|
||||
return "Service provider that instantiates a FileCacheImageInputStream or MemoryCacheImageInputStream from an InputStream";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUseCacheFile() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean needsCacheFile() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ImageInputStream createInputStreamInstance(Object input,
|
||||
boolean useCache,
|
||||
File cacheDir)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2025, 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
|
||||
@ -46,18 +46,22 @@ public class OutputStreamImageOutputStreamSpi extends ImageOutputStreamSpi {
|
||||
super(vendorName, version, outputClass);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription(Locale locale) {
|
||||
return "Service provider that instantiates an OutputStreamImageOutputStream from an OutputStream";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUseCacheFile() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean needsCacheFile() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ImageOutputStream createOutputStreamInstance(Object output,
|
||||
boolean useCache,
|
||||
File cacheDir)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2025, 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
|
||||
@ -44,10 +44,12 @@ public class RAFImageInputStreamSpi extends ImageInputStreamSpi {
|
||||
super(vendorName, version, inputClass);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription(Locale locale) {
|
||||
return "Service provider that instantiates a FileImageInputStream from a RandomAccessFile";
|
||||
}
|
||||
|
||||
@Override
|
||||
public ImageInputStream createInputStreamInstance(Object input,
|
||||
boolean useCache,
|
||||
File cacheDir) {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2025, 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
|
||||
@ -44,10 +44,12 @@ public class RAFImageOutputStreamSpi extends ImageOutputStreamSpi {
|
||||
super(vendorName, version, outputClass);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription(Locale locale) {
|
||||
return "Service provider that instantiates a FileImageOutputStream from a RandomAccessFile";
|
||||
}
|
||||
|
||||
@Override
|
||||
public ImageOutputStream createOutputStreamInstance(Object output,
|
||||
boolean useCache,
|
||||
File cacheDir) {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2025, 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
|
||||
@ -41,6 +41,7 @@ public class CloseableDisposerRecord implements DisposerRecord {
|
||||
this.closeable = closeable;
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void dispose() {
|
||||
if (closeable != null) {
|
||||
try {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2025, 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
|
||||
@ -60,6 +60,7 @@ public class StreamCloser {
|
||||
|
||||
if (streamCloser == null) {
|
||||
final Runnable streamCloserRunnable = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (toCloseQueue != null) {
|
||||
synchronized (StreamCloser.class) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user