colorspace.boxes
Class PaletteBox

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

public final class PaletteBox
extends JP2Box

This class models the palette box contained in a JP2 image.


Nested Class Summary
 
Nested classes inherited from class colorspace.boxes.JP2Box
JP2Box.BoxType
 
Field Summary
private  short[] bitdepth
           
private  int[][] entries
           
private  int ncolumns
           
private  int nentries
           
 
Fields inherited from class colorspace.boxes.JP2Box
boxEnd, boxStart, dataStart, eol, in, length, type
 
Constructor Summary
PaletteBox(RandomAccessIO in, int boxStart)
          Construct a PaletteBox from an input image.
 
Method Summary
 short getBitDepth(int column)
          Return the bitdepth of palette entries.
 int getEntry(int column, int entry)
          Return an entry for a given index and column.
private  int getEntrySize(int column)
           
 int getNumColumns()
          Return the number of palette columns.
 int getNumEntries()
          Return the number of palette entries.
 boolean isSigned(int column)
          Are entries signed predicate.
 boolean isUnSigned(int column)
          Are entries unsigned predicate.
(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

nentries

private int nentries

ncolumns

private int ncolumns

bitdepth

private short[] bitdepth

entries

private int[][] entries
Constructor Detail

PaletteBox

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

java.io.IOException
ColorSpaceException

getNumEntries

public int getNumEntries()
Return the number of palette entries.


getNumColumns

public int getNumColumns()
Return the number of palette columns.


isSigned

public boolean isSigned(int column)
Are entries signed predicate.


isUnSigned

public boolean isUnSigned(int column)
Are entries unsigned predicate.


getBitDepth

public short getBitDepth(int column)
Return the bitdepth of palette entries.


getEntry

public int getEntry(int column,
                    int entry)
Return an entry for a given index and column.


toString

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

Overrides:
toString in class java.lang.Object

getEntrySize

private int getEntrySize(int column)