public class

PNGMetadata

extends IIOMetadata
implements Cloneable
java.lang.Object
   ↳ javax.imageio.metadata.IIOMetadata
     ↳ com.sun.imageio.plugins.png.PNGMetadata

Summary

Constants
int PHYS_UNIT_METER
int PHYS_UNIT_UNKNOWN
String nativeMetadataFormatClassName
String nativeMetadataFormatName
Fields
public int IHDR_bitDepth
public static final String[] IHDR_bitDepths
public int IHDR_colorType
public static final String[] IHDR_colorTypeNames
public int IHDR_compressionMethod
public static final String[] IHDR_compressionMethodNames
public int IHDR_filterMethod
public static final String[] IHDR_filterMethodNames
public int IHDR_height
public int IHDR_interlaceMethod
public static final String[] IHDR_interlaceMethodNames
public static final int[] IHDR_numChannels
public boolean IHDR_present
public int IHDR_width
public byte[] PLTE_blue
public byte[] PLTE_green
public int[] PLTE_order
public boolean PLTE_present
public byte[] PLTE_red
public int bKGD_blue
public int bKGD_colorType
public int bKGD_gray
public int bKGD_green
public int bKGD_index
public boolean bKGD_present
public int bKGD_red
public int cHRM_blueX
public int cHRM_blueY
public int cHRM_greenX
public int cHRM_greenY
public boolean cHRM_present
public int cHRM_redX
public int cHRM_redY
public int cHRM_whitePointX
public int cHRM_whitePointY
public static final String[] colorSpaceTypeNames
public int gAMA_gamma
public boolean gAMA_present
public char[] hIST_histogram
public boolean hIST_present
public byte[] iCCP_compressedProfile
public int iCCP_compressionMethod
public static final String[] iCCP_compressionMethodNames
public boolean iCCP_present
public String iCCP_profileName
public ArrayList<Boolean> iTXt_compressionFlag
public ArrayList<Integer> iTXt_compressionMethod
public ArrayList<String> iTXt_keyword
public ArrayList<String> iTXt_languageTag
public ArrayList<String> iTXt_text
public ArrayList<String> iTXt_translatedKeyword
public int pHYs_pixelsPerUnitXAxis
public int pHYs_pixelsPerUnitYAxis
public boolean pHYs_present
public int pHYs_unitSpecifier
public static final String[] renderingIntentNames
public int sBIT_alphaBits
public int sBIT_blueBits
public int sBIT_colorType
public int sBIT_grayBits
public int sBIT_greenBits
public boolean sBIT_present
public int sBIT_redBits
public int[] sPLT_alpha
public int[] sPLT_blue
public int[] sPLT_frequency
public int[] sPLT_green
public String sPLT_paletteName
public boolean sPLT_present
public int[] sPLT_red
public int sPLT_sampleDepth
public boolean sRGB_present
public int sRGB_renderingIntent
public ArrayList<String> tEXt_keyword
public ArrayList<String> tEXt_text
public int tIME_day
public int tIME_hour
public int tIME_minute
public int tIME_month
public boolean tIME_present
public int tIME_second
public int tIME_year
public byte[] tRNS_alpha
public int tRNS_blue
public int tRNS_colorType
public int tRNS_gray
public int tRNS_green
public boolean tRNS_present
public int tRNS_red
public static final String[] unitSpecifierNames
public ArrayList<byte[]> unknownChunkData
public ArrayList<String> unknownChunkType
public ArrayList<Integer> zTXt_compressionMethod
public static final String[] zTXt_compressionMethodNames
public ArrayList<String> zTXt_keyword
public ArrayList<String> zTXt_text
[Expand]
Inherited Fields
From class javax.imageio.metadata.IIOMetadata
Public Constructors
PNGMetadata()
PNGMetadata(IIOMetadata metadata)
Public Methods
Object clone()
Creates and returns a copy of this object.
Node getAsTree(String formatName)
Returns an XML DOM Node object that represents the root of a tree of metadata contained within this object according to the conventions defined by a given metadata format.
IIOMetadataNode getStandardChromaNode()
Returns an IIOMetadataNode representing the chroma information of the standard javax_imageio_1.0 metadata format, or null if no such information is available.
IIOMetadataNode getStandardCompressionNode()
Returns an IIOMetadataNode representing the compression information of the standard javax_imageio_1.0 metadata format, or null if no such information is available.
IIOMetadataNode getStandardDataNode()
Returns an IIOMetadataNode representing the data format information of the standard javax_imageio_1.0 metadata format, or null if no such information is available.
IIOMetadataNode getStandardDimensionNode()
Returns an IIOMetadataNode representing the dimension information of the standard javax_imageio_1.0 metadata format, or null if no such information is available.
IIOMetadataNode getStandardDocumentNode()
Returns an IIOMetadataNode representing the document information of the standard javax_imageio_1.0 metadata format, or null if no such information is available.
IIOMetadataNode getStandardTextNode()
Returns an IIOMetadataNode representing the textual information of the standard javax_imageio_1.0 metadata format, or null if no such information is available.
IIOMetadataNode getStandardTransparencyNode()
Returns an IIOMetadataNode representing the transparency information of the standard javax_imageio_1.0 metadata format, or null if no such information is available.
void initialize(ImageTypeSpecifier imageType, int numBands)
Sets the IHDR_bitDepth and IHDR_colorType variables.
boolean isReadOnly()
Returns true if this object does not support the mergeTree, setFromTree, and reset methods.
void mergeTree(String formatName, Node root)
Alters the internal state of this IIOMetadata object from a tree of XML DOM Nodes whose syntax is defined by the given metadata format.
void reset()
Resets all the data stored in this object to default values, usually to the state this object was in immediately after construction, though the precise semantics are plug-in specific.
[Expand]
Inherited Methods
From class javax.imageio.metadata.IIOMetadata
From class java.lang.Object

