Class ColorSpecificationBox
- java.lang.Object
-
- com.sun.media.imageioimpl.plugins.jpeg2000.Box
-
- com.sun.media.imageioimpl.plugins.jpeg2000.ColorSpecificationBox
-
public class ColorSpecificationBox extends Box
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.
-
-
Constructor Summary
Constructors Constructor Description ColorSpecificationBox(byte[] data)
Creates aColorSpecificationBox
from the provided byte array.ColorSpecificationBox(byte m, byte p, byte a, int ecs, ICC_Profile profile)
Creates aColorSpecificationBox
from the provided data elements.ColorSpecificationBox(Node node)
Constructs aColorSpecificationBox
based on the providedorg.w3c.dom.Node
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
compose()
Composes the content byte array from the data elements.byte
getApproximationAccuracy()
ReturnsApproximationAccuracy
.static String[]
getElementNames()
This method will be called by the getNativeNodeForSimpleBox of the class Box to get the element names.int
getEnumeratedColorSpace()
Returns the enumerated color space.ICC_Profile
getICCProfile()
Returns the ICC color profile in this color specification box.byte
getMethod()
Returns the method to define the color space.IIOMetadataNode
getNativeNode()
Creates anIIOMetadataNode
from this color specification box.byte
getPrecedence()
ReturnsPrecedence
.protected void
parse(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 Detail
-
ECS_sRGB
public static final int ECS_sRGB
The enumerated color space defined in JP2 file format.- See Also:
- Constant Field Values
-
ECS_GRAY
public static final int ECS_GRAY
- See Also:
- Constant Field Values
-
ECS_YCC
public static final int ECS_YCC
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ColorSpecificationBox
public ColorSpecificationBox(byte m, byte p, byte a, int ecs, ICC_Profile profile)
Creates aColorSpecificationBox
from the provided data elements.
-
ColorSpecificationBox
public ColorSpecificationBox(byte[] data)
Creates aColorSpecificationBox
from the provided byte array.
-
ColorSpecificationBox
public ColorSpecificationBox(Node node) throws IIOInvalidTreeException
Constructs aColorSpecificationBox
based on the providedorg.w3c.dom.Node
.- Throws:
IIOInvalidTreeException
-
-
Method Detail
-
getElementNames
public static String[] 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
public ICC_Profile getICCProfile()
Returns the ICC color profile in this color specification box.
-
getNativeNode
public IIOMetadataNode getNativeNode()
Creates anIIOMetadataNode
from this color specification box. The format of this node is defined in the XML dtd and xsd for the JP2 image file.- Overrides:
getNativeNode
in classBox
-
parse
protected void parse(byte[] data)
Description copied from class:Box
Parses the data elements from the byte array. The subclasses should override this method.
-
-