colorspace.boxes
Class ChannelDefinitionBox

java.lang.Object
  |
  +--colorspace.boxes.JP2Box
        |
        +--colorspace.boxes.ChannelDefinitionBox

public final class ChannelDefinitionBox
extends JP2Box

This class maps the components in the codestream to channels in the image. It models the Component Mapping box in the JP2 header.


Nested Class Summary
 
Nested classes inherited from class colorspace.boxes.JP2Box
JP2Box.BoxType
 
Field Summary
private  java.util.Hashtable definitions
           
private  int ndefs
           
 
Fields inherited from class colorspace.boxes.JP2Box
boxEnd, boxStart, dataStart, eol, in, length, type
 
Constructor Summary
ChannelDefinitionBox(RandomAccessIO in, int boxStart)
          Construct a ChannelDefinitionBox from an input image.
 
Method Summary
private  int getAsoc(byte[] bfr)
          Return the associated channel from the record.
 int getAsoc(int channel)
           
private  int getAsoc(int[] bfr)
           
private  int getCn(byte[] bfr)
          Return the channel from the record.
 int getCn(int asoc)
           
private  int getCn(int[] bfr)
           
 int getNDefs()
           
private  int getTyp(byte[] bfr)
          Return the channel type from the record.
 int getTyp(int channel)
           
private  int getTyp(int[] bfr)
           
private  void readBox()
          Analyze the box content.
 java.lang.String toString()
          Return a suitable String representation of the class instance.
 
Methods inherited from class colorspace.boxes.JP2Box
getTypeString, getTypeString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ndefs

private int ndefs

definitions

private java.util.Hashtable definitions
Constructor Detail

ChannelDefinitionBox

public ChannelDefinitionBox(RandomAccessIO in,
                            int boxStart)
                     throws java.io.IOException,
                            ColorSpaceException
Construct a ChannelDefinitionBox from an input image.

Parameters:
in - RandomAccessIO jp2 image
boxStart - offset to the start of the box in the image
Throws:
IOException, - ColorSpaceException
java.io.IOException
ColorSpaceException
Method Detail

readBox

private void readBox()
              throws java.io.IOException
Analyze the box content.

java.io.IOException

getNDefs

public int getNDefs()

getCn

public int getCn(int asoc)

getTyp

public int getTyp(int channel)

getAsoc

public int getAsoc(int channel)

toString

public java.lang.String toString()
Return a suitable String representation of the class instance.

Overrides:
toString in class java.lang.Object

getCn

private int getCn(byte[] bfr)
Return the channel from the record.


getTyp

private int getTyp(byte[] bfr)
Return the channel type from the record.


getAsoc

private int getAsoc(byte[] bfr)
Return the associated channel from the record.


getCn

private int getCn(int[] bfr)

getTyp

private int getTyp(int[] bfr)

getAsoc

private int getAsoc(int[] bfr)