diff --git a/echosvg-codec/src/main/java/io/sf/carte/echosvg/ext/awt/image/codec/png/PNGImage.java b/echosvg-codec/src/main/java/io/sf/carte/echosvg/ext/awt/image/codec/png/PNGImage.java index eade9c889..3f7782c02 100644 --- a/echosvg-codec/src/main/java/io/sf/carte/echosvg/ext/awt/image/codec/png/PNGImage.java +++ b/echosvg-codec/src/main/java/io/sf/carte/echosvg/ext/awt/image/codec/png/PNGImage.java @@ -19,14 +19,11 @@ package io.sf.carte.echosvg.ext.awt.image.codec.png; import java.awt.Color; -import java.awt.Graphics2D; import java.awt.Point; import java.awt.Transparency; import java.awt.color.ColorSpace; import java.awt.color.ICC_ColorSpace; import java.awt.color.ICC_Profile; -import java.awt.geom.AffineTransform; -import java.awt.image.BufferedImage; import java.awt.image.ColorModel; import java.awt.image.ComponentColorModel; import java.awt.image.DataBuffer; @@ -48,7 +45,6 @@ import java.util.Collections; import java.util.Date; import java.util.GregorianCalendar; -import java.util.Hashtable; import java.util.List; import java.util.Locale; import java.util.TimeZone; @@ -1929,30 +1925,4 @@ private void decodeImage(boolean useInterlacing) { } } - /** - * Convert to a {@code BufferedImage}. - *

- * This method is experimental and could be removed without warning. - *

- * - * @return the {@code BufferedImage}. - */ - BufferedImage toBufferedImage() { - ColorModel cm = getColorModel(); - SampleModel sm = getSampleModel(); - - Point loc = new Point(getMinX(), getMinY()); - - WritableRaster raster = Raster.createWritableRaster(sm, loc); - Hashtable props = new Hashtable<>(properties); - - BufferedImage img = new BufferedImage(cm, raster, cm.isAlphaPremultiplied(), props); - - Graphics2D ig = img.createGraphics(); - ig.drawRenderedImage(this, new AffineTransform()); - ig.dispose(); - - return img; - } - } diff --git a/echosvg-codec/src/main/java/io/sf/carte/echosvg/ext/awt/image/codec/png/PNGImageDecoder.java b/echosvg-codec/src/main/java/io/sf/carte/echosvg/ext/awt/image/codec/png/PNGImageDecoder.java index afa0f46c1..5b8cd5369 100644 --- a/echosvg-codec/src/main/java/io/sf/carte/echosvg/ext/awt/image/codec/png/PNGImageDecoder.java +++ b/echosvg-codec/src/main/java/io/sf/carte/echosvg/ext/awt/image/codec/png/PNGImageDecoder.java @@ -18,7 +18,6 @@ */ package io.sf.carte.echosvg.ext.awt.image.codec.png; -import java.awt.image.BufferedImage; import java.awt.image.RenderedImage; import java.io.IOException; import java.io.InputStream; @@ -59,27 +58,4 @@ public RenderedImage decodeAsRenderedImage(int page) throws IOException { return new PNGImage(input, (PNGDecodeParam) param); } - /** - * Returns a BufferedImage that contains the decoded contents of - * the SeekableStream associated with this - * ImageDecoder. The given page of a multi-page image is decoded. - * Page numbering begins at zero. - *

- * This method is experimental and could be removed in the future. - *

- * - * @param page The page to be decoded. - * @throws IOException if the page does not exist. - */ - BufferedImage decodeAsBufferedImage(int page) throws IOException { - if (page != 0) { - throw new IOException(PropertyUtil.formatMessage("PNGImageDecoder.unknown.page", - new Object[] { page })); - } - - PNGImage png = new PNGImage(input, (PNGDecodeParam) param); - - return png.toBufferedImage(); - } - }