Class ChannelDefinitionBox
java.lang.Object
com.sun.media.imageioimpl.plugins.jpeg2000.Box
com.sun.media.imageioimpl.plugins.jpeg2000.ChannelDefinitionBox
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
ConstructorsConstructorDescriptionChannelDefinitionBox(byte[] data) Constructs aChannelDefinitionBoxbased on the provided content in byte array.ChannelDefinitionBox(short[] channel, short[] types, short[] associations) Constructs aChannelDefinitionBoxbased on the provided channel definitions.ChannelDefinitionBox(ColorModel colorModel) Constructs aChannelDefinitionBoxbased on the providedColorModel.ChannelDefinitionBox(Node node) Constructs aChannelDefinitionBoxbased on the providedorg.w3c.dom.Node. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcompose()Composes the content byte array from the data elements.static voidfillBasedOnBands(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[]Returns the association which associates a color channel to a color component in the color space of the image.short[]Returns the defined channels.Creates anIIOMetadataNodefrom this channel definition box.short[]getTypes()Returns the channel types.protected voidparse(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 Details
-
ChannelDefinitionBox
Constructs aChannelDefinitionBoxbased on the providedColorModel. -
ChannelDefinitionBox
public ChannelDefinitionBox(byte[] data) Constructs aChannelDefinitionBoxbased on the provided content in byte array. -
ChannelDefinitionBox
public ChannelDefinitionBox(short[] channel, short[] types, short[] associations) Constructs aChannelDefinitionBoxbased on the provided channel definitions. -
ChannelDefinitionBox
Constructs aChannelDefinitionBoxbased on the providedorg.w3c.dom.Node.- Throws:
IIOInvalidTreeException
-
-
Method Details
-
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
Creates anIIOMetadataNodefrom this channel definition box. The format of this node is defined in the XML dtd and xsd for the JP2 image file.- Overrides:
getNativeNodein classBox
-
compose
protected void compose()Description copied from class:BoxComposes the content byte array from the data elements.
-