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 |
|---|---|
| public static enum | PngChunk.
Possible ordering constraint for a PngChunk type -only relevant for ancillary chunks. |
| Modifier and Type | Field and Description |
|---|---|
| protected int | |
| public final boolean | crit
Autocomputed at creation time |
| private static final Map | factoryMap
This static map defines which PngChunk class correspond to which ChunkID The client can add other chunks to this map statically, before reading an image, calling PngChunk.factoryRegister(id,class) |
| public final String | id
Chunk-id: 4 letters |
| protected final ImageInfo | |
| protected int | |
| protected long | |
| private boolean | |
| public final boolean | pub
Autocomputed at creation time |
| public final boolean | safe
Autocomputed at creation time |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public abstract boolean | |
| public static <T extends PngChunk> T | cloneChunk(final T chunk, final ImageInfo info)
Makes a clone (deep copy) calling |
| public abstract void | |
| protected final ChunkRaw | |
| public abstract ChunkRaw | |
| public static PngChunk | |
| public static PngChunk | factoryFromId(final String cid, final ImageInfo info)
Creates one new blank chunk of the corresponding type, according to factoryMap (PngChunkUNKNOWN if not known) |
| public static void | factoryRegister(final String chunkId, final Class<? extends PngChunk> chunkClass)
Registers a chunk-id (4 letters) to be associated with a PngChunk class This method should be called by user code that wants to add some chunks (not implmemented in this library) to the factory, so that the PngReader knows about it. |
| public final int | getChunkGroup()
In which "chunkGroup" (see |
| public int | |
| public long | |
| public abstract PngChunk. | |
| public boolean | |
| public static boolean | |
| public abstract void | |
| public final void | |
| public void | |
| public void | |
| public String | |
| pack-priv final void |
| chunkGroup | back to summary |
|---|---|
| protected int chunkGroup | |
| crit | back to summary |
|---|---|
| public final boolean crit Autocomputed at creation time | |
| factoryMap | back to summary |
|---|---|
| private static final Map<String, Class<? extends PngChunk>> factoryMap This static map defines which PngChunk class correspond to which ChunkID The client can add other chunks to this map statically, before reading an image, calling PngChunk.factoryRegister(id,class) | |
| id | back to summary |
|---|---|
| public final String id Chunk-id: 4 letters | |
| imgInfo | back to summary |
|---|---|
| protected final ImageInfo imgInfo | |
| length | back to summary |
|---|---|
| protected int length | |
| offset | back to summary |
|---|---|
| protected long offset | |
| priority | back to summary |
|---|---|
| private boolean priority | |
| pub | back to summary |
|---|---|
| public final boolean pub Autocomputed at creation time | |
| safe | back to summary |
|---|---|
| public final boolean safe Autocomputed at creation time | |
| PngChunk | back to summary |
|---|---|
| protected PngChunk(final String id, final ImageInfo imgInfo) | |
| allowsMultiple | back to summary |
|---|---|
| public abstract boolean allowsMultiple() | |
| cloneChunk | back to summary |
|---|---|
| public static <T extends PngChunk> T cloneChunk(final T chunk, final ImageInfo info) Makes a clone (deep copy) calling
| |
| cloneDataFromRead | back to summary |
|---|---|
| public abstract void cloneDataFromRead(PngChunk other) Makes a copy of the chunk. This is used when copying chunks from a reader to a writer It should normally be a deep copy, and after the cloning this.equals(other) should return true | |
| createEmptyChunk | back to summary |
|---|---|
| protected final ChunkRaw createEmptyChunk(final int len, final boolean alloc) | |
| createRawChunk | back to summary |
|---|---|
| public abstract ChunkRaw createRawChunk() Creates the physical chunk. This is used when writing (serialization). Each particular chunk class implements its own logic.
| |
| factory | back to summary |
|---|---|
| public static PngChunk factory(final ChunkRaw chunk, final ImageInfo info) This factory creates the corresponding chunk and parses the raw chunk. This is used when reading. | |
| factoryFromId | back to summary |
|---|---|
| public static PngChunk factoryFromId(final String cid, final ImageInfo info) Creates one new blank chunk of the corresponding type, according to factoryMap (PngChunkUNKNOWN if not known) | |
| factoryRegister | back to summary |
|---|---|
| public static void factoryRegister(final String chunkId, final Class<? extends PngChunk> chunkClass) Registers a chunk-id (4 letters) to be associated with a PngChunk class This method should be called by user code that wants to add some chunks (not implmemented in this library) to the factory, so that the PngReader knows about it. | |
| getChunkGroup | back to summary |
|---|---|
| public final int getChunkGroup() In which "chunkGroup" (see -1 if not read or written (eg, queued) | |
| getLength | back to summary |
|---|---|
| public int getLength() | |
| getOffset | back to summary |
|---|---|
| public long getOffset() | |
| getOrderingConstraint | back to summary |
|---|---|
| public abstract PngChunk. | |
| hasPriority | back to summary |
|---|---|
| public boolean hasPriority() | |
| isKnown | back to summary |
|---|---|
| public static boolean isKnown(final String id) True if the chunk-id type is known.
A chunk is known if we recognize its class, according with
This is not necessarily the same as being "STANDARD", or being implemented in this library
Unknown chunks will be parsed as instances of | |
| parseFromRaw | back to summary |
|---|---|
| public abstract void parseFromRaw(ChunkRaw c) Parses raw chunk and fill inside data. This is used when reading (deserialization). Each particular chunk class implements its own logic. | |
| setChunkGroup | back to summary |
|---|---|
public final void setChunkGroup(final int chunkGroup)
| |
| setOffset | back to summary |
|---|---|
| public void setOffset(final long offset) | |
| setPriority | back to summary |
|---|---|
| public void setPriority(final boolean priority) | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| write | back to summary |
|---|---|
| pack-priv final void write(final OutputStream os) | |
| Modifier and Type | Field and Description |
|---|---|
| public static final PngChunk. | AFTER_PLTE_BEFORE_IDAT
Must go after PLTE but before IDAT |
| public static final PngChunk. | BEFORE_IDAT
Must before IDAT (before or after PLTE) |
| public static final PngChunk. | BEFORE_PLTE_AND_IDAT
Must go before PLTE (and hence, also before IDAT) |
| public static final PngChunk. | NA
Does not apply |
| public static final PngChunk. | NONE
no ordering constraint |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | |
| public boolean | |
| public boolean | |
| public static PngChunk. | |
| public static PngChunk. |
| AFTER_PLTE_BEFORE_IDAT | back to summary |
|---|---|
| public static final PngChunk. Must go after PLTE but before IDAT | |
| BEFORE_IDAT | back to summary |
|---|---|
| public static final PngChunk. Must before IDAT (before or after PLTE) | |
| BEFORE_PLTE_AND_IDAT | back to summary |
|---|---|
| public static final PngChunk. Must go before PLTE (and hence, also before IDAT) | |
| NA | back to summary |
|---|---|
| public static final PngChunk. Does not apply | |
| NONE | back to summary |
|---|---|
| public static final PngChunk. no ordering constraint | |
| ChunkOrderingConstraint | back to summary |
|---|---|
| private ChunkOrderingConstraint() | |
| mustGoAfterPLTE | back to summary |
|---|---|
| public boolean mustGoAfterPLTE() | |
| mustGoBeforeIDAT | back to summary |
|---|---|
| public boolean mustGoBeforeIDAT() | |
| mustGoBeforePLTE | back to summary |
|---|---|
| public boolean mustGoBeforePLTE() | |
| valueOf | back to summary |
|---|---|
| public static PngChunk. | |
| values | back to summary |
|---|---|
| public static PngChunk. | |