Class HeaderBox
- java.lang.Object
-
- com.github.jaiimageio.jpeg2000.impl.Box
-
- com.github.jaiimageio.jpeg2000.impl.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.
-
-
Field Summary
-
Fields inherited from class com.github.jaiimageio.jpeg2000.impl.Box
data, extraLength, length, type
-
-
Constructor Summary
Constructors Constructor Description HeaderBox(byte[] data)Create an Image Header Box using the content data.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(Node node)Constructs an Image Header Box from a Node.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcompose()Composes the content byte array from the data elements.bytegetBitDepth()Returns the bit depth for all the image components.bytegetCompressionType()Returns the compression type.static String[]getElementNames()This method will be called by the getNativeNodeForSimpleBox of the class Box to get the element names.intgetHeight()Returns the height of the image.bytegetIntellectualProperty()Returns theIntellectualPropertyflag.IIOMetadataNodegetNativeNode()Creates anIIOMetadataNodefrom this image header box.shortgetNumComponents()Returns the number of image components.bytegetUnknownColorspace()Returns theUnknowColorspaceflag.intgetWidth()Returns the width of the image.protected voidparse(byte[] data)Parse the data elements from the byte array of the content.-
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
-
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.
-
HeaderBox
public HeaderBox(Node node) throws IIOInvalidTreeException
Constructs an Image Header Box from a Node.- Throws:
IIOInvalidTreeException
-
-
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.
-
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 theUnknowColorspaceflag.
-
getIntellectualProperty
public byte getIntellectualProperty()
Returns theIntellectualPropertyflag.
-
getNativeNode
public IIOMetadataNode getNativeNode()
Creates anIIOMetadataNodefrom this image header box. The format of this node is defined in the XML dtd and xsd for the JP2 image file.- Overrides:
getNativeNodein classBox
-
-