Class ColorSpecificationBox
- java.lang.Object
-
- com.github.jaiimageio.jpeg2000.impl.Box
-
- com.github.jaiimageio.jpeg2000.impl.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 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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcompose()Composes the content byte array from the data elements.bytegetApproximationAccuracy()ReturnsApproximationAccuracy.static String[]getElementNames()This method will be called by the getNativeNodeForSimpleBox of the class Box to get the element names.intgetEnumeratedColorSpace()Returns the enumerated color space.ICC_ProfilegetICCProfile()Returns the ICC color profile in this color specification box.bytegetMethod()Returns the method to define the color space.IIOMetadataNodegetNativeNode()Creates anIIOMetadataNodefrom this color specification box.bytegetPrecedence()ReturnsPrecedence.protected voidparse(byte[] data)Parses the data elements from the byte array.-
Methods inherited from class com.github.jaiimageio.jpeg2000.impl.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 aColorSpecificationBoxfrom the provided data elements.
-
ColorSpecificationBox
public ColorSpecificationBox(byte[] data)
Creates aColorSpecificationBoxfrom the provided byte array.
-
ColorSpecificationBox
public ColorSpecificationBox(Node node) throws IIOInvalidTreeException
Constructs aColorSpecificationBoxbased 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 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.
-
-