| java.lang.Object jj2000.j2k.ModuleSpec
All known Subclasses: jj2000.j2k.wavelet.synthesis.SynWTFilterSpec, jj2000.j2k.quantization.QuantTypeSpec, jj2000.j2k.entropy.ProgressionSpec, jj2000.j2k.wavelet.analysis.AnWTFilterSpec, jj2000.j2k.roi.MaxShiftSpec, jj2000.j2k.quantization.GuardBitsSpec, jj2000.j2k.image.CompTransfSpec, jj2000.j2k.quantization.QuantStepSizeSpec, jj2000.j2k.IntegerSpec, jj2000.j2k.entropy.PrecinctSizeSpec, jj2000.j2k.entropy.CBlkSizeSpec, jj2000.j2k.StringSpec,
ModuleSpec | public class ModuleSpec implements Cloneable(Code) | | This generic class is used to handle values to be used by a module for each
tile and component. It uses attribute to determine which value to use. It
should be extended by each module needing this feature.
This class might be used for values that are only tile specific or
component specific but not both.
The attributes to use are defined by a hierarchy. The hierarchy is:
- Tile and component specific attribute
- Tile specific default attribute
- Component main default attribute
- Main default attribute
|
Constructor Summary | |
public | ModuleSpec(int nt, int nc, byte type) Constructs a 'ModuleSpec' object, initializing all the components and
tiles to the 'SPEC_DEF' spec val type, for the specified number of
components and tiles.
Parameters: nt - The number of tiles Parameters: nc - The number of components Parameters: type - the type of the specification module i.e. |
Method Summary | |
protected Object | clone() | public Object | getCompDef(int c) Gets default value of the specified component. | public ModuleSpec | getCopy() | public Object | getDefault() Gets default value for this module. | protected Object | getSpec(int t, int c) Gets value of specified tile-component without knowing if a
specific tile-component value has been previously entered. | public byte | getSpecValType(int t, int c) Return the spec type of the given tile-component. | public Object | getTileCompVal(int t, int c) Gets value of specified tile-component. | public Object | getTileDef(int t) Gets default value of the specified tile. | public boolean | isCompSpecified(int c) Whether or not specifications have been entered for the given
component. | public boolean | isTileCompSpecified(int t, int c) | public boolean | isTileSpecified(int t) Whether or not specifications have been entered for the given
tile. | final public static boolean[] | parseIdx(String word, int maxIdx) This method is responsible of parsing tile indexes set and
component indexes set for an option. | public void | rotate90(Point anT) Rotate the ModuleSpec instance by 90 degrees (this modifies only tile
and tile-component specifications).
Parameters: nT - Number of tiles along horizontal and vertical axis afterrotation. | public void | setCompDef(int c, Object value) Sets default value for specified component and specValType tag if
allowed by its priority. | public void | setDefault(Object value) | public void | setTileCompVal(int t, int c, Object value) Sets value for specified tile-component. | public void | setTileDef(int t, Object value) Sets default value for specified tile and specValType tag if
allowed by its priority. |
SPEC_COMP_DEF | final public static byte SPEC_COMP_DEF(Code) | | The identifier for "component default" specification
|
SPEC_DEF | final public static byte SPEC_DEF(Code) | | The identifier for default specification
|
SPEC_TILE_COMP | final public static byte SPEC_TILE_COMP(Code) | | The identifier for a "tile-component" specification
|
SPEC_TILE_DEF | final public static byte SPEC_TILE_DEF(Code) | | The identifier for "tile default" specification
|
SPEC_TYPE_COMP | final public static byte SPEC_TYPE_COMP(Code) | | The identifier for a specification module that applies only to
components
|
SPEC_TYPE_TILE | final public static byte SPEC_TYPE_TILE(Code) | | The identifier for a specification module that applies only to
tiles
|
SPEC_TYPE_TILE_COMP | final public static byte SPEC_TYPE_TILE_COMP(Code) | | The identifier for a specification module that applies both to
tiles and components
|
compDef | protected Object[] compDef(Code) | | The default value for each component. Null if no component
specific value is defined
|
def | protected Object def(Code) | | Default value for each tile-component
|
nComp | protected int nComp(Code) | | The number of components
|
nTiles | protected int nTiles(Code) | | The number of tiles
|
specType | protected int specType(Code) | | The type of the specification module
|
specValType | protected byte[][] specValType(Code) | | The spec type for each tile-component. The first index is
the tile index, the second is the component index.
|
specified | protected String specified(Code) | | The specified value in string format
|
tileCompVal | protected Hashtable tileCompVal(Code) | | The specific value for each tile-component. Value of tile 16 component
3 is accessible through the hash value "t16c3". Null if no
tile-component specific value is defined
|
tileDef | protected Object[] tileDef(Code) | | The default value for each tile. Null if no tile specific
value is defined
|
ModuleSpec | public ModuleSpec(int nt, int nc, byte type)(Code) | | Constructs a 'ModuleSpec' object, initializing all the components and
tiles to the 'SPEC_DEF' spec val type, for the specified number of
components and tiles.
Parameters: nt - The number of tiles Parameters: nc - The number of components Parameters: type - the type of the specification module i.e. tile specific,component specific or both. |
getCompDef | public Object getCompDef(int c)(Code) | | Gets default value of the specified component. If no specification have
been entered for this component, returns default value.
Parameters: c - Component index The default value for this component (Must be casted beforeuse) See Also: ModuleSpec.setCompDef |
getDefault | public Object getDefault()(Code) | | Gets default value for this module.
The default value (Must be casted before use) |
getSpec | protected Object getSpec(int t, int c)(Code) | | Gets value of specified tile-component without knowing if a
specific tile-component value has been previously entered. It
first check if a tile-component specific value has been
entered, then if a tile specific value exist, then if a
component specific value exist. If not the default value is
returned.
Parameters: t - Tile index Parameters: c - Component index Value for this tile component. |
getSpecValType | public byte getSpecValType(int t, int c)(Code) | | Return the spec type of the given tile-component.
Parameters: t - Tile index Parameters: c - Component index |
getTileCompVal | public Object getTileCompVal(int t, int c)(Code) | | Gets value of specified tile-component. This method calls getSpec but
has a public access.
Parameters: t - Tile index Parameters: c - Component index The value of this tile-component (Must be casted before use) See Also: ModuleSpec.setTileCompVal See Also: ModuleSpec.getSpec |
getTileDef | public Object getTileDef(int t)(Code) | | Gets default value of the specified tile. If no specification
has been entered, it returns the default value.
Parameters: t - Tile index The default value for this tile (Must be casted before use) See Also: ModuleSpec.setTileDef |
isCompSpecified | public boolean isCompSpecified(int c)(Code) | | Whether or not specifications have been entered for the given
component.
Parameters: c - Index of the component True if component specification has been defined |
isTileCompSpecified | public boolean isTileCompSpecified(int t, int c)(Code) | | Whether or not a tile-component specification has been defined
Parameters: t - Tile index Parameters: c - Component index True if a tile-component specification has been defined. |
isTileSpecified | public boolean isTileSpecified(int t)(Code) | | Whether or not specifications have been entered for the given
tile.
Parameters: t - Index of the tile True if tile specification has been entered |
parseIdx | final public static boolean[] parseIdx(String word, int maxIdx)(Code) | | This method is responsible of parsing tile indexes set and
component indexes set for an option. Such an argument must
follow the following policy:
t\ or c\ where
tile or component indexes are separated by commas or a
dashes.
Example:
t0,3,4 means tiles with indexes 0, 3 and 4.
t2-4 means tiles with indexes 2,3 and 4.
It returns a boolean array skteching which tile or component are
concerned by the next parameters.
Parameters: word - The word to parse. Parameters: maxIdx - Maximum authorized index Indexes concerned by this parameter. |
rotate90 | public void rotate90(Point anT)(Code) | | Rotate the ModuleSpec instance by 90 degrees (this modifies only tile
and tile-component specifications).
Parameters: nT - Number of tiles along horizontal and vertical axis afterrotation. |
setCompDef | public void setCompDef(int c, Object value)(Code) | | Sets default value for specified component and specValType tag if
allowed by its priority.
Parameters: c - Component index |
setDefault | public void setDefault(Object value)(Code) | | Sets default value for this module
|
setTileCompVal | public void setTileCompVal(int t, int c, Object value)(Code) | | Sets value for specified tile-component.
Parameters: t - Tie index Parameters: c - Component index |
setTileDef | public void setTileDef(int t, Object value)(Code) | | Sets default value for specified tile and specValType tag if
allowed by its priority.
Parameters: c - Tile index. |
|
|