Class 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.
    • Constructor Detail

      • PaletteBox

        public PaletteBox​(IndexColorModel icm)
        Constructs a PlatteBox from an IndexColorModel.
      • PaletteBox

        public PaletteBox​(int length,
                          byte[] comp,
                          byte[][] lut)
        Constructs a PlatteBox from the provided length, bit depths of the color components and the LUT.
      • PaletteBox

        public PaletteBox​(byte[] data)
        Constructs a PlatteBox from 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 an IIOMetadataNode from this palette box. The format of this node is defined in the XML dtd and xsd for the JP2 image file.
        Overrides:
        getNativeNode in class Box
      • parse

        protected void parse​(byte[] data)
        Description copied from class: Box
        Parses the data elements from the byte array. The subclasses should override this method.
        Overrides:
        parse in class Box
      • compose

        protected void compose()
        Description copied from class: Box
        Composes the content byte array from the data elements.
        Overrides:
        compose in class Box