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()
See
PngChunkMultiple and PngChunkSingle |
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() |
void |
invalidateRawData()
This signals that the raw chunk (serialized data) as invalid, so that it's regenerated on
write.
|
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 boolean allowsMultiple()
PngChunkMultiple and PngChunkSinglepublic ChunkRaw getRaw()
public int getLen()
ChunkRaw.lenpublic long getOffset()
ChunkRaw.getOffset()public void invalidateRawData()
public abstract PngChunk.ChunkOrderingConstraint getOrderingConstraint()
Copyright © 2014. All rights reserved.