Class ResolutionBox
- java.lang.Object
-
- com.sun.media.imageioimpl.plugins.jpeg2000.Box
-
- com.sun.media.imageioimpl.plugins.jpeg2000.ResolutionBox
-
public class ResolutionBox extends Box
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
Constructors Constructor Description ResolutionBox(int type, byte[] data)
Constructs aResolutionBox
from the provided type and content data array.ResolutionBox(int type, float hRes, float vRes)
Constructs aResolutionBox
from the provided type and horizontal/vertical resolutions.ResolutionBox(Node node)
Constructs aResolutionBox
based on the providedorg.w3c.dom.Node
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
compose()
Composes the content byte array from the data elements.float
getHorizontalResolution()
Return the horizontal resolution.IIOMetadataNode
getNativeNode()
Creates anIIOMetadataNode
from this resolution box.float
getVerticalResolution()
Return the vertical resolution.protected void
parse(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 Detail
-
ResolutionBox
public ResolutionBox(int type, byte[] data)
Constructs aResolutionBox
from the provided type and content data array.
-
ResolutionBox
public ResolutionBox(int type, float hRes, float vRes)
Constructs aResolutionBox
from the provided type and horizontal/vertical resolutions.
-
ResolutionBox
public ResolutionBox(Node node) throws IIOInvalidTreeException
Constructs aResolutionBox
based on the providedorg.w3c.dom.Node
.- Throws:
IIOInvalidTreeException
-
-
Method Detail
-
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
public IIOMetadataNode getNativeNode()
Creates anIIOMetadataNode
from this resolution box. The format of this node is defined in the XML dtd and xsd for the JP2 image file.- Overrides:
getNativeNode
in classBox
-
-