001: /*
002: * $RCSfile: CBlkWTDataSrc.java,v $
003: * $Revision: 1.1 $
004: * $Date: 2005/02/11 05:02:30 $
005: * $State: Exp $
006: *
007: * Class: CBlkWTDataSrc
008: *
009: * Description: Interface that define methods for transfer of WT
010: * data in a code-block basis.
011: *
012: *
013: *
014: * COPYRIGHT:
015: *
016: * This software module was originally developed by Raphaël Grosbois and
017: * Diego Santa Cruz (Swiss Federal Institute of Technology-EPFL); Joel
018: * Askelöf (Ericsson Radio Systems AB); and Bertrand Berthelot, David
019: * Bouchard, Félix Henry, Gerard Mozelle and Patrice Onno (Canon Research
020: * Centre France S.A) in the course of development of the JPEG2000
021: * standard as specified by ISO/IEC 15444 (JPEG 2000 Standard). This
022: * software module is an implementation of a part of the JPEG 2000
023: * Standard. Swiss Federal Institute of Technology-EPFL, Ericsson Radio
024: * Systems AB and Canon Research Centre France S.A (collectively JJ2000
025: * Partners) agree not to assert against ISO/IEC and users of the JPEG
026: * 2000 Standard (Users) any of their rights under the copyright, not
027: * including other intellectual property rights, for this software module
028: * with respect to the usage by ISO/IEC and Users of this software module
029: * or modifications thereof for use in hardware or software products
030: * claiming conformance to the JPEG 2000 Standard. Those intending to use
031: * this software module in hardware or software products are advised that
032: * their use may infringe existing patents. The original developers of
033: * this software module, JJ2000 Partners and ISO/IEC assume no liability
034: * for use of this software module or modifications thereof. No license
035: * or right to this software module is granted for non JPEG 2000 Standard
036: * conforming products. JJ2000 Partners have full right to use this
037: * software module for his/her own purpose, assign or donate this
038: * software module to any third party and to inhibit third parties from
039: * using this software module for non JPEG 2000 Standard conforming
040: * products. This copyright notice must be included in all copies or
041: * derivative works of this software module.
042: *
043: * Copyright (c) 1999/2000 JJ2000 Partners.
044: *
045: *
046: *
047: */
048:
049: package jj2000.j2k.wavelet.analysis;
050:
051: import jj2000.j2k.image.*;
052: import jj2000.j2k.wavelet.*;
053:
054: /**
055: * This abstract class defines methods to transfer wavelet data in a
056: * code-block by code-block basis. In each call to 'getNextCodeBlock()' or
057: * 'getNextInternCodeBlock()' a new code-block is returned. The code-blocks
058: * are returned in no specific order.
059: *
060: * <P>This class is the source of data for the quantizer. See the 'Quantizer'
061: * class.
062: *
063: * <P>Note that no more of one object may request data, otherwise one object
064: * would get some of the data and another one another part, in no defined
065: * manner.
066: *
067: * @see ForwWTDataProps
068: *
069: * @see WaveletTransform
070: *
071: * @see jj2000.j2k.quantization.quantizer.CBlkQuantDataSrcEnc
072: *
073: * @see jj2000.j2k.quantization.quantizer.Quantizer
074: * */
075: public interface CBlkWTDataSrc extends ForwWTDataProps {
076:
077: /**
078: * Returns the position of the fixed point in the specified component, or
079: * equivalently the number of fractional bits. This is the position of the
080: * least significant integral (i.e. non-fractional) bit, which is
081: * equivalent to the number of fractional bits. For instance, for
082: * fixed-point values with 2 fractional bits, 2 is returned. For
083: * floating-point data this value does not apply and 0 should be
084: * returned. Position 0 is the position of the least significant bit in
085: * the data.
086: *
087: * @param n The index of the component.
088: *
089: * @return The position of the fixed-point, which is the same as
090: * the number of fractional bits. For floating-point data 0 is
091: * returned.
092: *
093: *
094: * */
095: public int getFixedPoint(int n);
096:
097: /** Return the data type of this CBlkWTDataSrc for the given
098: * component in the current tile. Its value should be either
099: * DataBlk.TYPE_INT or DataBlk.TYPE_FLOAT but can change
100: * according to the current tile-component.
101: *
102: * @param t Tile index
103: *
104: * @param c Component index
105: *
106: * @return Current data type
107: *
108: */
109: public int getDataType(int t, int c);
110:
111: /**
112: * Returns the next code-block in the current tile for the specified
113: * component, as a copy (see below). The order in which code-blocks are
114: * returned is not specified. However each code-block is returned only
115: * once and all code-blocks will be returned if the method is called 'N'
116: * times, where 'N' is the number of code-blocks in the tile. After all
117: * the code-blocks have been returned for the current tile calls to this
118: * method will return 'null'.
119: *
120: * <P>When changing the current tile (through 'setTile()' or 'nextTile()')
121: * this method will always return the first code-block, as if this method
122: * was never called before for the new current tile.
123: *
124: * <P>The data returned by this method is always a copy of the internal
125: * data of this object, if any, and it can be modified "in place" without
126: * any problems after being returned. The 'offset' of the returned data is
127: * 0, and the 'scanw' is the same as the code-block width. The 'magbits'
128: * of the returned data is not set by this method and should be
129: * ignored. See the 'CBlkWTData' class.
130: *
131: * <P>The 'ulx' and 'uly' members of the returned 'CBlkWTData' object
132: * contain the coordinates of the top-left corner of the block, with
133: * respect to the tile, not the subband.
134: *
135: * @param n The component for which to return the next code-block.
136: *
137: * @param cblk If non-null this object will be used to return the new
138: * code-block. If null a new one will be allocated and returned. If the
139: * "data" array of the object is non-null it will be reused, if possible,
140: * to return the data.
141: *
142: * @return The next code-block in the current tile for component 'n', or
143: * null if all code-blocks for the current tile have been returned.
144: *
145: * @see CBlkWTData
146: *
147: *
148: * */
149: public abstract CBlkWTData getNextCodeBlock(int n, CBlkWTData cblk);
150:
151: /**
152: * Returns the next code-block in the current tile for the specified
153: * component. The order in which code-blocks are returned is not
154: * specified. However each code-block is returned only once and all
155: * code-blocks will be returned if the method is called 'N' times, where
156: * 'N' is the number of code-blocks in the tile. After all the code-blocks
157: * have been returned for the current tile calls to this method will
158: * return 'null'.
159: *
160: * <P>When changing the current tile (through 'setTile()' or 'nextTile()')
161: * this method will always return the first code-block, as if this method
162: * was never called before for the new current tile.
163: *
164: * <P>The data returned by this method can be the data in the internal
165: * buffer of this object, if any, and thus can not be modified by the
166: * caller. The 'offset' and 'scanw' of the returned data can be
167: * arbitrary. The 'magbits' of the returned data is not set by this method
168: * and should be ignored. See the 'CBlkWTData' class.
169: *
170: * <P>The 'ulx' and 'uly' members of the returned 'CBlkWTData' object
171: * contain the coordinates of the top-left corner of the block, with
172: * respect to the tile, not the subband.
173: *
174: * @param n The component for which to return the next code-block.
175: *
176: * @param cblk If non-null this object will be used to return the new
177: * code-block. If null a new one will be allocated and returned. If the
178: * "data" array of the object is non-null it will be reused, if possible,
179: * to return the data.
180: *
181: * @return The next code-block in the current tile for component 'n', or
182: * null if all code-blocks for the current tile have been returned.
183: *
184: * @see CBlkWTData
185: *
186: *
187: * */
188: public abstract CBlkWTData getNextInternCodeBlock(int n,
189: CBlkWTData cblk);
190:
191: }
|