# Class PngConstants

java.lang.Object
com.sixlegs.png.PngConstants

public abstract class PngConstants extends Object
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:
  - `PngImage.getProperty(String)`
  - `PngImage.getProperties()`

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`BACKGROUND`
`bKGD`: Background samples
`static final String`
`BIT_DEPTH`
`IHDR`: Bit depth
`static final int`
`bKGD`
Background color
`static final int`
`cHRM`
Primary chromaticities
`static final String`
`CHROMATICITY`
`cHRM`: Chromaticity
`static final String`
`COLOR_TYPE`
`IHDR`: Color type
`static final int`
`COLOR_TYPE_GRAY`
`IHDR`: Grayscale color type
`static final int`
`COLOR_TYPE_GRAY_ALPHA`
`IHDR`: Grayscale+alpha color type
`static final int`
`COLOR_TYPE_PALETTE`
`IHDR`: Palette color type
`static final int`
`COLOR_TYPE_RGB`
`IHDR`: RGB color type
`static final int`
`COLOR_TYPE_RGB_ALPHA`
`IHDR`: RGBA color type
`static final String`
`COMPRESSION`
`IHDR`: Compression method
`static final int`
`COMPRESSION_BASE`
`IHDR`: Deflate/inflate compression
`static final String`
`FILTER`
`IHDR`: Filter method
`static final int`
`FILTER_BASE`
`IHDR`: Adaptive filtering
`static final int`
`gAMA`
Image gamma
`static final String`
`GAMMA`
`gAMA`: Gamma
`static final String`
`GIF_DELAY_TIME`
`gIFg`: GIF delay time (hundredths of a second)
`static final String`
`GIF_DISPOSAL_METHOD`
`gIFg`: GIF disposal method
`static final String`
`GIF_USER_INPUT_FLAG`
`gIFg`: GIF user input flag
`static final int`
`gIFg`
GIF Graphic Control Extension
`static final int`
`gIFx`
GIF Application Extension
`static final String`
`HEIGHT`
`IHDR`: Height
`static final int`
`hIST`
Palette histogram
`static final String`
`HISTOGRAM`
`hIST`: Palette histogram
`static final String`
`ICC_PROFILE`
`iCCP`: ICC profile
`static final String`
`ICC_PROFILE_NAME`
`iCCP`: ICC profile name
`static final int`
`iCCP`
Embedded ICC profile
`static final int`
`IDAT`
Image data
`static final int`
`IEND`
Image trailer
`static final int`
`IHDR`
Image header
`static final String`
`INTERLACE`
`IHDR`: Interlace method
`static final int`
`INTERLACE_ADAM7`
`IHDR`: Adam7 interlace
`static final int`
`INTERLACE_NONE`
`IHDR`: No interlace
`static final int`
`iTXt`
International textual data
`static final int`
`oFFs`
Image offset
`static final String`
`PALETTE`
`PLTE`: Palette entries
`static final String`
`PALETTE_ALPHA`
`PLTE`: Palette alpha
`static final int`
`pCAL`
Calibration of pixel values
`static final int`
`pHYs`
Physical pixel dimensions
`static final String`
`PIXEL_HEIGHT`
`sCAL`: Physical height of pixel
`static final String`
`PIXEL_WIDTH`
`sCAL`: Physical width of pixel
`static final String`
`PIXELS_PER_UNIT_X`
`pHYs`: Pixels per unit, X axis
`static final String`
`PIXELS_PER_UNIT_Y`
`pHYs`: Pixels per unit, Y axis
`static final int`
`PLTE`
Palette
`static final String`
`POSITION_UNIT`
`oFFs`: Unit for image offset
`static final int`
`POSITION_UNIT_MICROMETER`
`oFFs`: Unit is the micrometer (10^-6 meter)
`static final int`
`POSITION_UNIT_PIXEL`
`oFFs`: Unit is the pixel (true dimensions unspecified)
`static final String`
`POSITION_X`
`oFFs`: Image X position
`static final String`
`POSITION_Y`
`oFFs`: Image Y position
`static final String`
`RENDERING_INTENT`
`sRGB`: Rendering intent
`static final int`
`sBIT`
Significant bits
`static final int`
`sCAL`
Physical scale of image subject
`static final String`
`SCALE_UNIT`
`sCAL`: Unit for physical scale of image subject
`static final int`
`SCALE_UNIT_METER`
`sCAL`: Unit is the meter
`static final int`
`SCALE_UNIT_RADIAN`
`sCAL`: Unit is the radian
`static final long`
`SIGNATURE`
Eight byte magic number that begins all PNG images
`static final String`
`SIGNIFICANT_BITS`
`sBIT`: Significant bits
`static final int`
`sPLT`
Suggested palette
`static final int`
`sRGB`
Standard RGB color space
`static final int`
`SRGB_ABSOLUTE_COLORIMETRIC`
`sRGB`: Absolute colormetric rendering intent
`static final int`
`SRGB_PERCEPTUAL`
`sRGB`: Perceptual rendering intent
`static final int`
`SRGB_RELATIVE_COLORIMETRIC`
`sRGB`: Relative colorimetric rendering intent
`static final int`
`SRGB_SATURATION_PRESERVING`
`sRGB`: Saturation rendering intent
`static final int`
`sTER`
Indicator of Stereo Image
`static final String`
`STEREO_MODE`
`sTER`: Indicator of stereo image
`static final int`
`STEREO_MODE_CROSS`
`sTER`: Cross-fuse layout
`static final int`
`STEREO_MODE_DIVERGING`
`sTER`: Diverging-fuse layout
`static final String`
`SUGGESTED_PALETTES`
`sPLT`: List of suggested palettes
`static final int`
`tEXt`
Textual data
`static final String`
`TEXT_CHUNKS`
`tEXt`/`zTXt`/`iTXt`: List of text chunks
`static final int`
`tIME`
Image last-modification time
`static final String`
`TIME`
`tIME`: Image last-modification time
`static final String`
`TRANSPARENCY`
`tRNS`: Transparency samples
`static final int`
`tRNS`
Transparency
`static final String`
`UNIT`
`pHYs`: Unit specifier
`static final int`
`UNIT_METER`
`pHYs`: Unit is the meter
`static final int`
`UNIT_UNKNOWN`
`pHYs`: Unit is unknown
`static final String`
`WIDTH`
`IHDR`: Width
`static final int`
`zTXt`
Compressed textual data

