public class Jpeg2000Module extends ModuleBase
Modifier and Type | Field and Description |
---|---|
protected NisoImageMetadata |
_defaultNiso |
protected DataInputStream |
_dstream |
protected NisoImageMetadata |
_niso
PRIVATE INSTANCE FIELDS.
|
protected List<Property> |
_propList |
protected RandomAccessFile |
_raf |
protected RAFInputStream |
_rafStream |
protected List<Property> |
associationProps |
protected List<Property> |
binaryFilterProps |
protected List<Codestream> |
codestreams |
protected List<Property> |
colorSpecs |
protected boolean |
colorSpecSeen |
protected List<Property> |
composLayers |
protected Codestream |
curCodestream |
protected 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 List<Property> |
uuidInfos |
protected List<Property> |
uuids |
protected List<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(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(RandomAccessFile raf,
RepInfo info)
Parse the content of a stream digital object and store the results in
RepInfo.
|
String |
read4Chars(DataInputStream stream)
Reads 4 bytes and concatenates them into a String.
|
protected boolean |
readBoxes(RepInfo info) |
protected boolean |
readFileTypeBox(RepInfo info) |
long |
readSignedLong(DataInputStream stream)
One-argument version of
readSignedLong . |
long |
readUnsignedInt(DataInputStream stream)
One-argument version of
readUnsignedInt . |
int |
readUnsignedShort(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,
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 DataInputStream _dstream
protected RandomAccessFile _raf
protected RAFInputStream _rafStream
protected List<Codestream> codestreams
protected int nCodestreams
protected int nCodestreamHeaders
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(RandomAccessFile raf, RepInfo info) throws 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.IOException
public long getFilePos()
public void seek(long pos) throws IOException
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(String s)
public String read4Chars(DataInputStream stream) throws IOException
IOException
public int readUnsignedShort(DataInputStream stream) throws IOException
readUnsignedShort
. JPEG2000 is
always big-endian, so readUnsignedShort can unambiguously drop its endian
argument.IOException
public long readUnsignedInt(DataInputStream stream) throws IOException
readUnsignedInt
. JPEG2000 is always
big-endian, so readUnsignedInt can unambiguously drop its endian
argument.IOException
public long readSignedLong(DataInputStream stream) throws IOException
readSignedLong
. JPEG2000 is always
big-endian, so readSignedLong can unambiguously drop its endian argument.IOException
protected void initParse()
initParse
in class ModuleBase
protected boolean readBoxes(RepInfo info) throws IOException
IOException
protected boolean readFileTypeBox(RepInfo info) throws IOException
IOException
protected boolean skipOverBox(BoxHeader hdr, RepInfo info, DataInputStream dstrm) throws IOException
IOException
Copyright © 2008–2017 The Open Preservation Foundation. All rights reserved.