Class ChannelDefinitionBox
- java.lang.Object
-
- com.sun.media.imageioimpl.plugins.jpeg2000.Box
-
- com.sun.media.imageioimpl.plugins.jpeg2000.ChannelDefinitionBox
-
public class ChannelDefinitionBox extends Box
This class is designed to represent a Channel Definition Box of JPEG JP2 file format. A Channel Definition Box has a length, and a fixed type of "cdef". Its content defines the type of the image channels: color channel, alpha channel or premultiplied alpha channel.
-
-
Field Summary
-
Fields inherited from class com.sun.media.imageioimpl.plugins.jpeg2000.Box
data, extraLength, length, type
-
-
Constructor Summary
Constructors Constructor Description ChannelDefinitionBox(byte[] data)
Constructs aChannelDefinitionBox
based on the provided content in byte array.ChannelDefinitionBox(short[] channel, short[] types, short[] associations)
Constructs aChannelDefinitionBox
based on the provided channel definitions.ChannelDefinitionBox(ColorModel colorModel)
Constructs aChannelDefinitionBox
based on the providedColorModel
.ChannelDefinitionBox(Node node)
Constructs aChannelDefinitionBox
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.static void
fillBasedOnBands(int numComps, boolean isPremultiplied, short[] c, short[] t, short[] a)
Fills the channel definitions into the arrays based on the number of components and isPremultiplied.short[]
getAssociation()
Returns the association which associates a color channel to a color component in the color space of the image.short[]
getChannel()
Returns the defined channels.IIOMetadataNode
getNativeNode()
Creates anIIOMetadataNode
from this channel definition box.short[]
getTypes()
Returns the channel types.protected void
parse(byte[] data)
Parse the channel definitions from the 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
-
ChannelDefinitionBox
public ChannelDefinitionBox(ColorModel colorModel)
Constructs aChannelDefinitionBox
based on the providedColorModel
.
-
ChannelDefinitionBox
public ChannelDefinitionBox(byte[] data)
Constructs aChannelDefinitionBox
based on the provided content in byte array.
-
ChannelDefinitionBox
public ChannelDefinitionBox(short[] channel, short[] types, short[] associations)
Constructs aChannelDefinitionBox
based on the provided channel definitions.
-
ChannelDefinitionBox
public ChannelDefinitionBox(Node node) throws IIOInvalidTreeException
Constructs aChannelDefinitionBox
based on the providedorg.w3c.dom.Node
.- Throws:
IIOInvalidTreeException
-
-
Method Detail
-
fillBasedOnBands
public static void fillBasedOnBands(int numComps, boolean isPremultiplied, short[] c, short[] t, short[] a)
Fills the channel definitions into the arrays based on the number of components and isPremultiplied.
-
parse
protected void parse(byte[] data)
Parse the channel definitions from the content data array.
-
getChannel
public short[] getChannel()
Returns the defined channels.
-
getTypes
public short[] getTypes()
Returns the channel types.
-
getAssociation
public short[] getAssociation()
Returns the association which associates a color channel to a color component in the color space of the image.
-
getNativeNode
public IIOMetadataNode getNativeNode()
Creates anIIOMetadataNode
from this channel definition box. The format of this node is defined in the XML dtd and xsd for the JP2 image file.- Overrides:
getNativeNode
in classBox
-
-