fixed lt_version in configure.ac
[openjpeg.git] / libjp3dvm / pi.h
1 /*\r
2  * Copyright (c) 2001-2003, David Janssens\r
3  * Copyright (c) 2002-2003, Yannick Verschueren\r
4  * Copyright (c) 2003-2005, Francois Devaux and Antonin Descampe\r
5  * Copyright (c) 2005, Herve Drolon, FreeImage Team\r
6  * Copyright (c) 2002-2005, Communications and remote sensing Laboratory, Universite catholique de Louvain, Belgium\r
7  * Copyright (c) 2006, M�nica D�ez Garc�a, Image Processing Laboratory, University of Valladolid, Spain\r
8  * All rights reserved.\r
9  *\r
10  * Redistribution and use in source and binary forms, with or without\r
11  * modification, are permitted provided that the following conditions\r
12  * are met:\r
13  * 1. Redistributions of source code must retain the above copyright\r
14  *    notice, this list of conditions and the following disclaimer.\r
15  * 2. Redistributions in binary form must reproduce the above copyright\r
16  *    notice, this list of conditions and the following disclaimer in the\r
17  *    documentation and/or other materials provided with the distribution.\r
18  *\r
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'\r
20  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r
21  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r
22  * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\r
23  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\r
24  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
25  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
26  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r
27  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r
28  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r
29  * POSSIBILITY OF SUCH DAMAGE.\r
30  */\r
31 \r
32 #ifndef __PI_H\r
33 #define __PI_H\r
34 /**\r
35 @file pi.h\r
36 @brief Implementation of a packet iterator (PI)\r
37 \r
38 The functions in PI.C have for goal to realize a packet iterator that permits to get the next\r
39 packet following the progression order and change of it. The functions in PI.C are used\r
40 by some function in T2.C.\r
41 */\r
42 \r
43 /** @defgroup PI PI - Implementation of a packet iterator */\r
44 /*@{*/\r
45 \r
46 /**\r
47 Packet iterator : resolution level information \r
48 */\r
49 typedef struct opj_pi_resolution {\r
50 /** Size of precints in horizontal axis */\r
51         int pdx;\r
52 /** Size of precints in vertical axis */\r
53         int pdy;\r
54 /** Size of precints in axial axis */\r
55         int pdz;\r
56 /** Number of precints in each axis */\r
57         int prctno[3];                          \r
58 } opj_pi_resolution_t;\r
59 \r
60 /**\r
61 Packet iterator : component information \r
62 */\r
63 typedef struct opj_pi_comp {\r
64 /** Size in horizontal axis */\r
65         int dx;\r
66 /** Size in vertical axis */\r
67         int dy;\r
68 /** Size in axial axis */\r
69         int dz;\r
70 /** Number of resolution levels */\r
71         int numresolution[3];                   \r
72 /** Packet iterator : resolution level information */\r
73         opj_pi_resolution_t *resolutions;\r
74 } opj_pi_comp_t;\r
75 \r
76 /** \r
77 Packet iterator \r
78 */\r
79 typedef struct opj_pi_iterator {\r
80 /** precise if the packet has been already used (usefull for progression order change) */\r
81         short int *include;             \r
82 /** layer step used to localize the packet in the include vector */\r
83         int step_l;             \r
84 /** resolution step used to localize the packet in the include vector */\r
85         int step_r;     \r
86 /** component step used to localize the packet in the include vector */\r
87         int step_c;                             \r
88 /** precinct step used to localize the packet in the include vector */\r
89         int step_p;                             \r
90 /** component that identify the packet */\r
91         int compno;                             \r
92 /** resolution that identify the packet */\r
93         int resno;                              \r
94 /** precinct that identify the packet */\r
95         int precno;                             \r
96 /** layer that identify the packet */\r
97         int layno;                              \r
98 /** 0 if the first packet */\r
99         int first;                              \r
100 /** progression order change information */\r
101         opj_poc_t poc;                  \r
102 /**     Packet iterator : component information */\r
103 opj_pi_comp_t *comps;\r
104         \r
105         int numcomps;\r
106         int tx0, ty0, tz0;\r
107         int tx1, ty1, tz1;\r
108         int x, y, z;\r
109         int dx, dy, dz;\r
110 } opj_pi_iterator_t;\r
111 \r
112 /** @name Funciones generales */\r
113 /*@{*/\r
114 /* ----------------------------------------------------------------------- */\r
115 /**\r
116 Create a packet iterator\r
117 @param volume Raw volume for which the packets will be listed\r
118 @param cp Coding parameters\r
119 @param tileno Number that identifies the tile for which to list the packets\r
120 @return Returns a packet iterator that points to the first packet of the tile\r
121 @see pi_destroy\r
122 */\r
123 opj_pi_iterator_t *pi_create(opj_volume_t * volume, opj_cp_t * cp, int tileno);\r
124 \r
125 /**\r
126 Destroy a packet iterator\r
127 @param pi Previously created packet iterator\r
128 @param cp Coding parameters\r
129 @param tileno Number that identifies the tile for which the packets were listed\r
130 @see pi_create\r
131 */\r
132 void pi_destroy(opj_pi_iterator_t *pi, opj_cp_t *cp, int tileno);\r
133 \r
134 /**\r
135 Modify the packet iterator to point to the next packet\r
136 @param pi Packet iterator to modify\r
137 @return Returns false if pi pointed to the last packet or else returns true \r
138 */\r
139 bool pi_next(opj_pi_iterator_t * pi);\r
140 /* ----------------------------------------------------------------------- */\r
141 /*@}*/\r
142 \r
143 /*@}*/\r
144 \r
145 #endif /* __PI_H */\r