corrade-vassal – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 vero 1 /*
2 * CVS identifier:
3 *
4 * $Id : $
5 *
6 * Class: Progression
7 *
8 * Description: Holds the type(s) of progression
9 *
10 *
11 * Modified by:
12 *
13 * COPYRIGHT:
14 *
15 * This software module was originally developed by Raphaël Grosbois and
16 * Diego Santa Cruz (Swiss Federal Institute of Technology-EPFL); Joel
17 * Askelöf (Ericsson Radio Systems AB); and Bertrand Berthelot, David
18 * Bouchard, Félix Henry, Gerard Mozelle and Patrice Onno (Canon Research
19 * Centre France S.A) in the course of development of the JPEG2000
20 * standard as specified by ISO/IEC 15444 (JPEG 2000 Standard). This
21 * software module is an implementation of a part of the JPEG 2000
22 * Standard. Swiss Federal Institute of Technology-EPFL, Ericsson Radio
23 * Systems AB and Canon Research Centre France S.A (collectively JJ2000
24 * Partners) agree not to assert against ISO/IEC and users of the JPEG
25 * 2000 Standard (Users) any of their rights under the copyright, not
26 * including other intellectual property rights, for this software module
27 * with respect to the usage by ISO/IEC and Users of this software module
28 * or modifications thereof for use in hardware or software products
29 * claiming conformance to the JPEG 2000 Standard. Those intending to use
30 * this software module in hardware or software products are advised that
31 * their use may infringe existing patents. The original developers of
32 * this software module, JJ2000 Partners and ISO/IEC assume no liability
33 * for use of this software module or modifications thereof. No license
34 * or right to this software module is granted for non JPEG 2000 Standard
35 * conforming products. JJ2000 Partners have full right to use this
36 * software module for his/her own purpose, assign or donate this
37 * software module to any third party and to inhibit third parties from
38 * using this software module for non JPEG 2000 Standard conforming
39 * products. This copyright notice must be included in all copies or
40 * derivative works of this software module.
41 *
42 * Copyright (c) 1999/2000 JJ2000 Partners.
43 *
44 *
45 *
46 */
47 using System;
48 using CSJ2K.j2k.codestream;
49 namespace CSJ2K.j2k.entropy
50 {
51  
52 /// <summary> This class holds one of the different progression orders defined in
53 /// the bit stream. The type(s) of progression order are defined in the
54 /// ProgressionType interface. A Progression object is totally defined
55 /// by its component start and end, resolution level start and end and
56 /// layer start and end indexes. If no progression order change is
57 /// defined, there is only Progression instance.
58 ///
59 /// </summary>
60 /// <seealso cref="ProgressionType">
61 ///
62 /// </seealso>
63 public class Progression
64 {
65  
66 /// <summary>Progression type as defined in ProgressionType interface </summary>
67 public int type;
68  
69 /// <summary>Component index for the start of a progression </summary>
70 public int cs;
71  
72 /// <summary>Component index for the end of a progression. </summary>
73 public int ce;
74  
75 /// <summary>Resolution index for the start of a progression </summary>
76 public int rs;
77  
78 /// <summary>Resolution index for the end of a progression. </summary>
79 public int re;
80  
81 /// <summary>The index of the last layer. </summary>
82 public int lye;
83  
84 /// <summary> Constructor.
85 ///
86 /// Builds a new Progression object with specified type and bounds
87 /// of progression.
88 ///
89 /// </summary>
90 /// <param name="type">The progression type
91 ///
92 /// </param>
93 /// <param name="cs">The component index start
94 ///
95 /// </param>
96 /// <param name="ce">The component index end
97 ///
98 /// </param>
99 /// <param name="rs">The resolution level index start
100 ///
101 /// </param>
102 /// <param name="re">The resolution level index end
103 ///
104 /// </param>
105 /// <param name="lye">The layer index end
106 ///
107 /// </param>
108 public Progression(int type, int cs, int ce, int rs, int re, int lye)
109 {
110 this.type = type;
111 this.cs = cs;
112 this.ce = ce;
113 this.rs = rs;
114 this.re = re;
115 this.lye = lye;
116 }
117  
118 public override System.String ToString()
119 {
120 System.String str = "type= ";
121 switch (type)
122 {
123  
124 case CSJ2K.j2k.codestream.ProgressionType.LY_RES_COMP_POS_PROG:
125 str += "layer, ";
126 break;
127  
128 case CSJ2K.j2k.codestream.ProgressionType.RES_LY_COMP_POS_PROG:
129 str += "res, ";
130 break;
131  
132 case CSJ2K.j2k.codestream.ProgressionType.RES_POS_COMP_LY_PROG:
133 str += "res-pos, ";
134 break;
135  
136 case CSJ2K.j2k.codestream.ProgressionType.POS_COMP_RES_LY_PROG:
137 str += "pos-comp, ";
138 break;
139  
140 case CSJ2K.j2k.codestream.ProgressionType.COMP_POS_RES_LY_PROG:
141 str += "pos-comp, ";
142 break;
143  
144 default:
145 throw new System.ApplicationException("Unknown progression type");
146  
147 }
148 str += ("comp.: " + cs + "-" + ce + ", ");
149 str += ("res.: " + rs + "-" + re + ", ");
150 str += ("layer: up to " + lye);
151 return str;
152 }
153 }
154 }