Class HeaderBox
- java.lang.Object
-
- com.sun.media.imageioimpl.plugins.jpeg2000.Box
-
- com.sun.media.imageioimpl.plugins.jpeg2000.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.sun.media.imageioimpl.plugins.jpeg2000.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 void
compose()
Composes the content byte array from the data elements.byte
getBitDepth()
Returns the bit depth for all the image components.byte
getCompressionType()
Returns the compression type.static String[]
getElementNames()
This method will be called by the getNativeNodeForSimpleBox of the class Box to get the element names.int
getHeight()
Returns the height of the image.byte
getIntellectualProperty()
Returns theIntellectualProperty
flag.IIOMetadataNode
getNativeNode()
Creates anIIOMetadataNode
from this image header box.short
getNumComponents()
Returns the number of image components.byte
getUnknownColorspace()
Returns theUnknowColorspace
flag.int
getWidth()
Returns the width of the image.protected void
parse(byte[] data)
Parse the data elements from the byte array of the content.-
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 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 theUnknowColorspace
flag.
-
getIntellectualProperty
public byte getIntellectualProperty()
Returns theIntellectualProperty
flag.
-
getNativeNode
public IIOMetadataNode getNativeNode()
Creates anIIOMetadataNode
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 classBox
-
-