Class ColorSpecificationBox
java.lang.Object
com.sun.media.imageioimpl.plugins.jpeg2000.Box
com.sun.media.imageioimpl.plugins.jpeg2000.ColorSpecificationBox
This class is defined to represent a Color Specification Box of JPEG JP2
file format. A Channel Definition Box has a length, and a fixed type
of "colr". Its content contains the method to define the color space,
the precedence and approximation accuracy (0 for JP2 files), the
enumerated color space, and the ICC color profile if any.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intThe enumerated color space defined in JP2 file format.static final intFields inherited from class com.sun.media.imageioimpl.plugins.jpeg2000.Box
data, extraLength, length, type -
Constructor Summary
ConstructorsConstructorDescriptionColorSpecificationBox(byte[] data) Creates aColorSpecificationBoxfrom the provided byte array.ColorSpecificationBox(byte m, byte p, byte a, int ecs, ICC_Profile profile) Creates aColorSpecificationBoxfrom the provided data elements.ColorSpecificationBox(Node node) Constructs aColorSpecificationBoxbased on the providedorg.w3c.dom.Node. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcompose()Composes the content byte array from the data elements.byteReturnsApproximationAccuracy.static String[]This method will be called by the getNativeNodeForSimpleBox of the class Box to get the element names.intReturns the enumerated color space.Returns the ICC color profile in this color specification box.byteReturns the method to define the color space.Creates anIIOMetadataNodefrom this color specification box.byteReturnsPrecedence.protected voidparse(byte[] data) Parses the data elements from the byte 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
-
Field Details
-
ECS_sRGB
public static final int ECS_sRGBThe enumerated color space defined in JP2 file format.- See Also:
-
ECS_GRAY
public static final int ECS_GRAY- See Also:
-
ECS_YCC
public static final int ECS_YCC- See Also:
-
-
Constructor Details
-
ColorSpecificationBox
Creates aColorSpecificationBoxfrom the provided data elements. -
ColorSpecificationBox
public ColorSpecificationBox(byte[] data) Creates aColorSpecificationBoxfrom the provided byte array. -
ColorSpecificationBox
Constructs aColorSpecificationBoxbased on the providedorg.w3c.dom.Node.- Throws:
IIOInvalidTreeException
-
-
Method Details
-
getElementNames
This method will be called by the getNativeNodeForSimpleBox of the class Box to get the element names. -
getMethod
public byte getMethod()Returns the method to define the color space. -
getPrecedence
public byte getPrecedence()ReturnsPrecedence. -
getApproximationAccuracy
public byte getApproximationAccuracy()ReturnsApproximationAccuracy. -
getEnumeratedColorSpace
public int getEnumeratedColorSpace()Returns the enumerated color space. -
getICCProfile
Returns the ICC color profile in this color specification box. -
getNativeNode
Creates anIIOMetadataNodefrom this color specification box. The format of this node is defined in the XML dtd and xsd for the JP2 image file.- Overrides:
getNativeNodein classBox
-
parse
protected void parse(byte[] data) Description copied from class:BoxParses the data elements from the byte array. The subclasses should override this method. -
compose
protected void compose()Description copied from class:BoxComposes the content byte array from the data elements.
-