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.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
bKGD
: Background samplesstatic final String
IHDR
: Bit depthstatic final int
Background colorstatic final int
Primary chromaticitiesstatic final String
cHRM
: Chromaticitystatic final String
IHDR
: Color typestatic final int
IHDR
: Grayscale color typestatic final int
IHDR
: Grayscale+alpha color typestatic final int
IHDR
: Palette color typestatic final int
IHDR
: RGB color typestatic final int
IHDR
: RGBA color typestatic final String
IHDR
: Compression methodstatic final int
IHDR
: Deflate/inflate compressionstatic final String
IHDR
: Filter methodstatic final int
IHDR
: Adaptive filteringstatic final int
Image gammastatic final String
gAMA
: Gammastatic final String
gIFg
: GIF delay time (hundredths of a second)static final String
gIFg
: GIF disposal methodstatic final String
gIFg
: GIF user input flagstatic final int
GIF Graphic Control Extensionstatic final int
GIF Application Extensionstatic final String
IHDR
: Heightstatic final int
Palette histogramstatic final String
hIST
: Palette histogramstatic final String
iCCP
: ICC profilestatic final String
iCCP
: ICC profile namestatic final int
Embedded ICC profilestatic final int
Image datastatic final int
Image trailerstatic final int
Image headerstatic final String
IHDR
: Interlace methodstatic final int
IHDR
: Adam7 interlacestatic final int
IHDR
: No interlacestatic final int
International textual datastatic final int
Image offsetstatic final String
PLTE
: Palette entriesstatic final String
PLTE
: Palette alphastatic final int
Calibration of pixel valuesstatic final int
Physical pixel dimensionsstatic final String
sCAL
: Physical height of pixelstatic final String
sCAL
: Physical width of pixelstatic final String
pHYs
: Pixels per unit, X axisstatic final String
pHYs
: Pixels per unit, Y axisstatic final int
Palettestatic final String
oFFs
: Unit for image offsetstatic final int
oFFs
: Unit is the micrometer (10^-6 meter)static final int
oFFs
: Unit is the pixel (true dimensions unspecified)static final String
oFFs
: Image X positionstatic final String
oFFs
: Image Y positionstatic final String
sRGB
: Rendering intentstatic final int
Significant bitsstatic final int
Physical scale of image subjectstatic final String
sCAL
: Unit for physical scale of image subjectstatic final int
sCAL
: Unit is the meterstatic final int
sCAL
: Unit is the radianstatic final long
Eight byte magic number that begins all PNG imagesstatic final String
sBIT
: Significant bitsstatic final int
Suggested palettestatic final int
Standard RGB color spacestatic final int
sRGB
: Absolute colormetric rendering intentstatic final int
sRGB
: Perceptual rendering intentstatic final int
sRGB
: Relative colorimetric rendering intentstatic final int
sRGB
: Saturation rendering intentstatic final int
Indicator of Stereo Imagestatic final String
sTER
: Indicator of stereo imagestatic final int
sTER
: Cross-fuse layoutstatic final int
sTER
: Diverging-fuse layoutstatic final String
sPLT
: List of suggested palettesstatic final int
Textual datastatic final String
static final int
Image last-modification timestatic final String
tIME
: Image last-modification timestatic final String
tRNS
: Transparency samplesstatic final int
Transparencystatic final String
pHYs
: Unit specifierstatic final int
pHYs
: Unit is the meterstatic final int
pHYs
: Unit is unknownstatic final String
IHDR
: Widthstatic final int
Compressed textual data -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
getChunkName
(int chunkType) Returns the four-character ASCII name corresponding to the given chunk type.static int
getChunkType
(String chunkName) Returns the chunk type corresponding to the given four-character ASCII chunk name.static boolean
isAncillary
(int chunkType) Returnstrue
if the given chunk type has the ancillary bit set (the first letter is lowercase).static boolean
isPrivate
(int chunkType) Returnstrue
if the given chunk type has the private bit set (the second letter is lowercase).static boolean
isReserved
(int chunkType) Returnstrue
if the given chunk type has the reserved bit set (the third letter is lowercase).static boolean
isSafeToCopy
(int chunkType) Returnstrue
if 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) Returnstrue
if 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) Returnstrue
if 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) Returnstrue
if 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) Returnstrue
if 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
- ifname
is nullIndexOutOfBoundsException
- ifname
has less than four characters
-