Class PngConstants
java.lang.Object
com.sixlegs.png.PngConstants
-
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
-
COLOR_TYPE
-
COMPRESSION
-
FILTER
-
GAMMA
-
WIDTH
-
HEIGHT
-
INTERLACE
-
PALETTE
-
PALETTE_ALPHA
-
TRANSPARENCY
-
BACKGROUND
-
PIXELS_PER_UNIT_X
-
PIXELS_PER_UNIT_Y
-
RENDERING_INTENT
-
SIGNIFICANT_BITS
-
TEXT_CHUNKS
-
TIME
-
UNIT
-
CHROMATICITY
-
ICC_PROFILE
-
ICC_PROFILE_NAME
-
HISTOGRAM
-
SUGGESTED_PALETTES
-
GIF_DISPOSAL_METHOD
-
GIF_USER_INPUT_FLAG
-
GIF_DELAY_TIME
-
SCALE_UNIT
-
PIXEL_WIDTH
-
PIXEL_HEIGHT
-
POSITION_UNIT
-
STEREO_MODE
-
COLOR_TYPE_GRAY
-
COLOR_TYPE_GRAY_ALPHA
-
COLOR_TYPE_PALETTE
-
COLOR_TYPE_RGB
-
COLOR_TYPE_RGB_ALPHA
-
INTERLACE_NONE
-
INTERLACE_ADAM7
-
FILTER_BASE
-
COMPRESSION_BASE
-
UNIT_UNKNOWN
-
UNIT_METER
-
SRGB_PERCEPTUAL
-
SRGB_RELATIVE_COLORIMETRIC
public static final int SRGB_RELATIVE_COLORIMETRICsRGB: Relative colorimetric rendering intent- See Also:
-
SRGB_SATURATION_PRESERVING
-
SRGB_ABSOLUTE_COLORIMETRIC
public static final int SRGB_ABSOLUTE_COLORIMETRICsRGB: Absolute colormetric rendering intent- See Also:
-
POSITION_X
-
POSITION_Y
-
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
-
SCALE_UNIT_RADIAN
-
STEREO_MODE_CROSS
-
STEREO_MODE_DIVERGING
-
-
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
-