public class Jpeg2000Module extends ModuleBase
Modifier and Type | Field and Description |
---|---|
protected NisoImageMetadata |
_defaultNiso |
protected java.io.DataInputStream |
_dstream |
protected NisoImageMetadata |
_niso
PRIVATE INSTANCE FIELDS.
|
protected java.util.List<Property> |
_propList |
protected java.io.RandomAccessFile |
_raf |
protected RAFInputStream |
_rafStream |
protected java.util.List<Property> |
associationProps |
protected java.util.List<Property> |
binaryFilterProps |
protected java.util.List<Codestream> |
codestreams |
protected java.util.List<Property> |
colorSpecs |
protected boolean |
colorSpecSeen |
protected java.util.List<Property> |
composLayers |
protected Codestream |
curCodestream |
protected java.util.List<Property> |
digitalSigProps |
protected boolean |
filterMode |
protected boolean |
imageHeaderSeen |
protected boolean |
jp2Compliant |
protected boolean |
jp2HdrSeen |
protected boolean |
jpxCompliant |
protected int |
nCodestreamHeaders |
protected int |
nCodestreams |
protected boolean |
rreqSeen |
protected java.util.List<Property> |
uuidInfos |
protected java.util.List<Property> |
uuids |
protected java.util.List<java.lang.String> |
xmlList |
_app, _bigEndian, _checksumFinished, _countStream, _coverage, _crc32, _date, _defaultParams, _features, _format, _init, _isRandomAccess, _je, _logger, _md5, _mimeType, _name, _nByte, _note, _param, _release, _repInfoNote, _rights, _sha1, _signature, _specification, _validityNote, _vendor, _verbosity, _wellFormedNote
MAXIMUM_VERBOSITY, MINIMUM_VERBOSITY
Constructor and Description |
---|
Jpeg2000Module()
Instantiate a JpegModule object.
|
Modifier and Type | Method and Description |
---|---|
void |
addAssociationProp(Property p)
Adds an association property to the metadata.
|
void |
addBinaryFilterProp(Property p)
Adds a binary filter property to the metadata.
|
void |
addColorSpec(Property p)
Adds a color spec property to the metadata.
|
void |
addComposLayer(Property p)
Adds a Compositing Layer property to the list
of Compositing Layer properties.
|
void |
addDigitalSignatureProp(Property p)
Adds a digital signature property to the metadata.
|
void |
addProperty(Property p)
Adds a property to the JPEG2000 metadata.
|
void |
addUUID(Property p)
Adds a UUID property to the list of UUID
properties.
|
void |
addUUIDInfo(Property p)
Adds a UUIDInfo property to the list of UUIDInfo
properties.
|
void |
addXML(java.lang.String s)
Adds an XML string to the list of XML properties.
|
Codestream |
getCodestream(int n)
Returns the nth
Codestream , creating it if necessary,
and make it the current one. |
NisoImageMetadata |
getCurrentNiso()
Returns the current NisoImageMetadata object.
|
NisoImageMetadata |
getDefaultNiso()
Returns the default NisoImageMetadata object.
|
long |
getFilePos()
Return the current position in the module.
|
int |
getNCodestreamHeaders()
Returns the codestream header count.
|
int |
getNCodestreams()
Returns the codestream count.
|
protected void |
initParse()
Initializes the state of the module for parsing.
|
boolean |
isJP2HdrSeen() |
void |
parse(java.io.RandomAccessFile raf,
RepInfo info)
Parse the content of a stream digital object and store the
results in RepInfo.
|
java.lang.String |
read4Chars(java.io.DataInputStream stream)
Reads 4 bytes and concatenates them into a String.
|
protected boolean |
readBoxes(RepInfo info) |
protected boolean |
readFileTypeBox(RepInfo info) |
long |
readSignedLong(java.io.DataInputStream stream)
One-argument version of
readSignedLong . |
long |
readUnsignedInt(java.io.DataInputStream stream)
One-argument version of
readUnsignedInt . |
int |
readUnsignedShort(java.io.DataInputStream stream)
One-argument version of
readUnsignedShort . |
void |
seek(long pos)
Seek to a new file position.
|
void |
setColorSpecSeen(boolean b)
Set the flag indicating the color specification box
has been seen.
|
void |
setImageHeaderSeen(boolean b)
Set the flag indicating the color specification box
has been seen.
|
void |
setJP2Compliant(boolean b)
Sets a flag indicating JP2 compliance.
|
void |
setJP2HdrSeen(boolean b)
Set the flag indicating that a JP2 header
has been seen.
|
void |
setJPXCompliant(boolean b)
Sets a flag indicating JPX compliance.
|
void |
setNCodestreamHeaders(int n)
Sets the codestream header count.
|
void |
setNCodestreams(int n)
Sets the codestream count.
|
void |
setRReqSeen(boolean b)
Set the flag indicating the reader requirements box
has been seen.
|
protected boolean |
skipOverBox(BoxHeader hdr,
RepInfo info,
java.io.DataInputStream dstrm) |
addIntegerProperty, addIntegerProperty, applyDefaultParams, calcRAChecksum, checkSignatures, checkSignatures, getApp, getBase, getBufferedDataStream, getCoverage, getCRC32, getDate, getDefaultParams, getFeatures, getFormat, getMimeType, getName, getNByte, getNote, getRelease, getRepInfoNote, getRights, getSignature, getSpecification, getValidityNote, getVendor, getWellFormedNote, hasFeature, init, initFeatures, isBigEndian, isRandomAccess, param, parse, readByteBuf, readDouble, readDouble, readDouble, readFloat, readFloat, readSignedByte, readSignedByte, readSignedByte, readSignedInt, readSignedInt, readSignedInt, readSignedLong, readSignedRational, readSignedRational, readSignedShort, readSignedShort, readSignedShort, readUnsignedByte, readUnsignedByte, readUnsignedByte, readUnsignedInt, readUnsignedInt, readUnsignedInt, readUnsignedRational, readUnsignedRational, readUnsignedRational, readUnsignedShort, readUnsignedShort, readUnsignedShort, resetParams, setApp, setBase, setChecksums, setCRC32, setDefaultParams, setMD5, setNByte, setSHA1, setValidityNote, setVerbosity, show, skipBytes, skipBytes, vectorToPropArray
protected NisoImageMetadata _niso
protected NisoImageMetadata _defaultNiso
protected java.io.DataInputStream _dstream
protected java.io.RandomAccessFile _raf
protected RAFInputStream _rafStream
protected java.util.List<Property> _propList
protected java.util.List<Codestream> codestreams
protected java.util.List<Property> binaryFilterProps
protected java.util.List<Property> associationProps
protected java.util.List<Property> digitalSigProps
protected int nCodestreams
protected int nCodestreamHeaders
protected java.util.List<Property> colorSpecs
protected java.util.List<Property> uuids
protected java.util.List<Property> composLayers
protected java.util.List<Property> uuidInfos
protected java.util.List<java.lang.String> xmlList
protected boolean jp2HdrSeen
protected boolean rreqSeen
protected boolean colorSpecSeen
protected boolean imageHeaderSeen
protected boolean jp2Compliant
protected boolean jpxCompliant
protected Codestream curCodestream
protected boolean filterMode
public final void parse(java.io.RandomAccessFile raf, RepInfo info) throws java.io.IOException
counted
argment to all read calls, so that we can compute relative
positions in the stream based on _nByte.parse
in interface Module
parse
in class ModuleBase
raf
- A RandomAccessFile to be parsed.info
- A fresh (on the first call) RepInfo object
which will be modified
to reflect the results of the parsing
If multiple calls to parse
are made
on the basis of a nonzero value being returned,
the same RepInfo object should be passed with each
call.java.io.IOException
public long getFilePos()
public void seek(long pos) throws java.io.IOException
java.io.IOException
public NisoImageMetadata getDefaultNiso()
public NisoImageMetadata getCurrentNiso()
public Codestream getCodestream(int n)
Codestream
, creating it if necessary,
and make it the current one. The value of nCodestreams
or nCodestreamHeaders
is not affected, even if a new Codestream
is created.public int getNCodestreams()
public int getNCodestreamHeaders()
public boolean isJP2HdrSeen()
public void setNCodestreams(int n)
public void setNCodestreamHeaders(int n)
public void setJP2HdrSeen(boolean b)
public void setRReqSeen(boolean b)
public void setColorSpecSeen(boolean b)
public void setImageHeaderSeen(boolean b)
public void setJP2Compliant(boolean b)
true
, and the JPX
compliance flag is also true, set the MIME type
to "image/jpx".public void setJPXCompliant(boolean b)
public void addProperty(Property p)
public void addColorSpec(Property p)
public void addBinaryFilterProp(Property p)
public void addAssociationProp(Property p)
public void addDigitalSignatureProp(Property p)
public void addUUID(Property p)
public void addUUIDInfo(Property p)
public void addComposLayer(Property p)
public void addXML(java.lang.String s)
public java.lang.String read4Chars(java.io.DataInputStream stream) throws java.io.IOException
java.io.IOException
public int readUnsignedShort(java.io.DataInputStream stream) throws java.io.IOException
readUnsignedShort
.
JPEG2000 is always big-endian, so readUnsignedShort can
unambiguously drop its endian argument.java.io.IOException
public long readUnsignedInt(java.io.DataInputStream stream) throws java.io.IOException
readUnsignedInt
.
JPEG2000 is always big-endian, so readUnsignedInt can
unambiguously drop its endian argument.java.io.IOException
public long readSignedLong(java.io.DataInputStream stream) throws java.io.IOException
readSignedLong
.
JPEG2000 is always big-endian, so readSignedLong can
unambiguously drop its endian argument.java.io.IOException
protected void initParse()
initParse
in class ModuleBase
protected boolean readBoxes(RepInfo info) throws java.io.IOException
java.io.IOException
protected boolean readFileTypeBox(RepInfo info) throws java.io.IOException
java.io.IOException