jp2codec.entropy
Class PrecinctSizeSpec

java.lang.Object
  extended by jp2codec.ModuleSpec
      extended by jp2codec.entropy.PrecinctSizeSpec

public class PrecinctSizeSpec
extends ModuleSpec

This class extends ModuleSpec class for precinct partition sizes holding purposes.

It stores the size a of precinct when precinct partition is used or not. If precinct partition is used, we can have several packets for a given resolution level whereas there is only one packet per resolution level if no precinct partition is used.


Field Summary
 
Fields inherited from class jp2codec.ModuleSpec
compDef, def, nComp, nTiles, SPEC_COMP_DEF, SPEC_DEF, SPEC_TILE_COMP, SPEC_TILE_DEF, SPEC_TYPE_COMP, SPEC_TYPE_TILE, SPEC_TYPE_TILE_COMP, specType, specValType, tileCompVal, tileDef
 
Constructor Summary
PrecinctSizeSpec(int nt, int nc, byte type, IntegerSpec dls)
          Creates a new PrecinctSizeSpec object for the specified number of tiles and components.
 
Method Summary
 int getPPX(int t, int c, int rl)
          Returns the precinct partition width in component 'n' and tile 't' at resolution level 'rl'.
 int getPPY(int t, int c, int rl)
          Returns the precinct partition height in component 'n' and tile 't' at resolution level 'rl'.
 
Methods inherited from class jp2codec.ModuleSpec
getCompDef, getCompDefRep, getDefault, getDefRep, getSpec, getSpecValType, getTileCompVal, getTileDef, getTileDefRep, isCompSpecified, isTileCompSpecified, isTileSpecified, parseIdx, setCompDef, setDefault, setTileCompVal, setTileDef
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrecinctSizeSpec

public PrecinctSizeSpec(int nt,
                        int nc,
                        byte type,
                        IntegerSpec dls)
Creates a new PrecinctSizeSpec object for the specified number of tiles and components.

Parameters:
nt - The number of tiles
nc - The number of components
type - the type of the specification module i.e. tile specific, component specific or both.
dls - Reference to the number of decomposition levels specification
Method Detail

getPPX

public int getPPX(int t,
                  int c,
                  int rl)
Returns the precinct partition width in component 'n' and tile 't' at resolution level 'rl'. If the tile index is equal to -1 or if the component index is equal to -1 it means that those should not be taken into account.

Parameters:
t - The tile index, in raster scan order. Specify -1 if it is not a specific tile.
c - The component index. Specify -1 if it is not a specific component.
rl - The resolution level
Returns:
The precinct partition width in component 'c' and tile 't' at resolution level 'rl'.

getPPY

public int getPPY(int t,
                  int c,
                  int rl)
Returns the precinct partition height in component 'n' and tile 't' at resolution level 'rl'. If the tile index is equal to -1 or if the component index is equal to -1 it means that those should not be taken into account.

Parameters:
t - The tile index, in raster scan order. Specify -1 if it is not a specific tile.
c - The component index. Specify -1 if it is not a specific component.
rl - The resolution level.
Returns:
The precinct partition width in component 'n' and tile 't' at resolution level 'rl'.