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) |
abstract ChunkRaw |
createRawChunk()
Creates the physical chunk.
|
int |
getChunkGroup()
In which "chunkGroup" (see
ChunksList for 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()
ChunksList
for definition) this chunks instance was read or written.
-1 if not read or written (eg, queued)
public boolean hasPriority()
public void setPriority(boolean priority)
public abstract ChunkRaw createRawChunk()
protected abstract void parseFromRaw(ChunkRaw c)
protected abstract boolean allowsMultiple()
PngChunkMultiple
and PngChunkSingle
public ChunkRaw getRaw()
public int getLen()
ChunkRaw.len
public long getOffset()
ChunkRaw.getOffset()
public void invalidateRawData()
public abstract PngChunk.ChunkOrderingConstraint getOrderingConstraint()
Copyright © 2014. All rights reserved.