Package gov.nih.mipav.model.file
Class MetadataExtractor.PngChunkType
- java.lang.Object
-
- gov.nih.mipav.model.file.MetadataExtractor.PngChunkType
-
- Enclosing class:
- MetadataExtractor
public class MetadataExtractor.PngChunkType extends java.lang.Object
- Author:
- Drew Noakes https://drewnoakes.com
-
-
Field Summary
-
Constructor Summary
Constructors Constructor Description PngChunkType(byte[] bytes)
PngChunkType(java.lang.String identifier)
PngChunkType(java.lang.String identifier, boolean multipleAllowed)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
areMultipleAllowed()
boolean
equals(java.lang.Object o)
java.lang.String
getIdentifier()
int
hashCode()
boolean
isAncillary()
boolean
isCritical()
private boolean
isLowerCase(byte b)
boolean
isPrivate()
boolean
isSafeToCopy()
private boolean
isUpperCase(byte b)
private boolean
isValidByte(byte b)
java.lang.String
toString()
private void
validateBytes(byte[] bytes)
-
-
-
Field Detail
-
_identifiersAllowingMultiples
private final java.util.Set<java.lang.String> _identifiersAllowingMultiples
-
IHDR
public MetadataExtractor.PngChunkType IHDR
Denotes a criticalMetadataExtractor.PngChunk
that contains basic information about the PNG image. This must be the first chunk in the data sequence, and may only occur once.The format is:
- pixel width 4 bytes, unsigned and greater than zero
- pixel height 4 bytes, unsigned and greater than zero
- bit depth 1 byte, number of bits per sample or per palette index (not per pixel)
- color type 1 byte, maps to
MetadataExtractor.PngColorType
enum - compression method 1 byte, currently only a value of zero (deflate/inflate) is in the standard
- filter method 1 byte, currently only a value of zero (adaptive filtering with five basic filter types) is in the standard
- interlace method 1 byte, indicates the transmission order of image data, currently only 0 (no interlace) and 1 (Adam7 interlace) are in the standard
-
PLTE
public MetadataExtractor.PngChunkType PLTE
Denotes a criticalMetadataExtractor.PngChunk
that contains palette entries. This chunk should only appear for aMetadataExtractor.PngColorType
ofIndexedColor
, and may only occur once in the PNG data sequence.The chunk contains between one and 256 entries, each of three bytes:
- red 1 byte
- green 1 byte
- blue 1 byte
-
IDAT
public MetadataExtractor.PngChunkType IDAT
-
IEND
public MetadataExtractor.PngChunkType IEND
-
cHRM
public MetadataExtractor.PngChunkType cHRM
-
gAMA
public MetadataExtractor.PngChunkType gAMA
-
iCCP
public MetadataExtractor.PngChunkType iCCP
-
sBIT
public MetadataExtractor.PngChunkType sBIT
-
sRGB
public MetadataExtractor.PngChunkType sRGB
-
bKGD
public MetadataExtractor.PngChunkType bKGD
-
hIST
public MetadataExtractor.PngChunkType hIST
-
tRNS
public MetadataExtractor.PngChunkType tRNS
-
pHYs
public MetadataExtractor.PngChunkType pHYs
-
sPLT
public MetadataExtractor.PngChunkType sPLT
-
tIME
public MetadataExtractor.PngChunkType tIME
-
iTXt
public MetadataExtractor.PngChunkType iTXt
-
eXIf
public MetadataExtractor.PngChunkType eXIf
-
tEXt
public MetadataExtractor.PngChunkType tEXt
Denotes an ancillaryMetadataExtractor.PngChunk
that contains textual data, having first a keyword and then a value. If multiple text data keywords are needed, then multiple chunks are included in the PNG data stream.The format is:
- keyword 1-79 bytes
- null separator 1 byte (\0)
- text string 0 or more bytes
-
zTXt
public MetadataExtractor.PngChunkType zTXt
-
_bytes
private final byte[] _bytes
-
_multipleAllowed
private final boolean _multipleAllowed
-
-
Constructor Detail
-
PngChunkType
public PngChunkType(java.lang.String identifier) throws MetadataExtractor.PngProcessingException
-
PngChunkType
public PngChunkType(java.lang.String identifier, boolean multipleAllowed) throws MetadataExtractor.PngProcessingException
-
PngChunkType
public PngChunkType(byte[] bytes) throws MetadataExtractor.PngProcessingException
-
-
Method Detail
-
validateBytes
private void validateBytes(byte[] bytes) throws MetadataExtractor.PngProcessingException
-
isCritical
public boolean isCritical()
-
isAncillary
public boolean isAncillary()
-
isPrivate
public boolean isPrivate()
-
isSafeToCopy
public boolean isSafeToCopy()
-
areMultipleAllowed
public boolean areMultipleAllowed()
-
isLowerCase
private boolean isLowerCase(byte b)
-
isUpperCase
private boolean isUpperCase(byte b)
-
isValidByte
private boolean isValidByte(byte b)
-
getIdentifier
public java.lang.String getIdentifier()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-