Class HeaderBox
java.lang.Object
com.sun.media.imageioimpl.plugins.jpeg2000.Box
com.sun.media.imageioimpl.plugins.jpeg2000.HeaderBox
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
ConstructorsConstructorDescriptionHeaderBox(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.Constructs an Image Header Box from a Node. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcompose()Composes the content byte array from the data elements.byteReturns the bit depth for all the image components.byteReturns the compression type.static String[]This method will be called by the getNativeNodeForSimpleBox of the class Box to get the element names.intReturns the height of the image.byteReturns theIntellectualPropertyflag.Creates anIIOMetadataNodefrom this image header box.shortReturns the number of image components.byteReturns 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.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 Details
-
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
Constructs an Image Header Box from a Node.- Throws:
IIOInvalidTreeException
-
-
Method Details
-
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
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
-
compose
protected void compose()Description copied from class:BoxComposes the content byte array from the data elements.
-