public class IdatSet extends DeflatedChunksSet
It extends DeflatedChunksSet, adding the intelligence to unfilter rows, and to understand
row lenghts in terms of ImageInfo and (eventually) Deinterlacer
| Modifier and Type | Field and Description |
|---|---|
protected Deinterlacer |
deinterlacer |
protected int[] |
filterUseStat |
protected ImageInfo |
imgInfo |
protected byte[] |
rowUnfiltered |
protected byte[] |
rowUnfilteredPrev |
chunkid, row| Constructor and Description |
|---|
IdatSet(String id,
ImageInfo iminfo,
Deinterlacer deinterlacer) |
IdatSet(String id,
ImageInfo iminfo,
Deinterlacer deinterlacer,
Inflater inf,
byte[] buffer)
Special constructor with preallocated buffer.
|
| Modifier and Type | Method and Description |
|---|---|
int |
advanceToNextRow()
Signals that we are done with the previous row, begin reading the next one.
|
void |
close()
This should be called when discarding this object, or for aborting.
|
Deinterlacer |
getDeinterlacer() |
int[] |
getFilterUseStat()
Only for debug/stats
|
byte[] |
getUnfilteredRow()
Unfiltered row.
|
boolean |
isRowReady()
In this state, the object is waiting the caller to retrieve inflated data
|
protected void |
preProcessRow()
does the unfiltering of the inflated row, and updates row info
|
protected void |
processDoneCallback()
Callback, to be implemented in callbackMode
|
protected int |
processRowCallback()
Method for async/callback mode .
|
void |
unfilterRow()
Applies PNG un-filter to inflated raw line.
|
protected void |
unfilterRow(int nbytes) |
ackNextChunkId, allowOtherChunksInBetween, appendNewChunk, done, getBytesIn, getBytesOut, getInflatedRow, getRowFilled, getRowLen, getRown, isCallbackMode, isDone, isTerminated, isWaitingForMoreInput, prepareForNextRow, processBytes, setCallbackMode, terminate, toStringprotected byte[] rowUnfiltered
protected byte[] rowUnfilteredPrev
protected final ImageInfo imgInfo
protected final Deinterlacer deinterlacer
protected int[] filterUseStat
public IdatSet(String id, ImageInfo iminfo, Deinterlacer deinterlacer)
id - Chunk id (first chunk), should be shared by all concatenated chunksiminfo - Image infodeinterlacer - Not null if interlacedpublic IdatSet(String id, ImageInfo iminfo, Deinterlacer deinterlacer, Inflater inf, byte[] buffer)
Same as IdatSet(String, ImageInfo, Deinterlacer), but you can pass a Inflater (will be
reset internally), and a buffer (will be used only if size is enough)
public void unfilterRow()
getUnfilteredRow()
DeflatedChunksSet.getRowLen()protected void unfilterRow(int nbytes)
protected void preProcessRow()
preProcessRow in class DeflatedChunksSetprotected int processRowCallback()
In callback mode will be called as soon as each row is retrieved (inflated and unfiltered),
after preProcessRow()
This is a dummy implementation that does nothing.
The return value is essential
processRowCallback in class DeflatedChunksSetprotected void processDoneCallback()
DeflatedChunksSetThis will be called once to notify state done
processDoneCallback in class DeflatedChunksSetpublic int advanceToNextRow()
In polled mode, calls setNextRowLen()
Warning: after calling this, the unfilterRow is invalid!
public boolean isRowReady()
DeflatedChunksSet
Effective length: see DeflatedChunksSet.getRowFilled()
isRowReady in class DeflatedChunksSetpublic byte[] getUnfilteredRow()
This should be called only if isRowReady() returns true.
To get real length, use DeflatedChunksSet.getRowLen()
public Deinterlacer getDeinterlacer()
public void close()
DeflatedChunksSetDeflatedChunksSet.done()close in class DeflatedChunksSetpublic int[] getFilterUseStat()
Copyright © 2014. All rights reserved.