colorspace.boxes
Class ComponentMappingBox

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

public final class ComponentMappingBox
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.Vector map
           
private  int nChannels
           
 
Fields inherited from class colorspace.boxes.JP2Box
boxEnd, boxStart, dataStart, eol, in, length, type
 
Constructor Summary
ComponentMappingBox(RandomAccessIO in, int boxStart)
          Construct a ComponentMappingBox from an input image.
 
Method Summary
private  int getCMP(byte[] mapping)
           
 int getCMP(int channel)
           
private  short getMTYP(byte[] mapping)
           
 short getMTYP(int channel)
          Return the channel type.
 int getNChannels()
           
private  short getPCOL(byte[] mapping)
           
 short getPCOL(int channel)
          Return the palette index for the channel.
(package 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

nChannels

private int nChannels

map

private java.util.Vector map
Constructor Detail

ComponentMappingBox

public ComponentMappingBox(RandomAccessIO in,
                           int boxStart)
                    throws java.io.IOException,
                           ColorSpaceException
Construct a ComponentMappingBox 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

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

java.io.IOException

getNChannels

public int getNChannels()

getCMP

public int getCMP(int channel)

getMTYP

public short getMTYP(int channel)
Return the channel type.


getPCOL

public short getPCOL(int channel)
Return the palette index for the channel.


toString

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

Overrides:
toString in class java.lang.Object

getCMP

private int getCMP(byte[] mapping)

getMTYP

private short getMTYP(byte[] mapping)

getPCOL

private short getPCOL(byte[] mapping)