Class PaletteBox
java.lang.Object
com.sun.media.imageioimpl.plugins.jpeg2000.Box
com.sun.media.imageioimpl.plugins.jpeg2000.PaletteBox
This class is designed to represent a palette box for JPEG 2000 JP2 file
format. A palette box has a length, and a fixed type of "pclr".
Its content contains the number of palette entry, the number of color
components, the bit depths of the output components, the LUT.
Currently, only 8-bit color index is supported.
-
Field Summary
Fields inherited from class com.sun.media.imageioimpl.plugins.jpeg2000.Box
data, extraLength, length, type -
Constructor Summary
ConstructorsConstructorDescriptionPaletteBox(byte[] data) Constructs aPlatteBoxfrom the provided byte array.PaletteBox(int length, byte[] comp, byte[][] lut) Constructs aPlatteBoxfrom the provided length, bit depths of the color components and the LUT.Constructs aPlatteBoxfrom anIndexColorModel.PaletteBox(Node node) Constructs aPlatteBoxfrom anorg.w3c.dom.Node. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcompose()Composes the content byte array from the data elements.byte[]Return the bit depths for all the color components.byte[][]getLUT()Return the LUT.creates anIIOMetadataNodefrom this palette box.intReturn the number of color components.intReturn the number of palette entries.protected voidparse(byte[] data) Parses the data elements from the byte array.Methods inherited from class com.sun.media.imageioimpl.plugins.jpeg2000.Box
copyInt, createBox, getAttribute, getBoxClass, getByteArrayElementValue, getByteElementValue, getContent, getExtraLength, getIntArrayElementValue, getIntElementValue, getLength, getName, getNativeNodeForSimpleBox, getShortElementValue, getStringElementValue, getType, getTypeByName, getTypeInt, getTypeString, parseByteArray, parseIntArray, read, setContent, setDefaultAttributes, setExtraLength, setLength, write
-
Constructor Details
-
PaletteBox
Constructs aPlatteBoxfrom anIndexColorModel. -
PaletteBox
Constructs aPlatteBoxfrom anorg.w3c.dom.Node.- Throws:
IIOInvalidTreeException
-
PaletteBox
public PaletteBox(int length, byte[] comp, byte[][] lut) Constructs aPlatteBoxfrom the provided length, bit depths of the color components and the LUT. -
PaletteBox
public PaletteBox(byte[] data) Constructs aPlatteBoxfrom the provided byte array.
-
-
Method Details
-
getNumEntries
public int getNumEntries()Return the number of palette entries. -
getNumComp
public int getNumComp()Return the number of color components. -
getBitDepths
public byte[] getBitDepths()Return the bit depths for all the color components. -
getLUT
public byte[][] getLUT()Return the LUT. -
getNativeNode
creates anIIOMetadataNodefrom this palette box. The format of this node is defined in the XML dtd and xsd for the JP2 image file.- Overrides:
getNativeNodein classBox
-
parse
protected void parse(byte[] data) Description copied from class:BoxParses the data elements from the byte array. The subclasses should override this method. -
compose
protected void compose()Description copied from class:BoxComposes the content byte array from the data elements.
-