Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -61,6 +61,7 @@ public BMPImageReaderSpi() {
null, null);
}

@Override
public void onRegistration(ServiceRegistry registry,
Class<?> category) {
if (registered) {
Expand All @@ -69,10 +70,12 @@ public void onRegistration(ServiceRegistry registry,
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;
Expand All @@ -87,6 +90,7 @@ public boolean canDecodeInput(Object source) throws IOException {
return full && (b[0] == 0x42) && (b[1] == 0x4d);
}

@Override
public ImageReader createReaderInstance(Object extension)
throws IIOException {
return new BMPImageReader(this);
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -66,10 +66,12 @@ public BMPImageWriterSpi() {
null, null);
}

@Override
public String getDescription(Locale locale) {
return "Standard BMP Image Writer";
}

@Override
public void onRegistration(ServiceRegistry registry,
Class<?> category) {
if (registered) {
Expand All @@ -79,6 +81,7 @@ public void onRegistration(ServiceRegistry registry,
registered = true;
}

@Override
public boolean canEncodeImage(ImageTypeSpecifier type) {
int dataType= type.getSampleModel().getDataType();
if (dataType < DataBuffer.TYPE_BYTE || dataType > DataBuffer.TYPE_INT)
Expand All @@ -99,6 +102,7 @@ public boolean canEncodeImage(ImageTypeSpecifier type) {
return true;
}

@Override
public ImageWriter createWriterInstance(Object extension)
throws IIOException {
return new BMPImageWriter(this);
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -94,10 +94,12 @@ public BMPMetadata() {
null, null);
}

@Override
public boolean isReadOnly() {
return true;
}

@Override
public Node getAsTree(String formatName) {
if (formatName.equals(nativeMetadataFormatName)) {
return getNativeTree();
Expand Down Expand Up @@ -177,6 +179,7 @@ private Node getNativeTree() {
}

// Standard tree node methods
@Override
protected IIOMetadataNode getStandardChromaNode() {

if ((palette != null) && (paletteSize > 0)) {
Expand All @@ -202,6 +205,7 @@ protected IIOMetadataNode getStandardChromaNode() {
return null;
}

@Override
protected IIOMetadataNode getStandardCompressionNode() {
IIOMetadataNode node = new IIOMetadataNode("Compression");

Expand All @@ -212,6 +216,7 @@ protected IIOMetadataNode getStandardCompressionNode() {
return node;
}

@Override
protected IIOMetadataNode getStandardDataNode() {
IIOMetadataNode node = new IIOMetadataNode("Data");

Expand All @@ -230,6 +235,7 @@ else if (bitsPerPixel == 16 || bitsPerPixel == 32) {
return node;
}

@Override
protected IIOMetadataNode getStandardDimensionNode() {
if (yPixelsPerMeter > 0.0F && xPixelsPerMeter > 0.0F) {
IIOMetadataNode node = new IIOMetadataNode("Dimension");
Expand All @@ -251,14 +257,17 @@ protected IIOMetadataNode getStandardDimensionNode() {
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"));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -194,6 +194,7 @@ private BMPMetadataFormat() {
DATATYPE_STRING, true, null);
}

@Override
public boolean canNodeAppear(String elementName,
ImageTypeSpecifier imageType) {
return true;
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -33,6 +33,7 @@ public class BMPMetadataFormatResources extends ListResourceBundle {

public BMPMetadataFormatResources() {}

@Override
protected Object[][] getContents() {
return new Object[][] {

Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -79,6 +79,7 @@ public BogusColorSpace(int numComponents) {
// specified behavior of the methods vis-a-vis exceptions.
//

@Override
public float[] toRGB(float[] colorvalue) {
if(colorvalue.length < getNumComponents()) {
throw new ArrayIndexOutOfBoundsException
Expand All @@ -93,6 +94,7 @@ public float[] toRGB(float[] colorvalue) {
return rgbvalue;
}

@Override
public float[] fromRGB(float[] rgbvalue) {
if(rgbvalue.length < 3) {
throw new ArrayIndexOutOfBoundsException
Expand All @@ -107,6 +109,7 @@ public float[] fromRGB(float[] rgbvalue) {
return colorvalue;
}

@Override
public float[] toCIEXYZ(float[] colorvalue) {
if(colorvalue.length < getNumComponents()) {
throw new ArrayIndexOutOfBoundsException
Expand All @@ -121,6 +124,7 @@ public float[] toCIEXYZ(float[] colorvalue) {
return xyzvalue;
}

@Override
public float[] fromCIEXYZ(float[] xyzvalue) {
if(xyzvalue.length < 3) {
throw new ArrayIndexOutOfBoundsException
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -39,10 +39,12 @@ public InputStreamAdapter(ImageInputStream stream) {
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);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -58,14 +58,17 @@ private SimpleCMYKColorSpace() {
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];
Expand Down Expand Up @@ -97,6 +100,7 @@ public float[] toRGB(float[] colorvalue) {
return rgbvalue;
}

@Override
public float[] fromRGB(float[] rgbvalue) {
// Convert from sRGB to linear RGB.
for (int i = 0; i < 3; i++) {
Expand Down Expand Up @@ -128,10 +132,12 @@ public float[] fromRGB(float[] rgbvalue) {
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));
}
Expand Down
Loading