public class PngModule extends ModuleBase
| Modifier and Type | Field and Description |
|---|---|
protected Checksummer |
_ckSummer |
protected int |
_colorType |
protected ChecksumInputStream |
_cstream |
protected DataInputStream |
_dstream |
protected List<Property> |
_keywordPropList |
protected Property |
_metadata |
protected List<Property> |
_propList |
protected List<Property> |
_spltList |
_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, _wellFormedNoteMAXIMUM_VERBOSITY, MINIMUM_VERBOSITY| Constructor and Description |
|---|
PngModule()
Instantiate a PngModule object.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addKeyword(String keywd,
String val)
Add a keyword and value.
|
void |
addKeyword(String keywd,
String translatedKeywd,
String val,
String language)
Add a keyword, value, and language.
|
void |
addSplt(String name,
int sampleDepth,
int numSamples)
Add a suggested palette
|
void |
checkSignatures(File file,
InputStream stream,
RepInfo info)
Check if the digital object conforms to this Module's
internal signature information.
|
void |
eatChunk(PNGChunk chnk)
This lets the module skip over the remainder of a chunk, not
including the name, length,and CRC.
|
int |
getColorType()
Get the color type that was recorded from the IHDR chunk.
|
protected void |
initParse()
Initializes the state of the module for parsing.
|
boolean |
isChunkSeen(int chunkType) |
boolean |
isIdatFinished()
Return true if a non-IDAT chunk has been seen after an IDAT chunk
|
boolean |
isIdatSeen()
Return true if IDAT chunk has been seen
|
boolean |
isIhdrSeen()
Returns true if IHDR chunk has been seen
|
boolean |
isPlteSeen()
Return true if PLTE chunk has been seen
|
int |
parse(InputStream stream,
RepInfo info,
int parseIndex)
Parse the content of a purported JPEG stream digital object and store the
results in RepInfo.
|
void |
setChunkSeen(int chunkType) |
void |
setColorType(int ct)
Set the color type.
|
void |
setIdatSeen(boolean b)
Note that an IDAT chunk has been seen
|
void |
setIendSeen(boolean b)
Note that an IEND chunk has been seen
|
void |
setIhdrSeen(boolean b)
Note that an IHDR chunk has been seen
|
void |
setPlteSeen(boolean b)
Note that a PLTE chunk has been seen
|
addIntegerProperty, addIntegerProperty, applyDefaultParams, calcRAChecksum, 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, vectorToPropArrayprotected Checksummer _ckSummer
protected ChecksumInputStream _cstream
protected DataInputStream _dstream
protected Property _metadata
protected int _colorType
public void checkSignatures(File file, InputStream stream, RepInfo info) throws IOException
checkSignatures in interface ModulecheckSignatures in class ModuleBasefile - A RandomAccessFile, positioned at its beginning,
which is generated from the object to be parsedstream - An InputStream, positioned at its beginning,
which is generated from the object to be parsedinfo - A fresh RepInfo object which will be modified
to reflect the results of the testIOExceptionpublic int parse(InputStream stream, RepInfo info, int parseIndex) throws IOException
parse in interface Moduleparse in class ModuleBasestream - An InputStream, positioned at its beginning,
which is generated from the object to be parsedinfo - A fresh RepInfo object which will be modified
to reflect the results of the parsingparseIndex - Must be 0 in first call to parse. If
parse returns a nonzero value, it must be
called again with parseIndex
equal to that return value.IOExceptionpublic void eatChunk(PNGChunk chnk) throws IOException
IOExceptionpublic void addKeyword(String keywd, String val)
public void addKeyword(String keywd, String translatedKeywd, String val, String language)
public void addSplt(String name, int sampleDepth, int numSamples)
protected void initParse()
initParse in class ModuleBasepublic void setIhdrSeen(boolean b)
public boolean isIhdrSeen()
public void setIdatSeen(boolean b)
public void setPlteSeen(boolean b)
public void setIendSeen(boolean b)
public boolean isIdatSeen()
public boolean isIdatFinished()
public boolean isPlteSeen()
public void setChunkSeen(int chunkType)
public boolean isChunkSeen(int chunkType)
public void setColorType(int ct)
public int getColorType()
Copyright © 2008–2018 The Open Preservation Foundation. All rights reserved.