{
String name();
- V provide(double x, double y, double width, double height);
+ V provide(Rectangle rectangle);
}
diff --git a/png/src/main/java/module-info.java b/png/src/main/java/module-info.java
index f8156d2..62a6858 100644
--- a/png/src/main/java/module-info.java
+++ b/png/src/main/java/module-info.java
@@ -3,5 +3,5 @@ module org.xbib.graphics.png {
exports org.xbib.graphics.imageio.plugins.png.pngj;
exports org.xbib.graphics.imageio.plugins.png.pngj.chunks;
exports org.xbib.graphics.imageio.plugins.png.pngj.pixels;
- requires java.desktop;
+ requires transitive java.desktop;
}
diff --git a/png/src/main/java/org/xbib/graphics/imageio/plugins/png/ScanlineCursor.java b/png/src/main/java/org/xbib/graphics/imageio/plugins/png/ScanlineCursor.java
index c138bb6..861729f 100644
--- a/png/src/main/java/org/xbib/graphics/imageio/plugins/png/ScanlineCursor.java
+++ b/png/src/main/java/org/xbib/graphics/imageio/plugins/png/ScanlineCursor.java
@@ -6,7 +6,7 @@ import java.awt.image.Raster;
/**
* A helper class that supports the scanline provider in navigating the structure of a Java image.
*/
-final class ScanlineCursor {
+public final class ScanlineCursor {
final int scanlineStride;
diff --git a/png/src/main/java/org/xbib/graphics/imageio/plugins/png/pngj/ChunkReader.java b/png/src/main/java/org/xbib/graphics/imageio/plugins/png/pngj/ChunkReader.java
index 81b56c1..70c464a 100644
--- a/png/src/main/java/org/xbib/graphics/imageio/plugins/png/pngj/ChunkReader.java
+++ b/png/src/main/java/org/xbib/graphics/imageio/plugins/png/pngj/ChunkReader.java
@@ -6,12 +6,6 @@ import org.xbib.graphics.imageio.plugins.png.pngj.chunks.ChunkRaw;
* Parses a PNG chunk, consuming bytes in one of three modes:
* {@link ChunkReaderMode#BUFFER}, {@link ChunkReaderMode#PROCESS},
* {@link ChunkReaderMode#SKIP}.
- *
- * It calls {@link #chunkDone()} when done. Also calls
- * {@link #processData(byte[], int, int)} if PROCESS
mode. Apart
- * from thas, it's totally agnostic (it doesn't know about IDAT chunks, or PNG
- * general structure)
- *
* The object wraps a ChunkRaw instance (content allocated and filled
* only if BUFFER mode). It should be short lived (one instance created for each
* chunk, and discarded after reading), but the wrapped chunkRaw can be
diff --git a/png/src/main/java/org/xbib/graphics/imageio/plugins/png/pngj/PngWriter.java b/png/src/main/java/org/xbib/graphics/imageio/plugins/png/pngj/PngWriter.java
index 8da92d8..db1b0ab 100644
--- a/png/src/main/java/org/xbib/graphics/imageio/plugins/png/pngj/PngWriter.java
+++ b/png/src/main/java/org/xbib/graphics/imageio/plugins/png/pngj/PngWriter.java
@@ -36,24 +36,22 @@ public class PngWriter implements Closeable {
* Current chunk grounp, (0-6) already written or currently writing (this is
* advanced when just starting to write the new group, not when finalizing
* the previous)
- *
* see {@link ChunksList}
*/
protected int currentChunkGroup = -1;
- private final int passes = 1; // Some writes might require two passes (NOT USED STILL)
- private int currentpass = 0; // numbered from 1
+ private int currentpass = 0;
private boolean shouldCloseStream = true;
- private int idatMaxSize = 0; // 0=use default (PngIDatChunkOutputStream 64k)
- // private PngIDatChunkOutputStream datStream;
+ private int idatMaxSize = 0;
protected PixelsWriter pixelsWriter;
private final OutputStream os;
private ChunkPredicate copyFromPredicate = null;
+
private ChunksList copyFromList = null;
protected StringBuilder debuginfo = new StringBuilder();
@@ -64,8 +62,8 @@ public class PngWriter implements Closeable {
* Sets shouldCloseStream=true. For more info see
* {@link #PngWriter(OutputStream, ImageInfo)}
*
- * @param file
- * @param imgInfo
+ * @param file file
+ * @param imgInfo image info
* @param allowoverwrite If false and file exists, an {@link PngjOutputException} is
* thrown
*/
@@ -118,12 +116,11 @@ public class PngWriter implements Closeable {
if (currentChunkGroup >= ChunksList.CHUNK_GROUP_4_IDAT) {
return;
}
- int nw = 0;
currentChunkGroup = ChunksList.CHUNK_GROUP_1_AFTERIDHR;
queueChunksFromOther();
- nw = chunksList.writeChunks(os, currentChunkGroup);
+ int nw0 = chunksList.writeChunks(os, currentChunkGroup);
currentChunkGroup = ChunksList.CHUNK_GROUP_2_PLTE;
- nw = chunksList.writeChunks(os, currentChunkGroup);
+ int nw = chunksList.writeChunks(os, currentChunkGroup);
if (nw > 0 && imgInfo.greyscale) {
throw new PngjOutputException("cannot write palette for this format");
}
@@ -193,12 +190,9 @@ public class PngWriter implements Closeable {
/**
* Queues an ancillary chunk for writing.
- * If a "equivalent" chunk is already queued (see
- * {@link ChunkHelper#equivalent(PngChunk, PngChunk)), this overwrites it.
* The chunk will be written as late as possible, unless the priority is
* set.
- *
- * @param chunk
+ * @param chunk the chunk
*/
public void queueChunk(PngChunk chunk) {
for (PngChunk other : chunksList.getQueuedEquivalent(chunk)) {
@@ -344,8 +338,7 @@ public class PngWriter implements Closeable {
* This is kept for backwards compatibility, now the PixelsWriter object
* should be used for setting compression/filtering options
*
- * @param compLevel between 0 (no compression, max speed) and 9 (max compression)
- * @see PixelsWriter#setCompressionFactor(double)
+ * @param complevel between 0 (no compression, max speed) and 9 (max compression)
*/
public void setCompLevel(int complevel) {
pixelsWriter.setDeflaterCompLevel(complevel);
@@ -416,6 +409,8 @@ public class PngWriter implements Closeable {
if (rowNum == 0) {
currentpass++;
}
+ // Some writes might require two passes (NOT USED STILL)
+ int passes = 1;
if (rownumber == 0 && currentpass == passes) {
initIdat();
currentChunkGroup = ChunksList.CHUNK_GROUP_4_IDAT; // we just begin writing IDAT
@@ -440,14 +435,11 @@ public class PngWriter implements Closeable {
* This should be overriden if custom filtering strategies are desired.
* Remember to release this with close()
*
- * @param imginfo Might be different than that of this object (eg: APNG with
- * subimages)
- * @param os Output stream
+ * @param imginfo Might be different than that of this object (eg: APNG with subimages)
* @return new PixelsWriter. Don't forget to call close() when discarding it
*/
protected PixelsWriter createPixelsWriter(ImageInfo imginfo) {
- PixelsWriterDefault pw = new PixelsWriterDefault(imginfo);
- return pw;
+ return new PixelsWriterDefault(imginfo);
}
public final PixelsWriter getPixelsWriter() {
diff --git a/png/src/main/java/org/xbib/graphics/imageio/plugins/png/pngj/chunks/PngChunkBKGD.java b/png/src/main/java/org/xbib/graphics/imageio/plugins/png/pngj/chunks/PngChunkBKGD.java
index 14908c6..e8b0aed 100644
--- a/png/src/main/java/org/xbib/graphics/imageio/plugins/png/pngj/chunks/PngChunkBKGD.java
+++ b/png/src/main/java/org/xbib/graphics/imageio/plugins/png/pngj/chunks/PngChunkBKGD.java
@@ -5,11 +5,7 @@ import org.xbib.graphics.imageio.plugins.png.pngj.PngHelperInternal;
import org.xbib.graphics.imageio.plugins.png.pngj.PngjException;
/**
- * bKGD Chunk.
- *
- * see {@link http://www.w3.org/TR/PNG/#11bKGD}
- *
- * This chunk structure depends on the image type
+ * bKGD Chunk. This chunk structure depends on the image type.
*/
public class PngChunkBKGD extends PngChunkSingle {
public final static String ID = ChunkHelper.bKGD;
diff --git a/png/src/main/java/org/xbib/graphics/imageio/plugins/png/pngj/chunks/PngChunkICCP.java b/png/src/main/java/org/xbib/graphics/imageio/plugins/png/pngj/chunks/PngChunkICCP.java
index 24653b0..91bd456 100644
--- a/png/src/main/java/org/xbib/graphics/imageio/plugins/png/pngj/chunks/PngChunkICCP.java
+++ b/png/src/main/java/org/xbib/graphics/imageio/plugins/png/pngj/chunks/PngChunkICCP.java
@@ -5,8 +5,6 @@ import org.xbib.graphics.imageio.plugins.png.pngj.PngjException;
/**
* iCCP chunk.
- *
- * See {@link http://www.w3.org/TR/PNG/#11iCCP}
*/
public class PngChunkICCP extends PngChunkSingle {
public final static String ID = ChunkHelper.iCCP;