## Constructor Summary

Constructors
Constructor
Description
`PngConstants()`

## Method Summary

Modifier and Type
Method
Description
`static 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)`
Returns `true` if the given chunk type has the ancillary bit set (the first letter is lowercase).
`static boolean`
`isPrivate(int chunkType)`
Returns `true` if the given chunk type has the private bit set (the second letter is lowercase).
`static boolean`
`isReserved(int chunkType)`
Returns `true` if the given chunk type has the reserved bit set (the third letter is lowercase).
`static boolean`
`isSafeToCopy(int chunkType)`
Returns `true` if the given chunk type has the safe-to-copy bit set (the fourth letter is lowercase).

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### SIGNATURE

public static final long SIGNATURE
Eight byte magic number that begins all PNG images

See Also:
  - Constant Field Values

### IHDR

public static final int IHDR
Image header

See Also:
  - Constant Field Values

### PLTE

public static final int PLTE
Palette

See Also:
  - Constant Field Values

### IDAT

public static final int IDAT
Image data

See Also:
  - Constant Field Values

### IEND

public static final int IEND
Image trailer

See Also:
  - Constant Field Values

### bKGD

public static final int bKGD
Background color

See Also:
  - Constant Field Values

### cHRM

public static final int cHRM
Primary chromaticities

See Also:
  - Constant Field Values

### gAMA

public static final int gAMA
Image gamma

See Also:
  - Constant Field Values

### hIST

public static final int hIST
Palette histogram

See Also:
  - Constant Field Values

### iCCP

public static final int iCCP
Embedded ICC profile

See Also:
  - Constant Field Values

### iTXt

public static final int iTXt
International textual data

See Also:
  - Constant Field Values

### pHYs

public static final int pHYs
Physical pixel dimensions

See Also:
  - Constant Field Values

### sBIT

public static final int sBIT
Significant bits

See Also:
  - Constant Field Values

### sPLT

public static final int sPLT
Suggested palette

See Also:
  - Constant Field Values

### sRGB

public static final int sRGB
Standard RGB color space

See Also:
  - Constant Field Values

### tEXt

public static final int tEXt
Textual data

See Also:
  - Constant Field Values

### tIME

public static final int tIME
Image last-modification time

See Also:
  - Constant Field Values

### tRNS

public static final int tRNS
Transparency

See Also:
  - Constant Field Values

### zTXt

public static final int zTXt
Compressed textual data

See Also:
  - Constant Field Values

### oFFs

public static final int oFFs
Image offset

See Also:
  - Constant Field Values

### pCAL

public static final int pCAL
Calibration of pixel values

See Also:
  - Constant Field Values

### sCAL