Constants

public static final int PHYS_UNIT_METER

Constant Value: 1 (0x00000001)

public static final int PHYS_UNIT_UNKNOWN

Constant Value: 0 (0x00000000)

protected static final String nativeMetadataFormatClassName

Constant Value: "com.sun.imageio.plugins.png.PNGMetadataFormat"

public static final String nativeMetadataFormatName

Constant Value: "javax_imageio_png_1.0"

Fields

public int IHDR_bitDepth

public static final String[] IHDR_bitDepths

public int IHDR_colorType

public static final String[] IHDR_colorTypeNames

public int IHDR_compressionMethod

public static final String[] IHDR_compressionMethodNames

public int IHDR_filterMethod

public static final String[] IHDR_filterMethodNames

public int IHDR_height

public int IHDR_interlaceMethod

public static final String[] IHDR_interlaceMethodNames

public static final int[] IHDR_numChannels

public boolean IHDR_present

public int IHDR_width

public byte[] PLTE_blue

public byte[] PLTE_green

public int[] PLTE_order

public boolean PLTE_present

public byte[] PLTE_red

public int bKGD_blue

public int bKGD_colorType

public int bKGD_gray

public int bKGD_green

public int bKGD_index

public boolean bKGD_present

public int bKGD_red

public int cHRM_blueX

public int cHRM_blueY

public int cHRM_greenX

public int cHRM_greenY

public boolean cHRM_present

public int cHRM_redX

public int cHRM_redY

public int cHRM_whitePointX

public int cHRM_whitePointY

public static final String[] colorSpaceTypeNames

public int gAMA_gamma

public boolean gAMA_present

public char[] hIST_histogram

public boolean hIST_present

public byte[] iCCP_compressedProfile

public int iCCP_compressionMethod

public static final String[] iCCP_compressionMethodNames

public boolean iCCP_present

public String iCCP_profileName

