public abstract class MarkerSegment extends Object
Modifier and Type | Field and Description |
---|---|
protected ContCodestream |
_ccs |
protected Codestream |
_cs |
protected DataInputStream |
_dstream |
protected Jpeg2000Module |
_module |
protected RepInfo |
_repInfo |
protected static int |
COC |
protected static int |
COD |
protected static int |
COM |
protected static int |
CRG |
protected static int |
EOC |
protected static int |
EPH |
protected static int |
PLM |
protected static int |
PLT |
protected static int |
POC |
protected static int |
PPM |
protected static int |
PPT |
protected static int |
QCC |
protected static int |
QCD |
protected static int |
RGN |
protected static int |
SIZ |
protected static int |
SOC |
protected static int |
SOD |
protected static int |
SOP |
protected static int |
SOT |
protected static int |
TLM |
Constructor and Description |
---|
MarkerSegment()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected MainOrTile |
getMainOrTile()
Returns the MainOrTile object which is currently
applicable in the Contiguous Codestream.
|
boolean |
isMarker()
Returns
true if this segment is a Marker. |
protected static MarkerSegment |
markerSegmentMaker(int markerCode)
Static factory method for generating an object of the
appropriate subclass of MarkerSegment, based on the
marker code.
|
protected int |
nCompBytes()
Determines size of fields indexed by number of components.
|
protected abstract boolean |
process(int bytesToEat)
Process the marker or marker segment.
|
protected int |
readMarkLen()
Reads and returns the length field of the marker segment.
|
void |
setCodestream(Codestream cs)
Sets the Codestream object being built.
|
void |
setContCodestream(ContCodestream ccs)
Sets the Continuous Codestream from which this marker was
obtained.
|
void |
setDataInputStream(DataInputStream dstream)
Sets the DataInputStream over which this marker is being
read.
|
void |
setModule(Jpeg2000Module module)
Sets the Module under which all this is happening.
|
void |
setRepInfo(RepInfo repInfo)
Sets the RepInfo into which messages may be placed.
|
protected static final int SOC
protected static final int COD
protected static final int COC
protected static final int TLM
protected static final int PLM
protected static final int PLT
protected static final int QCD
protected static final int QCC
protected static final int RGN
protected static final int POC
protected static final int PPM
protected static final int PPT
protected static final int CRG
protected static final int COM
protected static final int SOT
protected static final int SOP
protected static final int EPH
protected static final int SOD
protected static final int EOC
protected static final int SIZ
protected ContCodestream _ccs
protected Codestream _cs
protected Jpeg2000Module _module
protected DataInputStream _dstream
protected RepInfo _repInfo
public MarkerSegment()
setContCodestream
,
setCodestream
, setModule
,
and setDataInputStream
must all be called as
part of the setup before process
is called.public void setContCodestream(ContCodestream ccs)
public void setCodestream(Codestream cs)
public void setModule(Jpeg2000Module module)
public void setDataInputStream(DataInputStream dstream)
public void setRepInfo(RepInfo repInfo)
public boolean isMarker()
true
if this segment is a Marker.
Will return false
unless overridden.protected static MarkerSegment markerSegmentMaker(int markerCode)
markerCode
- The 8-bit marker code (ignoring the FF).protected int readMarkLen() throws IOException
setModule
and setDataInputStream
must be called as
part of the setup before readMarkLen
is called.IOException
protected int nCompBytes()
protected MainOrTile getMainOrTile()
protected abstract boolean process(int bytesToEat) throws IOException
process
method must consume exactly the number
of bytes remaining in the marker segment; for a marker,
this number will always be 0.bytesToEat
- The number of bytes that must be consumed.
For a Marker, this number will always be 0.
If it is 0 for a MarkerSegment, the
number of bytes to consume is unknown.true
if segment is well-formed,
false
otherwise.IOException
Copyright © 2008–2017 The Open Preservation Foundation. All rights reserved.