public static final int sCAL
Physical scale of image subject

See Also:
  - Constant Field Values

### gIFg

public static final int gIFg
GIF Graphic Control Extension

See Also:
  - Constant Field Values

### gIFx

public static final int gIFx
GIF Application Extension

See Also:
  - Constant Field Values

### sTER

public static final int sTER
Indicator of Stereo Image

See Also:
  - Constant Field Values

### BIT_DEPTH

public static final String BIT_DEPTH
`IHDR`: Bit depth

See Also:
  - Constant Field Values

### COLOR_TYPE

public static final String COLOR_TYPE
`IHDR`: Color type

See Also:
  - Constant Field Values

### COMPRESSION

public static final String COMPRESSION
`IHDR`: Compression method

See Also:
  - Constant Field Values

### FILTER

public static final String FILTER
`IHDR`: Filter method

See Also:
  - Constant Field Values

### GAMMA

public static final String GAMMA
`gAMA`: Gamma

See Also:
  - Constant Field Values

### WIDTH

public static final String WIDTH
`IHDR`: Width

See Also:
  - Constant Field Values

### HEIGHT

public static final String HEIGHT
`IHDR`: Height

See Also:
  - Constant Field Values

### INTERLACE

public static final String INTERLACE
`IHDR`: Interlace method

See Also:
  - Constant Field Values

### PALETTE

public static final String PALETTE
`PLTE`: Palette entries

See Also:
  - Constant Field Values

### PALETTE_ALPHA

public static final String PALETTE_ALPHA
`PLTE`: Palette alpha

See Also:
  - Constant Field Values

### TRANSPARENCY

public static final String TRANSPARENCY
`tRNS`: Transparency samples

See Also:
  - Constant Field Values

### BACKGROUND

public static final String BACKGROUND
`bKGD`: Background samples

See Also:
  - Constant Field Values

### PIXELS_PER_UNIT_X

public static final String PIXELS_PER_UNIT_X
`pHYs`: Pixels per unit, X axis

See Also:
  - Constant Field Values

### PIXELS_PER_UNIT_Y

public static final String PIXELS_PER_UNIT_Y
`pHYs`: Pixels per unit, Y axis

See Also:
  - Constant Field Values

### RENDERING_INTENT

public static final String RENDERING_INTENT
`sRGB`: Rendering intent

See Also:
  - Constant Field Values

### SIGNIFICANT_BITS

public static final String SIGNIFICANT_BITS
`sBIT`: Significant bits

See Also:
  - Constant Field Values

### TEXT_CHUNKS

public static final String TEXT_CHUNKS
`tEXt`/`zTXt`/`iTXt`: List of text chunks

See Also:
  - Constant Field Values

### TIME

public static final String TIME
`tIME`: Image last-modification time

See Also:
  - Constant Field Values

### UNIT

public static final String UNIT
`pHYs`: Unit specifier

See Also:
  - Constant Field Values

### CHROMATICITY

public static final String CHROMATICITY
`cHRM`: Chromaticity

See Also:
  - Constant Field Values

### ICC_PROFILE

public static final String ICC_PROFILE
`iCCP`: ICC profile

See Also:
  - Constant Field Values

### ICC_PROFILE_NAME

public static final String ICC_PROFILE_NAME
`iCCP`: ICC profile name

See Also:
  - Constant Field Values

### HISTOGRAM

public static final String HISTOGRAM
`hIST`: Palette histogram

See Also:
  - Constant Field Values

### SUGGESTED_PALETTES

public static final String SUGGESTED_PALETTES
`sPLT`: List of suggested palettes

See Also:
  - Constant Field Values

### GIF_DISPOSAL_METHOD

public static final String GIF_DISPOSAL_METHOD
`gIFg`: GIF disposal method

See Also:
  - Constant Field Values

### GIF_USER_INPUT_FLAG

public static final String GIF_USER_INPUT_FLAG
`gIFg`: GIF user input flag

See Also:
  - Constant Field Values

### GIF_DELAY_TIME

public static final String GIF_DELAY_TIME
`gIFg`: GIF delay time (hundredths of a second)

See Also:
  - Constant Field Values

### SCALE_UNIT

public static final String SCALE_UNIT
`sCAL`: Unit for physical scale of image subject

See Also:
  - Constant Field Values

### PIXEL_WIDTH

public static final String PIXEL_WIDTH
`sCAL`: Physical width of pixel

See Also:
  - Constant Field Values

### PIXEL_HEIGHT

public static final String PIXEL_HEIGHT
`sCAL`: Physical height of pixel

