|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectDefaultMutableTreeNode
BaseJP2KBox
public abstract class BaseJP2KBox
This class is defined to create the box of JP2 file format. A box has a length, a type, an optional extra length and its content. The subclasses should explain the content information.
Field Summary |
---|
Fields inherited from class DefaultMutableTreeNode |
---|
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject |
Constructor Summary | |
---|---|
BaseJP2KBox(int length,
int type,
byte[] data)
Constructs a Box instance using the provided the box type
and the box content in byte array format. |
|
BaseJP2KBox(int length,
int type,
long extraLength,
byte[] data)
Constructs a Box instance using the provided the box type,
the box extra length, and the box content in byte array format. |
|
BaseJP2KBox(Node node)
Constructs a Box from an "unknown" Node. |
Method Summary | |
---|---|
Object |
clone()
|
protected abstract byte[] |
compose()
Composes the content byte array from the data elements. |
byte[] |
getContent()
Returns the box content in byte array. |
long |
getExtraLength()
Returns the box extra length. |
int |
getLength()
Returns the box length. |
IIOMetadataNode |
getNativeNode()
Creates an IIOMetadataNode from this box. |
protected IIOMetadataNode |
getNativeNodeForSimpleBox()
Creates an IIOMetadataNode from this box. |
int |
getType()
Returns the box type. |
protected abstract void |
parse(byte[] data)
Parses the data elements from the byte array. |
protected void |
setDefaultAttributes(IIOMetadataNode node)
Sets the default attributes, "Length", "Type", and "ExtraLength", to the provided IIOMetadataNode . |
void |
setExtraLength(long extraLength)
Sets the box extra length length to the provided value. |
void |
setLength(int length)
Sets the box length to the provided value. |
void |
setType(int type)
|
String |
toString()
|
Methods inherited from class DefaultMutableTreeNode |
---|
add, breadthFirstEnumeration, children, depthFirstEnumeration, getAllowsChildren, getChildAfter, getChildAt, getChildBefore, getChildCount, getDepth, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPathToRoot, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, insert, isLeaf, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent, setUserObject |
Methods inherited from class Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface MutableTreeNode |
---|
insert, remove, remove, removeFromParent, setParent, setUserObject |
Methods inherited from interface TreeNode |
---|
children, getAllowsChildren, getChildAt, getChildCount, getIndex, getParent, isLeaf |
Constructor Detail |
---|
public BaseJP2KBox(int length, int type, byte[] data)
Box
instance using the provided the box type
and the box content in byte array format.
length
- The provided box length.type
- The provided box type.data
- The provided box content in a byte array.
IllegalArgumentException
- If the length of the content byte array is not length -
8.public BaseJP2KBox(int length, int type, long extraLength, byte[] data)
Box
instance using the provided the box type,
the box extra length, and the box content in byte array format. In this
case, the length of the box is set to 1, which indicates the extra length
is meaningful.
length
- The provided box length.type
- The provided box type.extraLength
- The provided box extra length.data
- The provided box content in a byte array.
IllegalArgumentException
- If the length of the content byte array is not extra
length - 16.public BaseJP2KBox(Node node) throws IIOInvalidTreeException
IIOInvalidTreeException
Method Detail |
---|
protected IIOMetadataNode getNativeNodeForSimpleBox()
IIOMetadataNode
from this box. The format of
this node is defined in the XML dtd and xsd for the JP2 image file.
This method is designed for the types of boxes whose XML tree only has 2
levels.
public byte[] getContent()
getContent
in interface JP2KBox
protected abstract void parse(byte[] data)
protected abstract byte[] compose()
public IIOMetadataNode getNativeNode()
IIOMetadataNode
from this box. The format of
this node is defined in the XML dtd and xsd for the JP2 image file.
getNativeNode
in interface JP2KBoxMetadata
public long getExtraLength()
JP2KBox
getExtraLength
in interface JP2KBox
it.geosolutions.imageio.plugins.jp2k.box.JPEG2000SimpleBox#getExtraLength()
public int getLength()
JP2KBox
getLength
in interface JP2KBox
it.geosolutions.imageio.plugins.jp2k.box.JPEG2000SimpleBox#getLength()
public int getType()
JP2KBox
getType
in interface JP2KBox
it.geosolutions.imageio.plugins.jp2k.box.JPEG2000SimpleBox#getType()
protected void setDefaultAttributes(IIOMetadataNode node)
IIOMetadataNode
.
public void setExtraLength(long extraLength)
public void setLength(int length)
public void setType(int type)
type
- public String toString()
toString
in class DefaultMutableTreeNode
public Object clone()
clone
in interface JP2KBox
clone
in class DefaultMutableTreeNode
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |