Class 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.
    • Constructor Detail

      • ChannelDefinitionBox

        public ChannelDefinitionBox​(ColorModel colorModel)
        Constructs a ChannelDefinitionBox based on the provided ColorModel.
      • ChannelDefinitionBox

        public ChannelDefinitionBox​(byte[] data)
        Constructs a ChannelDefinitionBox based on the provided content in byte array.
      • ChannelDefinitionBox

        public ChannelDefinitionBox​(short[] channel,
                                    short[] types,
                                    short[] associations)
        Constructs a ChannelDefinitionBox based on the provided channel definitions.
    • 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.
        Overrides:
        parse in class Box
      • 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 an IIOMetadataNode 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 class Box
      • compose

        protected void compose()
        Description copied from class: Box
        Composes the content byte array from the data elements.
        Overrides:
        compose in class Box