See Also:
  - Constant Field Values

### POSITION_UNIT

public static final String POSITION_UNIT
`oFFs`: Unit for image offset

See Also:
  - Constant Field Values

### STEREO_MODE

public static final String STEREO_MODE
`sTER`: Indicator of stereo image

See Also:
  - Constant Field Values

### COLOR_TYPE_GRAY

public static final int COLOR_TYPE_GRAY
`IHDR`: Grayscale color type

See Also:
  - Constant Field Values

### COLOR_TYPE_GRAY_ALPHA

public static final int COLOR_TYPE_GRAY_ALPHA
`IHDR`: Grayscale+alpha color type

See Also:
  - Constant Field Values

### COLOR_TYPE_PALETTE

public static final int COLOR_TYPE_PALETTE
`IHDR`: Palette color type

See Also:
  - Constant Field Values

### COLOR_TYPE_RGB

public static final int COLOR_TYPE_RGB
`IHDR`: RGB color type

See Also:
  - Constant Field Values

### COLOR_TYPE_RGB_ALPHA

public static final int COLOR_TYPE_RGB_ALPHA
`IHDR`: RGBA color type

See Also:
  - Constant Field Values

### INTERLACE_NONE

public static final int INTERLACE_NONE
`IHDR`: No interlace

See Also:
  - Constant Field Values

### INTERLACE_ADAM7

public static final int INTERLACE_ADAM7
`IHDR`: Adam7 interlace

See Also:
  - Constant Field Values

### FILTER_BASE

public static final int FILTER_BASE
`IHDR`: Adaptive filtering

See Also:
  - Constant Field Values

### COMPRESSION_BASE

public static final int COMPRESSION_BASE
`IHDR`: Deflate/inflate compression

See Also:
  - Constant Field Values

### UNIT_UNKNOWN

public static final int UNIT_UNKNOWN
`pHYs`: Unit is unknown

See Also:
  - Constant Field Values

### UNIT_METER

public static final int UNIT_METER
`pHYs`: Unit is the meter

See Also:
  - Constant Field Values

### SRGB_PERCEPTUAL

public static final int SRGB_PERCEPTUAL
`sRGB`: Perceptual rendering intent

See Also:
  - Constant Field Values

### SRGB_RELATIVE_COLORIMETRIC

public static final int SRGB_RELATIVE_COLORIMETRIC
`sRGB`: Relative colorimetric rendering intent

See Also:
  - Constant Field Values

### SRGB_SATURATION_PRESERVING

public static final int SRGB_SATURATION_PRESERVING
`sRGB`: Saturation rendering intent

See Also:
  - Constant Field Values

### SRGB_ABSOLUTE_COLORIMETRIC

public static final int SRGB_ABSOLUTE_COLORIMETRIC
`sRGB`: Absolute colormetric rendering intent

See Also:
  - Constant Field Values

### POSITION_X

public static final String POSITION_X
`oFFs`: Image X position

See Also:
  - Constant Field Values

### POSITION_Y

public static final String POSITION_Y
`oFFs`: Image Y position

See Also:
  - Constant Field Values

### POSITION_UNIT_PIXEL

public static final int POSITION_UNIT_PIXEL
`oFFs`: Unit is the pixel (true dimensions unspecified)

See Also:
  - Constant Field Values

### POSITION_UNIT_MICROMETER

public static final int POSITION_UNIT_MICROMETER
`oFFs`: Unit is the micrometer (10^-6 meter)

See Also:
  - Constant Field Values

### SCALE_UNIT_METER

public static final int SCALE_UNIT_METER
`sCAL`: Unit is the meter

See Also:
  - Constant Field Values

### SCALE_UNIT_RADIAN

public static final int SCALE_UNIT_RADIAN
`sCAL`: Unit is the radian

See Also:
  - Constant Field Values

### STEREO_MODE_CROSS

public static final int STEREO_MODE_CROSS
`sTER`: Cross-fuse layout

See Also:
  - Constant Field Values

### STEREO_MODE_DIVERGING

public static final int STEREO_MODE_DIVERGING
`sTER`: Diverging-fuse layout

See Also:
  - Constant Field Values

## Constructor Details

### PngConstants

public PngConstants()

## Method Details

### isAncillary

public static boolean isAncillary(int chunkType)
Returns `true` 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)
Returns `true` 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)
Returns `true` 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)
Returns `true` 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

public static String getChunkName(int chunkType)
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

public static int getChunkType(String chunkName)
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` - if `name` is null
  `IndexOutOfBoundsException` - if `name` has less than four characters