| java.lang.Object jj2000.j2k.image.ImgDataAdapter jj2000.j2k.roi.encoder.ROIScaler
ROIScaler | public class ROIScaler extends ImgDataAdapter implements CBlkQuantDataSrcEnc(Code) | | This class deals with the ROI functionality.
The ROI method is the Maxshift method. The ROIScaler works by scaling
the quantized wavelet coefficients that do not affect the ROI (i.e
background coefficients) so that these samples get a lower significance
than the ROI ones. By scaling the coefficients sufficiently, the ROI
coefficients can be recognized by their amplitude alone and no ROI mask
needs to be generated at the decoder side.
The source module must be a quantizer and code-block's data is exchange
with thanks to CBlkWTData instances.
See Also: Quantizer See Also: CBlkWTData |
Method Summary | |
public static ROIScaler | createInstance(Quantizer src, J2KImageWriteParamJava wp) Creates a ROIScaler object. | public SubbandAn | getAnSubbandTree(int t, int c) Returns a reference to the subband tree structure representing the
subband decomposition for the specified tile-component.
Parameters: t - The index of the tile. Parameters: c - The index of the component. | public boolean | getBlockAligned() | public int | getCbULX() Returns the horizontal offset of the code-block partition. | public int | getCbULY() Returns the vertical offset of the code-block partition. | public CBlkWTData | getNextCodeBlock(int n, CBlkWTData cblk) This function gets a datablk from the entropy coder. | public CBlkWTData | getNextInternCodeBlock(int c, CBlkWTData cblk) This function gets a datablk from the entropy coder. | public static String[][] | getParameterInfo() Returns the parameters that are used in this class and
implementing classes. | public ROIMaskGenerator | getROIMaskGenerator() This function returns the ROI mask generator. | public boolean | isReversible(int t, int c) Since ROI scaling is always a reversible operation, it calls
isReversible() method of it source (the quantizer module). | public void | nextTile() Advances to the next tile, in standard scan-line order (by rows then
columns). | protected static Vector | parseROIs(String roiopt, int nc, Vector roiVector) This function parses the values given for the ROIs with the argument
-Rroi. | public void | setTile(int x, int y) Changes the current tile, given the new indexes. | public boolean | useRoi() |
OPT_PREFIX | final public static char OPT_PREFIX(Code) | | The prefix for ROI Scaler options: 'R'
|
ROIScaler | public ROIScaler(Quantizer src, ROIMaskGenerator mg, boolean roi, int sLev, boolean uba, J2KImageWriteParamJava wp)(Code) | | Constructor of the ROI scaler, takes a Quantizer as source of data to
scale.
Parameters: src - The quantizer that is the source of data. Parameters: mg - The mask generator that will be used for all components Parameters: roi - Flag indicating whether there are rois specified. Parameters: sLev - The resolution levels that belong entirely to ROI Parameters: uba - Flag indicating whether block aligning is used. Parameters: encSpec - The encoder specifications for addition of roi specs |
createInstance | public static ROIScaler createInstance(Quantizer src, J2KImageWriteParamJava wp)(Code) | | Creates a ROIScaler object. The Quantizer is the source of data to
scale.
The ROI Scaler creates a ROIMaskGenerator depending on what ROI
information is in the J2KImageWriteParamJava. If only rectangular ROI are used,
the fast mask generator for rectangular ROI can be used.
Parameters: src - The source of data to scale Parameters: pl - The parameter list (or options). Parameters: encSpec - The encoder specifications for addition of roi specs exception: IllegalArgumentException - If an error occurs while parsingthe options in 'pl' |
getAnSubbandTree | public SubbandAn getAnSubbandTree(int t, int c)(Code) | | Returns a reference to the subband tree structure representing the
subband decomposition for the specified tile-component.
Parameters: t - The index of the tile. Parameters: c - The index of the component. The subband tree structure, see SubbandAn. See Also: SubbandAn See Also: Subband |
getBlockAligned | public boolean getBlockAligned()(Code) | | This function returns the blockAligned flag
Flag indicating whether the ROIs were block aligned |
getCbULX | public int getCbULX()(Code) | | Returns the horizontal offset of the code-block partition. Allowable
values are 0 and 1, nothing else.
|
getCbULY | public int getCbULY()(Code) | | Returns the vertical offset of the code-block partition. Allowable
values are 0 and 1, nothing else.
|
getNextCodeBlock | public CBlkWTData getNextCodeBlock(int n, CBlkWTData cblk)(Code) | | This function gets a datablk from the entropy coder. The sample sin the
block, which consists of the quantized coefficients from the quantizer,
are scaled by the values given for any ROIs specified.
The function calls on a ROIMaskGenerator to get the mask for
scaling the coefficients in the current block.
The data returned by this method is a copy of the orignal
data. Therfore it can be modified "in place" without any problems after
being returned. The 'offset' of the returned data is 0, and the 'scanw'
is the same as the code-block width. See the 'CBlkWTData' class.
Parameters: n - The component for which to return the next code-block. Parameters: cblk - If non-null this object will be used to return the newcode-block. If null a new one will be allocated and returned. If the"data" array of the object is non-null it will be reused, if possible,to return the data. The next code-block in the current tile for component 'n', ornull if all code-blocks for the current tile have been returned. See Also: CBlkWTData |
getNextInternCodeBlock | public CBlkWTData getNextInternCodeBlock(int c, CBlkWTData cblk)(Code) | | This function gets a datablk from the entropy coder. The sample sin the
block, which consists of the quantized coefficients from the quantizer,
are scaled by the values given for any ROIs specified.
The function calls on a ROIMaskGenerator to get the mask for
scaling the coefficients in the current block.
Parameters: c - The component for which to return the next code-block. Parameters: cblk - If non-null this object will be used to return the newcode-block. If null a new one will be allocated and returned. If the"data" array of the object is non-null it will be reused, if possible,to return the data. The next code-block in the current tile for component 'n', ornull if all code-blocks for the current tile have been returned. See Also: CBlkWTData |
getParameterInfo | public static String[][] getParameterInfo()(Code) | | Returns the parameters that are used in this class and
implementing classes. It returns a 2D String array. Each of the
1D arrays is for a different option, and they have 3
elements. The first element is the option name, the second one
is the synopsis, the third one is a long description of what
the parameter is and the fourth is its default value. The
synopsis or description may be 'null', in which case it is
assumed that there is no synopsis or description of the option,
respectively. Null may be returned if no options are supported.
the options name, their synopsis and their explanation,or null if no options are supported. |
getROIMaskGenerator | public ROIMaskGenerator getROIMaskGenerator()(Code) | | This function returns the ROI mask generator.
The roi mask generator |
isReversible | public boolean isReversible(int t, int c)(Code) | | Since ROI scaling is always a reversible operation, it calls
isReversible() method of it source (the quantizer module).
Parameters: t - The tile to test for reversibility Parameters: c - The component to test for reversibility True if the quantized data is reversible, false if not. |
nextTile | public void nextTile()(Code) | | Advances to the next tile, in standard scan-line order (by rows then
columns). An NoNextElementException is thrown if the current tile is
the last one (i.e. there is no next tile).
|
parseROIs | protected static Vector parseROIs(String roiopt, int nc, Vector roiVector)(Code) | | This function parses the values given for the ROIs with the argument
-Rroi. Currently only circular and rectangular ROIs are supported.
A rectangular ROI is indicated by a 'R' followed the coordinates
for the upper left corner of the ROI and then its width and height.
A circular ROI is indicated by a 'C' followed by the coordinates of
the circle center and then the radius.
Before the R and C values, the component that are affected by the
ROI are indicated.
Parameters: roiopt - The info on the ROIs Parameters: nc - number of components Parameters: roiVector - The vcector containing the ROI parsed from the cmd line The ROIs specified in roiopt |
setTile | public void setTile(int x, int y)(Code) | | Changes the current tile, given the new indexes. An
IllegalArgumentException is thrown if the indexes do not
correspond to a valid tile.
Parameters: x - The horizontal index of the tile. Parameters: y - The vertical index of the new tile. |
useRoi | public boolean useRoi()(Code) | | This function returns the flag indicating if any ROI functionality used
Flag indicating whether there are ROIs in the image |
|
|