public ArrayList<Boolean> iTXt_compressionFlag

public ArrayList<Integer> iTXt_compressionMethod

public ArrayList<String> iTXt_keyword

public ArrayList<String> iTXt_languageTag

public ArrayList<String> iTXt_text

public ArrayList<String> iTXt_translatedKeyword

public int pHYs_pixelsPerUnitXAxis

public int pHYs_pixelsPerUnitYAxis

public boolean pHYs_present

public int pHYs_unitSpecifier

public static final String[] renderingIntentNames

public int sBIT_alphaBits

public int sBIT_blueBits

public int sBIT_colorType

public int sBIT_grayBits

public int sBIT_greenBits

public boolean sBIT_present

public int sBIT_redBits

public int[] sPLT_alpha

public int[] sPLT_blue

public int[] sPLT_frequency

public int[] sPLT_green

public String sPLT_paletteName

public boolean sPLT_present

public int[] sPLT_red

public int sPLT_sampleDepth

public boolean sRGB_present

public int sRGB_renderingIntent

public ArrayList<String> tEXt_keyword

public ArrayList<String> tEXt_text

public int tIME_day

public int tIME_hour

public int tIME_minute

public int tIME_month

public boolean tIME_present

public int tIME_second

public int tIME_year

public byte[] tRNS_alpha

public int tRNS_blue

public int tRNS_colorType

public int tRNS_gray

public int tRNS_green

public boolean tRNS_present

public int tRNS_red

public static final String[] unitSpecifierNames

public ArrayList<byte[]> unknownChunkData

public ArrayList<String> unknownChunkType

public ArrayList<Integer> zTXt_compressionMethod

public static final String[] zTXt_compressionMethodNames

public ArrayList<String> zTXt_keyword

public ArrayList<String> zTXt_text

Public Constructors

public PNGMetadata ()

public PNGMetadata (IIOMetadata metadata)

Public Methods

public Object clone ()

Creates and returns a copy of this object. The precise meaning of "copy" may depend on the class of the object. The general intent is that, for any object x, the expression:

 x.clone() != x
will be true, and that the expression:
 x.clone().getClass() == x.getClass()
will be true, but these are not absolute requirements. While it is typically the case that:
 x.clone().equals(x)
will be true, this is not an absolute requirement.

By convention, the returned object should be obtained by calling super.clone. If a class and all of its superclasses (except Object) obey this convention, it will be the case that x.clone().getClass() == x.getClass().

By convention, the object returned by this method should be independent of this object (which is being cloned). To achieve this independence, it may be necessary to modify one or more fields of the object returned by super.clone before returning it. Typically, this means copying any mutable objects that comprise the internal "deep structure" of the object being cloned and replacing the references to these objects with references to the copies. If a class contains only primitive fields or references to immutable objects, then it is usually the case that no fields in the object returned by super.clone need to be modified.

The method clone for class Object performs a specific cloning operation. First, if the class of this object does not implement the interface Cloneable, then a CloneNotSupportedException is thrown. Note that all arrays are considered to implement the interface Cloneable. Otherwise, this method creates a new instance of the class of this object and initializes all its fields with exactly the contents of the corresponding fields of this object, as if by assignment; the contents of the fields are not themselves cloned. Thus, this method performs a "shallow copy" of this object, not a "deep copy" operation.

The class Object does not itself implement the interface Cloneable, so calling the clone method on an object whose class is Object will result in throwing an exception at run time.

Returns
  • a clone of this instance.

public Node getAsTree (String formatName)

Returns an XML DOM Node object that represents the root of a tree of metadata contained within this object according to the conventions defined by a given metadata format.

The names of the available metadata formats may be queried using the getMetadataFormatNames method.

Parameters
formatName the desired metadata format.
Returns
  • an XML DOM Node object forming the root of a tree.

public IIOMetadataNode getStandardChromaNode ()

