public abstract class PngChunk extends Object
See http://www .libpng.org/pub/png/spec/1.2/PNG-Chunks .html
Concrete classes should extend PngChunkSingle or
PngChunkMultiple
Note that some methods/fields are type-specific (getOrderingConstraint(),
allowsMultiple()),
some are 'almost' type-specific (id,crit,pub,safe; the exception is
PngUKNOWN),
and the rest are instance-specific
| Modifier and Type | Class and Description |
|---|---|
static class |
PngChunk.ChunkOrderingConstraint
Possible ordering constraint for a PngChunk type -only relevant for
ancillary chunks.
|
| Modifier and Type | Field and Description |
|---|---|
protected int |
chunkGroup |
boolean |
crit
Autocomputed at creation time
|
String |
id
Chunk-id: 4 letters
|
protected ImageInfo |
imgInfo |
boolean |
pub
Autocomputed at creation time
|
protected ChunkRaw |
raw |
boolean |
safe
Autocomputed at creation time
|
| Modifier and Type | Method and Description |
|---|---|
protected abstract boolean |
allowsMultiple() |
protected abstract PngChunk |
cloneForWrite(ImageInfo imgInfo)
Makes a copy of the chunk.
|
protected ChunkRaw |
createEmptyChunk(int len,
boolean alloc) |
protected abstract ChunkRaw |
createRawChunk()
Creates the physical chunk.
|
int |
getChunkGroup()
In which "chunkGroup" (see
ChunksListfor definition) this chunks
instance was read or written. |
int |
getLen() |
long |
getOffset() |
abstract PngChunk.ChunkOrderingConstraint |
getOrderingConstraint()
|
ChunkRaw |
getRaw() |
boolean |
hasPriority() |
protected abstract void |
parseFromRaw(ChunkRaw c)
Parses raw chunk and fill inside data.
|
void |
setPriority(boolean priority) |
String |
toString() |
public final String id
public final boolean crit
public final boolean pub
public final boolean safe
protected final ImageInfo imgInfo
protected ChunkRaw raw
protected int chunkGroup
protected final ChunkRaw createEmptyChunk(int len, boolean alloc)
public final int getChunkGroup()
ChunksListfor definition) this chunks
instance was read or written.
-1 if not read or written (eg, queued)
public boolean hasPriority()
public void setPriority(boolean priority)
protected abstract ChunkRaw createRawChunk()
protected abstract void parseFromRaw(ChunkRaw c)
protected abstract PngChunk cloneForWrite(ImageInfo imgInfo)
This is used when copying chunks from a reader to a writer
This is usually a (shallow) copy, and after the cloning this.equals(other) should return true
protected abstract boolean allowsMultiple()
public ChunkRaw getRaw()
public int getLen()
public long getOffset()
public abstract PngChunk.ChunkOrderingConstraint getOrderingConstraint()
Copyright © 2013. All rights reserved.