Package com.sixlegs.png
Class PngConstants
java.lang.Object
com.sixlegs.png.PngConstants
This interface defines all registered chunk types and provides methods
helper methods to examine them. It also defines all of the keys used in the property map
of a decoded
PngImage, and applicable enumerated values.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringbKGD: Background samplesstatic final StringIHDR: Bit depthstatic final intBackground colorstatic final intPrimary chromaticitiesstatic final StringcHRM: Chromaticitystatic final StringIHDR: Color typestatic final intIHDR: Grayscale color typestatic final intIHDR: Grayscale+alpha color typestatic final intIHDR: Palette color typestatic final intIHDR: RGB color typestatic final intIHDR: RGBA color typestatic final StringIHDR: Compression methodstatic final intIHDR: Deflate/inflate compressionstatic final StringIHDR: Filter methodstatic final intIHDR: Adaptive filteringstatic final intImage gammastatic final StringgAMA: Gammastatic final StringgIFg: GIF delay time (hundredths of a second)static final StringgIFg: GIF disposal methodstatic final StringgIFg: GIF user input flagstatic final intGIF Graphic Control Extensionstatic final intGIF Application Extensionstatic final StringIHDR: Heightstatic final intPalette histogramstatic final StringhIST: Palette histogramstatic final StringiCCP: ICC profilestatic final StringiCCP: ICC profile namestatic final intEmbedded ICC profilestatic final intImage datastatic final intImage trailerstatic final intImage headerstatic final StringIHDR: Interlace methodstatic final intIHDR: Adam7 interlacestatic final intIHDR: No interlacestatic final intInternational textual datastatic final intImage offsetstatic final StringPLTE: Palette entriesstatic final StringPLTE: Palette alphastatic final intCalibration of pixel valuesstatic final intPhysical pixel dimensionsstatic final StringsCAL: Physical height of pixelstatic final StringsCAL: Physical width of pixelstatic final StringpHYs: Pixels per unit, X axisstatic final StringpHYs: Pixels per unit, Y axisstatic final intPalettestatic final StringoFFs: Unit for image offsetstatic final intoFFs: Unit is the micrometer (10^-6 meter)static final intoFFs: Unit is the pixel (true dimensions unspecified)static final StringoFFs: Image X positionstatic final StringoFFs: Image Y positionstatic final StringsRGB: Rendering intentstatic final intSignificant bitsstatic final intPhysical scale of image subjectstatic final StringsCAL: Unit for physical scale of image subjectstatic final intsCAL: Unit is the meterstatic final intsCAL: Unit is the radianstatic final longEight byte magic number that begins all PNG imagesstatic final StringsBIT: Significant bitsstatic final intSuggested palettestatic final intStandard RGB color spacestatic final intsRGB: Absolute colormetric rendering intentstatic final intsRGB: Perceptual rendering intentstatic final intsRGB: Relative colorimetric rendering intentstatic final intsRGB: Saturation rendering intentstatic final intIndicator of Stereo Imagestatic final StringsTER: Indicator of stereo imagestatic final intsTER: Cross-fuse layoutstatic final intsTER: Diverging-fuse layoutstatic final StringsPLT: List of suggested palettesstatic final intTextual datastatic final Stringstatic final intImage last-modification timestatic final StringtIME: Image last-modification timestatic final StringtRNS: Transparency samplesstatic final intTransparencystatic final StringpHYs: Unit specifierstatic final intpHYs: Unit is the meterstatic final intpHYs: Unit is unknownstatic final StringIHDR: Widthstatic final intCompressed textual data -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetChunkName(int chunkType) Returns the four-character ASCII name corresponding to the given chunk type.static intgetChunkType(String chunkName) Returns the chunk type corresponding to the given four-character ASCII chunk name.static booleanisAncillary(int chunkType) Returnstrueif the given chunk type has the ancillary bit set (the first letter is lowercase).static booleanisPrivate(int chunkType) Returnstrueif the given chunk type has the private bit set (the second letter is lowercase).static booleanisReserved(int chunkType) Returnstrueif the given chunk type has the reserved bit set (the third letter is lowercase).static booleanisSafeToCopy(int chunkType) Returnstrueif the given chunk type has the safe-to-copy bit set (the fourth letter is lowercase).
-
Field Details
-
SIGNATURE
public static final long SIGNATUREEight byte magic number that begins all PNG images- See Also:
-
IHDR
public static final int IHDRImage header- See Also:
-
PLTE
public static final int PLTEPalette- See Also:
-
IDAT
public static final int IDATImage data- See Also:
-
IEND
public static final int IENDImage trailer- See Also:
-
bKGD
public static final int bKGDBackground color- See Also:
-
cHRM
public static final int cHRMPrimary chromaticities- See Also:
-
gAMA
public static final int gAMAImage gamma- See Also:
-
hIST
public static final int hISTPalette histogram- See Also:
-
iCCP
public static final int iCCPEmbedded ICC profile- See Also:
-
iTXt
public static final int iTXtInternational textual data- See Also:
-
pHYs
public static final int pHYsPhysical pixel dimensions- See Also:
-
sBIT
public static final int sBITSignificant bits- See Also:
-
sPLT
public static final int sPLTSuggested palette- See Also:
-
sRGB
public static final int sRGBStandard RGB color space- See Also:
-
tEXt
public static final int tEXtTextual data- See Also:
-
tIME
public static final int tIMEImage last-modification time- See Also:
-
tRNS
public static final int tRNSTransparency- See Also:
-
zTXt
public static final int zTXtCompressed textual data- See Also:
-
oFFs
public static final int oFFsImage offset- See Also:
-
pCAL
public static final int pCALCalibration of pixel values- See Also:
-
sCAL
public static final int sCALPhysical scale of image subject- See Also:
-
gIFg
public static final int gIFgGIF Graphic Control Extension- See Also:
-
gIFx
public static final int gIFxGIF Application Extension- See Also:
-
sTER
public static final int sTERIndicator of Stereo Image- See Also:
-
BIT_DEPTH
IHDR: Bit depth- See Also:
-
COLOR_TYPE
IHDR: Color type- See Also:
-
COMPRESSION
IHDR: Compression method- See Also:
-
FILTER
IHDR: Filter method- See Also:
-
GAMMA
gAMA: Gamma- See Also:
-
WIDTH
IHDR: Width- See Also:
-
HEIGHT
IHDR: Height- See Also:
-
INTERLACE
IHDR: Interlace method- See Also:
-
PALETTE
PLTE: Palette entries- See Also:
-
PALETTE_ALPHA
PLTE: Palette alpha- See Also:
-
TRANSPARENCY
tRNS: Transparency samples- See Also:
-
BACKGROUND
bKGD: Background samples- See Also:
-
PIXELS_PER_UNIT_X
pHYs: Pixels per unit, X axis- See Also:
-
PIXELS_PER_UNIT_Y
pHYs: Pixels per unit, Y axis- See Also:
-
RENDERING_INTENT
sRGB: Rendering intent- See Also:
-
SIGNIFICANT_BITS
sBIT: Significant bits- See Also:
-
TEXT_CHUNKS
- See Also:
-
TIME
tIME: Image last-modification time- See Also:
-
UNIT
pHYs: Unit specifier- See Also:
-
CHROMATICITY
cHRM: Chromaticity- See Also:
-
ICC_PROFILE
iCCP: ICC profile- See Also:
-
ICC_PROFILE_NAME
iCCP: ICC profile name- See Also:
-
HISTOGRAM
hIST: Palette histogram- See Also:
-
SUGGESTED_PALETTES
sPLT: List of suggested palettes- See Also:
-
GIF_DISPOSAL_METHOD
gIFg: GIF disposal method- See Also:
-
GIF_USER_INPUT_FLAG
gIFg: GIF user input flag- See Also:
-
GIF_DELAY_TIME
gIFg: GIF delay time (hundredths of a second)- See Also:
-
SCALE_UNIT
sCAL: Unit for physical scale of image subject- See Also:
-
PIXEL_WIDTH
sCAL: Physical width of pixel- See Also:
-
PIXEL_HEIGHT
sCAL: Physical height of pixel- See Also:
-
POSITION_UNIT
oFFs: Unit for image offset- See Also:
-
STEREO_MODE
sTER: Indicator of stereo image- See Also:
-
COLOR_TYPE_GRAY
public static final int COLOR_TYPE_GRAYIHDR: Grayscale color type- See Also:
-
COLOR_TYPE_GRAY_ALPHA
public static final int COLOR_TYPE_GRAY_ALPHAIHDR: Grayscale+alpha color type- See Also:
-
COLOR_TYPE_PALETTE
public static final int COLOR_TYPE_PALETTEIHDR: Palette color type- See Also:
-
COLOR_TYPE_RGB
public static final int COLOR_TYPE_RGBIHDR: RGB color type- See Also:
-
COLOR_TYPE_RGB_ALPHA
public static final int COLOR_TYPE_RGB_ALPHAIHDR: RGBA color type- See Also:
-
INTERLACE_NONE
public static final int INTERLACE_NONEIHDR: No interlace- See Also:
-
INTERLACE_ADAM7
public static final int INTERLACE_ADAM7IHDR: Adam7 interlace- See Also:
-
FILTER_BASE
public static final int FILTER_BASEIHDR: Adaptive filtering- See Also:
-
COMPRESSION_BASE
public static final int COMPRESSION_BASEIHDR: Deflate/inflate compression- See Also:
-
UNIT_UNKNOWN
public static final int UNIT_UNKNOWNpHYs: Unit is unknown- See Also:
-
UNIT_METER
public static final int UNIT_METERpHYs: Unit is the meter- See Also:
-
SRGB_PERCEPTUAL
public static final int SRGB_PERCEPTUALsRGB: Perceptual rendering intent- See Also:
-
SRGB_RELATIVE_COLORIMETRIC
public static final int SRGB_RELATIVE_COLORIMETRICsRGB: Relative colorimetric rendering intent- See Also:
-
SRGB_SATURATION_PRESERVING
public static final int SRGB_SATURATION_PRESERVINGsRGB: Saturation rendering intent- See Also:
-
SRGB_ABSOLUTE_COLORIMETRIC
public static final int SRGB_ABSOLUTE_COLORIMETRICsRGB: Absolute colormetric rendering intent- See Also:
-
POSITION_X
oFFs: Image X position- See Also:
-
POSITION_Y
oFFs: Image Y position- See Also:
-
POSITION_UNIT_PIXEL
public static final int POSITION_UNIT_PIXELoFFs: Unit is the pixel (true dimensions unspecified)- See Also:
-
POSITION_UNIT_MICROMETER
public static final int POSITION_UNIT_MICROMETERoFFs: Unit is the micrometer (10^-6 meter)- See Also:
-
SCALE_UNIT_METER
public static final int SCALE_UNIT_METERsCAL: Unit is the meter- See Also:
-
SCALE_UNIT_RADIAN
public static final int SCALE_UNIT_RADIANsCAL: Unit is the radian- See Also:
-
STEREO_MODE_CROSS
public static final int STEREO_MODE_CROSSsTER: Cross-fuse layout- See Also:
-
STEREO_MODE_DIVERGING
public static final int STEREO_MODE_DIVERGINGsTER: Diverging-fuse layout- See Also:
-
-
Constructor Details
-
PngConstants
public PngConstants()
-
-
Method Details
-
isAncillary
public static boolean isAncillary(int chunkType) Returnstrueif the given chunk type has the ancillary bit set (the first letter is lowercase). An ancillary chunk is once which is not strictly necessary in order to meaningfully display the contents of the file.- Parameters:
chunkType- the chunk type- Returns:
- whether the chunk type ancillary bit is set
-
isPrivate
public static boolean isPrivate(int chunkType) Returnstrueif the given chunk type has the private bit set (the second letter is lowercase). All unregistered chunk types should have this bit set.- Parameters:
chunkType- the chunk type- Returns:
- whether the chunk type private bit is set
-
isReserved
public static boolean isReserved(int chunkType) Returnstrueif the given chunk type has the reserved bit set (the third letter is lowercase). The meaning of this bit is currently undefined, but reserved for future use. Images conforming to the current version of the PNG specification must not have this bit set.- Parameters:
chunkType- the chunk type- Returns:
- whether the chunk type reserved bit is set
-
isSafeToCopy
public static boolean isSafeToCopy(int chunkType) Returnstrueif the given chunk type has the safe-to-copy bit set (the fourth letter is lowercase). Chunks marked as safe-to-copy may be copied to a modified PNG file whether or not the software recognizes the chunk type.- Parameters:
chunkType- the chunk type- Returns:
- whether the chunk safe-to-copy bit is set
-
getChunkName
Returns the four-character ASCII name corresponding to the given chunk type. For example,PngConstants.getChunkName(PngConstants.IHDR)will return"IHDR".- Parameters:
chunkType- the chunk type- Returns:
- the four-character ASCII chunk name
-
getChunkType
Returns the chunk type corresponding to the given four-character ASCII chunk name.- Parameters:
chunkName- the four-character ASCII chunk name- Returns:
- the chunk type
- Throws:
NullPointerException- ifnameis nullIndexOutOfBoundsException- ifnamehas less than four characters
-