Returns an IIOMetadataNode representing the chroma information of the standard javax_imageio_1.0 metadata format, or null if no such information is available. This method is intended to be called by the utility routine getStandardTree.

The default implementation returns null.

Subclasses should override this method to produce an appropriate subtree if they wish to support the standard metadata format.

Returns
  • an IIOMetadataNode, or null.

public IIOMetadataNode getStandardCompressionNode ()

Returns an IIOMetadataNode representing the compression information of the standard javax_imageio_1.0 metadata format, or null if no such information is available. This method is intended to be called by the utility routine getStandardTree.

The default implementation returns null.

Subclasses should override this method to produce an appropriate subtree if they wish to support the standard metadata format.

Returns
  • an IIOMetadataNode, or null.

public IIOMetadataNode getStandardDataNode ()

Returns an IIOMetadataNode representing the data format information of the standard javax_imageio_1.0 metadata format, or null if no such information is available. This method is intended to be called by the utility routine getStandardTree.

The default implementation returns null.

Subclasses should override this method to produce an appropriate subtree if they wish to support the standard metadata format.

Returns
  • an IIOMetadataNode, or null.

public IIOMetadataNode getStandardDimensionNode ()

Returns an IIOMetadataNode representing the dimension information of the standard javax_imageio_1.0 metadata format, or null if no such information is available. This method is intended to be called by the utility routine getStandardTree.

The default implementation returns null.

Subclasses should override this method to produce an appropriate subtree if they wish to support the standard metadata format.

Returns
  • an IIOMetadataNode, or null.

public IIOMetadataNode getStandardDocumentNode ()

Returns an IIOMetadataNode representing the document information of the standard javax_imageio_1.0 metadata format, or null if no such information is available. This method is intended to be called by the utility routine getStandardTree.

The default implementation returns null.

Subclasses should override this method to produce an appropriate subtree if they wish to support the standard metadata format.

Returns
  • an IIOMetadataNode, or null.

public IIOMetadataNode getStandardTextNode ()

Returns an IIOMetadataNode representing the textual information of the standard javax_imageio_1.0 metadata format, or null if no such information is available. This method is intended to be called by the utility routine getStandardTree.

The default implementation returns null.

Subclasses should override this method to produce an appropriate subtree if they wish to support the standard metadata format.

Returns
  • an IIOMetadataNode, or null.

public IIOMetadataNode getStandardTransparencyNode ()

Returns an IIOMetadataNode representing the transparency information of the standard javax_imageio_1.0 metadata format, or null if no such information is available. This method is intended to be called by the utility routine getStandardTree.

The default implementation returns null.

Subclasses should override this method to produce an appropriate subtree if they wish to support the standard metadata format.

Returns
  • an IIOMetadataNode, or null.

public void initialize (ImageTypeSpecifier imageType, int numBands)

Sets the IHDR_bitDepth and IHDR_colorType variables. The numBands parameter is necessary since we may only be writing a subset of the image bands.

public boolean isReadOnly ()

Returns true if this object does not support the mergeTree, setFromTree, and reset methods.

Returns
  • true if this IIOMetadata object cannot be modified.

public void mergeTree (String formatName, Node root)

Alters the internal state of this IIOMetadata object from a tree of XML DOM Nodes whose syntax is defined by the given metadata format. The previous state is altered only as necessary to accomodate the nodes that are present in the given tree. If the tree structure or contents are invalid, an IIOInvalidTreeException will be thrown.

As the semantics of how a tree or subtree may be merged with another tree are completely format-specific, plug-in authors may implement this method in whatever manner is most appropriate for the format, including simply replacing all existing state with the contents of the given tree.

Parameters
formatName the desired metadata format.
root an XML DOM Node object forming the root of a tree.

public void reset ()

Resets all the data stored in this object to default values, usually to the state this object was in immediately after construction, though the precise semantics are plug-in specific. Note that there are many possible default values, depending on how the object was created.