[trunk] WIP: add output elements about decoding of jp2 files with last tile part...
[openjpeg.git] / libopenjpeg / opj_includes.h
1 /*
2  * Copyright (c) 2005, Herve Drolon, FreeImage Team
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  *    notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  *    notice, this list of conditions and the following disclaimer in the
12  *    documentation and/or other materials provided with the distribution.
13  *
14  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
15  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17  * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
18  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
20  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
24  * POSSIBILITY OF SUCH DAMAGE.
25  */
26 #ifndef OPJ_INCLUDES_H
27 #define OPJ_INCLUDES_H
28
29 /*
30  ==========================================================
31    Standard includes used by the library
32  ==========================================================
33 */
34 #include <memory.h>
35 #include <stdlib.h>
36 #include <string.h>
37 #include <math.h>
38 #include <float.h>
39 #include <time.h>
40 #include <stdio.h>
41 #include <stdarg.h>
42 #include <ctype.h>
43 #include <assert.h>
44
45 /*
46  ==========================================================
47    OpenJPEG interface
48  ==========================================================
49  */
50 #include "openjpeg.h"
51
52 /*
53  ==========================================================
54    OpenJPEG modules
55  ==========================================================
56 */
57
58 /* Ignore GCC attributes if this is not GCC */
59 #ifndef __GNUC__
60         #define __attribute__(x) /* __attribute__(x) */
61 #endif
62
63 /*
64 The inline keyword is supported by C99 but not by C90. 
65 Most compilers implement their own version of this keyword ... 
66 */
67 #ifndef INLINE
68         #if defined(_MSC_VER)
69                 #define INLINE __forceinline
70         #elif defined(__GNUC__)
71                 #define INLINE __inline__
72         #elif defined(__MWERKS__)
73                 #define INLINE inline
74         #else 
75                 /* add other compilers here ... */
76                 #define INLINE 
77         #endif /* defined(<Compiler>) */
78 #endif /* INLINE */
79
80 /* Are restricted pointers available? (C99) */
81 #if (__STDC_VERSION__ != 199901L)
82         /* Not a C99 compiler */
83         #ifdef __GNUC__
84                 #define restrict __restrict__
85         #else
86                 #define restrict /* restrict */
87         #endif
88 #endif
89
90 /* MSVC and Borland C do not have lrintf */
91 #if defined(_MSC_VER) || defined(__BORLANDC__)
92 static INLINE long lrintf(float f){
93 #ifdef _M_X64
94     return (long)((f>0.0f) ? (f + 0.5f):(f -0.5f));
95 #else
96     int i;
97  
98     _asm{
99         fld f
100         fistp i
101     };
102  
103     return i;
104 #endif
105 }
106 #endif
107
108 #include "j2k_lib.h"
109 #include "opj_malloc.h"
110 #include "event.h"
111 #include "bio.h"
112 #include "cio.h"
113
114 #include "image.h"
115 #include "j2k.h"
116 #include "jp2.h"
117 #include "jpt.h"
118
119 #include "mqc.h"
120 #include "raw.h"
121 #include "bio.h"
122 #include "tgt.h"
123 #include "pi.h"
124 #include "tcd.h"
125 #include "t1.h"
126 #include "dwt.h"
127 #include "t2.h"
128 #include "mct.h"
129 #include "int.h"
130 #include "fix.h"
131
132 #include "cidx_manager.h"
133 #include "indexbox_manager.h"
134
135 /* JPWL>> */
136 #ifdef USE_JPWL
137 #include "./jpwl/jpwl.h"
138 #endif /* USE_JPWL */
139 /* <<JPWL */
140
141 // V2
142 #include "function_list.h"
143
144 #endif /* OPJ_INCLUDES_H */