Class PaletteBox
- java.lang.Object
-
- com.github.jaiimageio.jpeg2000.impl.Box
-
- com.github.jaiimageio.jpeg2000.impl.PaletteBox
-
public class PaletteBox extends Box
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.github.jaiimageio.jpeg2000.impl.Box
data, extraLength, length, type
-
-
Constructor Summary
Constructors Constructor Description PaletteBox(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.PaletteBox(IndexColorModel icm)Constructs aPlatteBoxfrom anIndexColorModel.PaletteBox(Node node)Constructs aPlatteBoxfrom anorg.w3c.dom.Node.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcompose()Composes the content byte array from the data elements.byte[]getBitDepths()Return the bit depths for all the color components.byte[][]getLUT()Return the LUT.IIOMetadataNodegetNativeNode()creates anIIOMetadataNodefrom this palette box.intgetNumComp()Return the number of color components.intgetNumEntries()Return the number of palette entries.protected voidparse(byte[] data)Parses the data elements from the byte array.-
Methods inherited from class com.github.jaiimageio.jpeg2000.impl.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 Detail
-
PaletteBox
public PaletteBox(IndexColorModel icm)
Constructs aPlatteBoxfrom anIndexColorModel.
-
PaletteBox
public PaletteBox(Node node) throws IIOInvalidTreeException
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 Detail
-
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
public IIOMetadataNode 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.
-
-