Package com.drew.imaging.png
Class PngChunkType
- java.lang.Object
-
- com.drew.imaging.png.PngChunkType
-
public class PngChunkType extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private byte[]_bytesprivate static java.util.Set<java.lang.String>_identifiersAllowingMultiplesprivate boolean_multipleAllowedstatic PngChunkTypebKGDstatic PngChunkTypecHRMstatic PngChunkTypeeXIfstatic PngChunkTypegAMAstatic PngChunkTypehISTstatic PngChunkTypeiCCPstatic PngChunkTypeIDATstatic PngChunkTypeIENDstatic PngChunkTypeIHDRDenotes a criticalPngChunkthat contains basic information about the PNG image.static PngChunkTypeiTXtstatic PngChunkTypepHYsstatic PngChunkTypePLTEDenotes a criticalPngChunkthat contains palette entries.static PngChunkTypesBITstatic PngChunkTypesPLTstatic PngChunkTypesRGBstatic PngChunkTypetEXtDenotes an ancillaryPngChunkthat contains textual data, having first a keyword and then a value.static PngChunkTypetIMEstatic PngChunkTypetRNSstatic PngChunkTypezTXt
-
Constructor Summary
Constructors Constructor Description PngChunkType(byte[] bytes)PngChunkType(java.lang.String identifier)PngChunkType(java.lang.String identifier, boolean multipleAllowed)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanareMultipleAllowed()booleanequals(java.lang.Object o)java.lang.StringgetIdentifier()inthashCode()booleanisAncillary()booleanisCritical()private static booleanisLowerCase(byte b)booleanisPrivate()booleanisSafeToCopy()private static booleanisUpperCase(byte b)private static booleanisValidByte(byte b)java.lang.StringtoString()private static voidvalidateBytes(byte[] bytes)
-
-
-
Field Detail
-
_identifiersAllowingMultiples
private static final java.util.Set<java.lang.String> _identifiersAllowingMultiples
-
IHDR
public static final PngChunkType IHDR
Denotes a criticalPngChunkthat 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
PngColorTypeenum - 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 static final PngChunkType PLTE
Denotes a criticalPngChunkthat contains palette entries. This chunk should only appear for aPngColorTypeofIndexedColor, 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 static final PngChunkType IDAT
-
IEND
public static final PngChunkType IEND
-
cHRM
public static final PngChunkType cHRM
-
gAMA
public static final PngChunkType gAMA
-
iCCP
public static final PngChunkType iCCP
-
sBIT
public static final PngChunkType sBIT
-
sRGB
public static final PngChunkType sRGB
-
bKGD
public static final PngChunkType bKGD
-
hIST
public static final PngChunkType hIST
-
tRNS
public static final PngChunkType tRNS
-
pHYs
public static final PngChunkType pHYs
-
sPLT
public static final PngChunkType sPLT
-
tIME
public static final PngChunkType tIME
-
iTXt
public static final PngChunkType iTXt
-
eXIf
public static final PngChunkType eXIf
-
tEXt
public static final PngChunkType tEXt
Denotes an ancillaryPngChunkthat 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 static final PngChunkType zTXt
-
_bytes
private final byte[] _bytes
-
_multipleAllowed
private final boolean _multipleAllowed
-
-
Constructor Detail
-
PngChunkType
public PngChunkType(java.lang.String identifier) throws PngProcessingException- Throws:
PngProcessingException
-
PngChunkType
public PngChunkType(java.lang.String identifier, boolean multipleAllowed) throws PngProcessingException- Throws:
PngProcessingException
-
PngChunkType
public PngChunkType(byte[] bytes) throws PngProcessingException- Throws:
PngProcessingException
-
-
Method Detail
-
validateBytes
private static void validateBytes(byte[] bytes) throws PngProcessingException- Throws:
PngProcessingException
-
isCritical
public boolean isCritical()
-
isAncillary
public boolean isAncillary()
-
isPrivate
public boolean isPrivate()
-
isSafeToCopy
public boolean isSafeToCopy()
-
areMultipleAllowed
public boolean areMultipleAllowed()
-
isLowerCase
private static boolean isLowerCase(byte b)
-
isUpperCase
private static boolean isUpperCase(byte b)
-
isValidByte
private static boolean isValidByte(byte b)
-
getIdentifier
public java.lang.String getIdentifier()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-