Class ResolutionBox
java.lang.Object
com.sun.media.imageioimpl.plugins.jpeg2000.Box
com.sun.media.imageioimpl.plugins.jpeg2000.ResolutionBox
This class is defined to represent a Resolution Box of JPEG JP2
file format. A Data Entry URL Box has a length, and a fixed type
of "resc" (capture resolution) or "resd" (default display resolution).
Its contens includes the resolution numerators, denominator, and the
exponents for both horizontal and vertical directions.
-
Field Summary
Fields inherited from class com.sun.media.imageioimpl.plugins.jpeg2000.Box
data, extraLength, length, type -
Constructor Summary
ConstructorsConstructorDescriptionResolutionBox(int type, byte[] data) Constructs aResolutionBoxfrom the provided type and content data array.ResolutionBox(int type, float hRes, float vRes) Constructs aResolutionBoxfrom the provided type and horizontal/vertical resolutions.ResolutionBox(Node node) Constructs aResolutionBoxbased on the providedorg.w3c.dom.Node. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcompose()Composes the content byte array from the data elements.floatReturn the horizontal resolution.Creates anIIOMetadataNodefrom this resolution box.floatReturn the vertical resolution.protected voidparse(byte[] data) Parse the data elements from the provided content data array.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
-
ResolutionBox
public ResolutionBox(int type, byte[] data) Constructs aResolutionBoxfrom the provided type and content data array. -
ResolutionBox
public ResolutionBox(int type, float hRes, float vRes) Constructs aResolutionBoxfrom the provided type and horizontal/vertical resolutions. -
ResolutionBox
Constructs aResolutionBoxbased on the providedorg.w3c.dom.Node.- Throws:
IIOInvalidTreeException
-
-
Method Details
-
getHorizontalResolution
public float getHorizontalResolution()Return the horizontal resolution. -
getVerticalResolution
public float getVerticalResolution()Return the vertical resolution. -
parse
protected void parse(byte[] data) Parse the data elements from the provided content data array. -
getNativeNode
Creates anIIOMetadataNodefrom this resolution 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.
-