corrade-vassal – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 vero 1 /*
2 * CVS identifier:
3 *
4 * $Id: MultiResImgDataAdapter.java,v 1.10 2002/07/25 15:11:55 grosbois Exp $
5 *
6 * Class: MultiResImgDataAdapter
7 *
8 * Description: A default implementation of the MultiResImgData
9 * interface that has and MultiResImgData source
10 * and just returns the values of the source.
11 *
12 *
13 *
14 * COPYRIGHT:
15 *
16 * This software module was originally developed by Raphaël Grosbois and
17 * Diego Santa Cruz (Swiss Federal Institute of Technology-EPFL); Joel
18 * Askelöf (Ericsson Radio Systems AB); and Bertrand Berthelot, David
19 * Bouchard, Félix Henry, Gerard Mozelle and Patrice Onno (Canon Research
20 * Centre France S.A) in the course of development of the JPEG2000
21 * standard as specified by ISO/IEC 15444 (JPEG 2000 Standard). This
22 * software module is an implementation of a part of the JPEG 2000
23 * Standard. Swiss Federal Institute of Technology-EPFL, Ericsson Radio
24 * Systems AB and Canon Research Centre France S.A (collectively JJ2000
25 * Partners) agree not to assert against ISO/IEC and users of the JPEG
26 * 2000 Standard (Users) any of their rights under the copyright, not
27 * including other intellectual property rights, for this software module
28 * with respect to the usage by ISO/IEC and Users of this software module
29 * or modifications thereof for use in hardware or software products
30 * claiming conformance to the JPEG 2000 Standard. Those intending to use
31 * this software module in hardware or software products are advised that
32 * their use may infringe existing patents. The original developers of
33 * this software module, JJ2000 Partners and ISO/IEC assume no liability
34 * for use of this software module or modifications thereof. No license
35 * or right to this software module is granted for non JPEG 2000 Standard
36 * conforming products. JJ2000 Partners have full right to use this
37 * software module for his/her own purpose, assign or donate this
38 * software module to any third party and to inhibit third parties from
39 * using this software module for non JPEG 2000 Standard conforming
40 * products. This copyright notice must be included in all copies or
41 * derivative works of this software module.
42 *
43 * Copyright (c) 1999/2000 JJ2000 Partners.
44 * */
45 using System;
46 using CSJ2K.j2k.image;
47 namespace CSJ2K.j2k.wavelet.synthesis
48 {
49  
50 /// <summary> This class provides a default implementation for the methods of the
51 /// 'MultiResImgData' interface. The default implementation consists just in
52 /// returning the value of the source, where the source is another
53 /// 'MultiResImgData' object.
54 ///
55 /// <p>This abstract class can be used to facilitate the development of other
56 /// classes that implement 'MultiResImgData'. For example a dequantizer can
57 /// inherit from this class and all the trivial methods do not have to be
58 /// reimplemented.</p>
59 ///
60 /// <p>If the default implementation of a method provided in this class does
61 /// not suit a particular implementation of the 'MultiResImgData' interface,
62 /// the method can be overriden to implement the proper behaviour.</p>
63 ///
64 /// </summary>
65 /// <seealso cref="MultiResImgData">
66 ///
67 /// </seealso>
68 public abstract class MultiResImgDataAdapter : MultiResImgData
69 {
70 /// <summary>Returns the nominal tiles width </summary>
71 virtual public int NomTileWidth
72 {
73 get
74 {
75 return mressrc.NomTileWidth;
76 }
77  
78 }
79 /// <summary>Returns the nominal tiles height </summary>
80 virtual public int NomTileHeight
81 {
82 get
83 {
84 return mressrc.NomTileHeight;
85 }
86  
87 }
88 /// <summary> Returns the number of components in the image.
89 ///
90 /// <p>This default implementation returns the value of the source.</p>
91 ///
92 /// </summary>
93 /// <returns> The number of components in the image.
94 ///
95 /// </returns>
96 virtual public int NumComps
97 {
98 get
99 {
100 return mressrc.NumComps;
101 }
102  
103 }
104 /// <summary> Returns the index of the current tile, relative to a standard scan-line
105 /// order.
106 ///
107 /// <p>This default implementation returns the value of the source.</p>
108 ///
109 /// </summary>
110 /// <returns> The current tile's index (starts at 0).
111 ///
112 /// </returns>
113 virtual public int TileIdx
114 {
115 get
116 {
117 return mressrc.TileIdx;
118 }
119  
120 }
121 /// <summary>Returns the horizontal tile partition offset in the reference grid </summary>
122 virtual public int TilePartULX
123 {
124 get
125 {
126 return mressrc.TilePartULX;
127 }
128  
129 }
130 /// <summary>Returns the vertical tile partition offset in the reference grid </summary>
131 virtual public int TilePartULY
132 {
133 get
134 {
135 return mressrc.TilePartULY;
136 }
137  
138 }
139  
140 /// <summary>Index of the current tile </summary>
141 protected internal int tIdx = 0;
142  
143 /// <summary>The MultiResImgData source </summary>
144 protected internal MultiResImgData mressrc;
145  
146 /// <summary> Instantiates the MultiResImgDataAdapter object specifying the
147 /// MultiResImgData source.
148 ///
149 /// </summary>
150 /// <param name="src">From where to obrtain the MultiResImgData values.
151 ///
152 /// </param>
153 protected internal MultiResImgDataAdapter(MultiResImgData src)
154 {
155 mressrc = src;
156 }
157  
158 /// <summary> Returns the overall width of the current tile in pixels, for the given
159 /// resolution level. This is the tile's width without accounting for any
160 /// component subsampling.
161 ///
162 /// <p>This default implementation returns the value of the source.</p>
163 ///
164 /// </summary>
165 /// <param name="rl">The resolution level, from 0 to L.
166 ///
167 /// </param>
168 /// <returns> The total current tile's width in pixels.
169 ///
170 /// </returns>
171 public virtual int getTileWidth(int rl)
172 {
173 return mressrc.getTileWidth(rl);
174 }
175  
176 /// <summary> Returns the overall height of the current tile in pixels, for the given
177 /// resolution level. This is the tile's height without accounting for any
178 /// component subsampling.
179 ///
180 /// <p>This default implementation returns the value of the source.</p>
181 ///
182 /// </summary>
183 /// <param name="rl">The resolution level, from 0 to L.
184 ///
185 /// </param>
186 /// <returns> The total current tile's height in pixels.
187 ///
188 /// </returns>
189 public virtual int getTileHeight(int rl)
190 {
191 return mressrc.getTileHeight(rl);
192 }
193  
194 /// <summary> Returns the overall width of the image in pixels, for the given
195 /// resolution level. This is the image's width without accounting for any
196 /// component subsampling or tiling.
197 ///
198 /// <p>This default implementation returns the value of the source.</p>
199 ///
200 /// </summary>
201 /// <param name="rl">The resolution level, from 0 to L.
202 ///
203 /// </param>
204 /// <returns> The total image's width in pixels.
205 ///
206 /// </returns>
207 public virtual int getImgWidth(int rl)
208 {
209 return mressrc.getImgWidth(rl);
210 }
211  
212 /// <summary> Returns the overall height of the image in pixels, for the given
213 /// resolution level. This is the image's height without accounting for any
214 /// component subsampling or tiling.
215 ///
216 /// <p>This default implementation returns the value of the source.</p>
217 ///
218 /// </summary>
219 /// <param name="rl">The resolution level, from 0 to L.
220 ///
221 /// </param>
222 /// <returns> The total image's height in pixels.
223 ///
224 /// </returns>
225 public virtual int getImgHeight(int rl)
226 {
227 return mressrc.getImgHeight(rl);
228 }
229  
230 /// <summary> Returns the component subsampling factor in the horizontal direction,
231 /// for the specified component. This is, approximately, the ratio of
232 /// dimensions between the reference grid and the component itself, see the
233 /// 'ImgData' interface desription for details.
234 ///
235 /// <p>This default implementation returns the value of the source.</p>
236 ///
237 /// </summary>
238 /// <param name="c">The index of the component (between 0 and N-1)
239 ///
240 /// </param>
241 /// <returns> The horizontal subsampling factor of component 'c'
242 ///
243 /// </returns>
244 /// <seealso cref="jj2000.j2k.image.ImgData">
245 ///
246 /// </seealso>
247 public virtual int getCompSubsX(int c)
248 {
249 return mressrc.getCompSubsX(c);
250 }
251  
252 /// <summary> Returns the component subsampling factor in the vertical direction, for
253 /// the specified component. This is, approximately, the ratio of
254 /// dimensions between the reference grid and the component itself, see the
255 /// 'ImgData' interface desription for details.
256 ///
257 /// <p>This default implementation returns the value of the source.</p>
258 ///
259 /// </summary>
260 /// <param name="c">The index of the component (between 0 and N-1)
261 ///
262 /// </param>
263 /// <returns> The vertical subsampling factor of component 'c'
264 ///
265 /// </returns>
266 /// <seealso cref="jj2000.j2k.image.ImgData">
267 ///
268 /// </seealso>
269 public virtual int getCompSubsY(int c)
270 {
271 return mressrc.getCompSubsY(c);
272 }
273  
274 /// <summary> Returns the width in pixels of the specified tile-component for the
275 /// given resolution level.
276 ///
277 /// <p>This default implementation returns the value of the source.</p>
278 ///
279 /// </summary>
280 /// <param name="t">Tile index.
281 ///
282 /// </param>
283 /// <param name="c">The index of the component, from 0 to N-1.
284 ///
285 /// </param>
286 /// <param name="rl">The resolution level, from 0 to L.
287 ///
288 /// </param>
289 /// <returns> The width in pixels of component <tt>c</tt> in tile <tt>t</tt>
290 /// for resolution level <tt>rl</tt>.
291 ///
292 /// </returns>
293 public virtual int getTileCompWidth(int t, int c, int rl)
294 {
295 return mressrc.getTileCompWidth(t, c, rl);
296 }
297  
298 /// <summary> Returns the height in pixels of the specified tile-component for the
299 /// given resolution level.
300 ///
301 /// <p>This default implementation returns the value of the source.</p>
302 ///
303 /// </summary>
304 /// <param name="t">The tile index.
305 ///
306 /// </param>
307 /// <param name="c">The index of the component, from 0 to N-1.
308 ///
309 /// </param>
310 /// <param name="rl">The resolution level, from 0 to L.
311 ///
312 /// </param>
313 /// <returns> The height in pixels of component <tt>c</tt> in tile
314 /// <tt>t</tt>.
315 ///
316 /// </returns>
317 public virtual int getTileCompHeight(int t, int c, int rl)
318 {
319 return mressrc.getTileCompHeight(t, c, rl);
320 }
321  
322 /// <summary> Returns the width in pixels of the specified component in the overall
323 /// image, for the given resolution level.
324 ///
325 /// <p>This default implementation returns the value of the source.</p>
326 ///
327 /// </summary>
328 /// <param name="c">The index of the component, from 0 to N-1.
329 ///
330 /// </param>
331 /// <param name="rl">The resolution level, from 0 to L.
332 ///
333 /// </param>
334 /// <returns> The width in pixels of component <tt>c</tt> in the overall
335 /// image.
336 ///
337 /// </returns>
338 public virtual int getCompImgWidth(int c, int rl)
339 {
340 return mressrc.getCompImgWidth(c, rl);
341 }
342  
343 /// <summary> Returns the height in pixels of the specified component in the overall
344 /// image, for the given resolution level.
345 ///
346 /// <P>This default implementation returns the value of the source.
347 ///
348 /// </summary>
349 /// <param name="c">The index of the component, from 0 to N-1.
350 ///
351 /// </param>
352 /// <param name="rl">The resolution level, from 0 to L.
353 ///
354 /// </param>
355 /// <returns> The height in pixels of component <tt>c</tt> in the overall
356 /// image.
357 ///
358 /// </returns>
359 public virtual int getCompImgHeight(int c, int rl)
360 {
361 return mressrc.getCompImgHeight(c, rl);
362 }
363  
364 /// <summary> Changes the current tile, given the new indexes. An
365 /// IllegalArgumentException is thrown if the indexes do not correspond to
366 /// a valid tile.
367 ///
368 /// <p>This default implementation just changes the tile in the source.</p>
369 ///
370 /// </summary>
371 /// <param name="x">The horizontal indexes the tile.
372 ///
373 /// </param>
374 /// <param name="y">The vertical indexes of the new tile.
375 ///
376 /// </param>
377 public virtual void setTile(int x, int y)
378 {
379 mressrc.setTile(x, y);
380 tIdx = TileIdx;
381 }
382  
383 /// <summary> Advances to the next tile, in standard scan-line order (by rows then
384 /// columns). An NoNextElementException is thrown if the current tile is
385 /// the last one (i.e. there is no next tile).
386 ///
387 /// <p>This default implementation just changes the tile in the source.</p>
388 ///
389 /// </summary>
390 public virtual void nextTile()
391 {
392 mressrc.nextTile();
393 tIdx = TileIdx;
394 }
395  
396 /// <summary> Returns the indexes of the current tile. These are the horizontal and
397 /// vertical indexes of the current tile.
398 ///
399 /// <p>This default implementation returns the value of the source.</p>
400 ///
401 /// </summary>
402 /// <param name="co">If not null this object is used to return the information. If
403 /// null a new one is created and returned.
404 ///
405 /// </param>
406 /// <returns> The current tile's indexes (vertical and horizontal indexes).
407 ///
408 /// </returns>
409 public virtual Coord getTile(Coord co)
410 {
411 return mressrc.getTile(co);
412 }
413  
414 /// <summary> Returns the horizontal coordinate of the upper-left corner of the
415 /// specified resolution level in the given component of the current tile.
416 ///
417 /// <p>This default implementation returns the value of the source.</p>
418 ///
419 /// </summary>
420 /// <param name="c">The component index.
421 ///
422 /// </param>
423 /// <param name="rl">The resolution level index.
424 ///
425 /// </param>
426 public virtual int getResULX(int c, int rl)
427 {
428 return mressrc.getResULX(c, rl);
429 }
430  
431 /// <summary> Returns the vertical coordinate of the upper-left corner of the
432 /// specified resolution in the given component of the current tile.
433 ///
434 /// <p>This default implementation returns the value of the source.</p>
435 ///
436 /// </summary>
437 /// <param name="c">The component index.
438 ///
439 /// </param>
440 /// <param name="rl">The resolution level index.
441 ///
442 /// </param>
443 public virtual int getResULY(int c, int rl)
444 {
445 return mressrc.getResULY(c, rl);
446 }
447  
448 /// <summary> Returns the horizontal coordinate of the image origin, the top-left
449 /// corner, in the canvas system, on the reference grid at the specified
450 /// resolution level.
451 ///
452 /// <p>This default implementation returns the value of the source.</p>
453 ///
454 /// </summary>
455 /// <param name="rl">The resolution level, from 0 to L.
456 ///
457 /// </param>
458 /// <returns> The horizontal coordinate of the image origin in the canvas
459 /// system, on the reference grid.
460 ///
461 /// </returns>
462 public virtual int getImgULX(int rl)
463 {
464 return mressrc.getImgULX(rl);
465 }
466  
467 /// <summary> Returns the vertical coordinate of the image origin, the top-left
468 /// corner, in the canvas system, on the reference grid at the specified
469 /// resolution level.
470 ///
471 /// <p>This default implementation returns the value of the source.</p>
472 ///
473 /// </summary>
474 /// <param name="rl">The resolution level, from 0 to L.
475 ///
476 /// </param>
477 /// <returns> The vertical coordinate of the image origin in the canvas
478 /// system, on the reference grid.
479 ///
480 /// </returns>
481 public virtual int getImgULY(int rl)
482 {
483 return mressrc.getImgULY(rl);
484 }
485  
486 /// <summary> Returns the number of tiles in the horizontal and vertical directions.
487 ///
488 /// <p>This default implementation returns the value of the source.</p>
489 ///
490 /// </summary>
491 /// <param name="co">If not null this object is used to return the information. If
492 /// null a new one is created and returned.
493 ///
494 /// </param>
495 /// <returns> The number of tiles in the horizontal (Coord.x) and vertical
496 /// (Coord.y) directions.
497 ///
498 /// </returns>
499 public virtual Coord getNumTiles(Coord co)
500 {
501 return mressrc.getNumTiles(co);
502 }
503  
504 /// <summary> Returns the total number of tiles in the image.
505 ///
506 /// <p>This default implementation returns the value of the source.</p>
507 ///
508 /// </summary>
509 /// <returns> The total number of tiles in the image.
510 ///
511 /// </returns>
512 public virtual int getNumTiles()
513 {
514 return mressrc.getNumTiles();
515 }
516 public abstract CSJ2K.j2k.wavelet.synthesis.SubbandSyn getSynSubbandTree(int param1, int param2);
517 }
518 }