Class HeaderBox


  • public class HeaderBox
    extends Box
    This class is defined to represent an Image Header Box of JPEG JP2 file format. An Image Header Box has a length, and a fixed type of "ihdr". The content of an image header box contains the width/height, number of image components, the bit depth (coded with sign/unsign information), the compression type (7 for JP2 file), the flag to indicate the color space is known or not, and a flag to indicate whether the intellectual property information included in this file.
    • Constructor Detail

      • HeaderBox

        public HeaderBox​(int height,
                         int width,
                         int numComp,
                         int bitDepth,
                         int compressionType,
                         int unknownColor,
                         int intelProp)
        Create an Image Header Box from the element values.
      • HeaderBox

        public HeaderBox​(byte[] data)
        Create an Image Header Box using the content data.
    • Method Detail

      • getElementNames

        public static String[] getElementNames()
        This method will be called by the getNativeNodeForSimpleBox of the class Box to get the element names.
      • parse

        protected void parse​(byte[] data)
        Parse the data elements from the byte array of the content.
        Overrides:
        parse in class Box
      • getHeight

        public int getHeight()
        Returns the height of the image.
      • getWidth

        public int getWidth()
        Returns the width of the image.
      • getNumComponents

        public short getNumComponents()
        Returns the number of image components.
      • getCompressionType

        public byte getCompressionType()
        Returns the compression type.
      • getBitDepth

        public byte getBitDepth()
        Returns the bit depth for all the image components.
      • getUnknownColorspace

        public byte getUnknownColorspace()
        Returns the UnknowColorspace flag.
      • getIntellectualProperty

        public byte getIntellectualProperty()
        Returns the IntellectualProperty flag.
      • getNativeNode

        public IIOMetadataNode getNativeNode()
        Creates an IIOMetadataNode from this image header box. The format of this node is defined in the XML dtd and xsd for the JP2 image file.
        Overrides:
        getNativeNode 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