4 * Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
5 * Copyright (c) 2002-2014, Professor Benoit Macq
6 * Copyright (c) 2010-2011, Kaori Hagihara
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
19 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
22 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 * POSSIBILITY OF SUCH DAMAGE.
31 #ifndef IMGREG_MANAGER_H_
32 # define IMGREG_MANAGER_H_
34 /** image region parameters */
35 typedef struct imgreg_param{
36 int xosiz, yosiz; /** offset from the origin of the reference grid
37 at the decomposition level */
38 int fx, fy; /** frame size (fsiz) */
39 int ox, oy; /** offset (roff) */
40 int sx, sy; /** region size (rsiz) */
41 int level; /** decomposition level */
46 * map view-window requests to codestream image resolutions and regions
48 * @param[in] fx,fy frame size
49 * @param[in] rx,ry offset of region
50 * @param[in] rw,rh size of region
51 * @param[in] XOsiz,YOsiz offset from the origin of the reference grid to the left side of the image area
52 * @param[in] Xsiz,Ysiz size of the reference grid
53 * @param[in] numOfreslev number of resolution levels
54 * @return structure of image region parameters
56 imgreg_param_t map_viewin2imgreg( const int fx, const int fy,
57 const int rx, const int ry,
58 const int rw, const int rh,
59 const int XOsiz, const int YOsiz,
60 const int Xsiz, const int Ysiz,
61 const int numOfreslev);
65 * find deconposition level and its resolution size
66 * C.4.1 Mapping view-window requests to codestream image resolution
68 * Note: only round-down implemented
70 * @param[in] maxlev maximum decomposition level
71 * @param[in,out] lev decomposition level pointer
72 * @param[in,out] fx horizontal frame size pointer
73 * @param[in,out] fy vertical frame size pointer
74 * @param[in,out] xmin horizontal image offset pointer
75 * @param[in,out] ymin vertical image offset pointer
76 * @param[in,out] xmax horizontal image size pointer
77 * @param[in,out] ymax vertical image size pointer
79 void find_level( int maxlev, int *lev, int *fx, int *fy, int *xmin, int *ymin, int *xmax, int *ymax);
82 * compute decomposition level (only to get the level
83 * use find_level for all parameters
85 * @param[in] fw horizontal frame size
86 * @param[in] fh vertical frame size
87 * @param[in] Xsiz image width
88 * @param[in] Ysiz image height
89 * @return decomposition level
91 int comp_decomplev( int fw, int fh, int Xsiz, int Ysiz);
94 * print image region parameters
96 * @param[in] imgreg image region structure of parameters
98 void print_imgreg( imgreg_param_t imgreg);
101 #endif /* !IMGREG_MANAGER_H_ */