OpenJPEG 2.1.0

opj_includes.h

Go to the documentation of this file.
00001 /*
00002  * The copyright in this software is being made available under the 2-clauses 
00003  * BSD License, included below. This software may be subject to other third 
00004  * party and contributor rights, including patent rights, and no such rights
00005  * are granted under this license.
00006  *
00007  * Copyright (c) 2005, Herve Drolon, FreeImage Team
00008  * Copyright (c) 2008, 2011-2012, Centre National d'Etudes Spatiales (CNES), FR 
00009  * Copyright (c) 2012, CS Systemes d'Information, France
00010  * All rights reserved.
00011  *
00012  * Redistribution and use in source and binary forms, with or without
00013  * modification, are permitted provided that the following conditions
00014  * are met:
00015  * 1. Redistributions of source code must retain the above copyright
00016  *    notice, this list of conditions and the following disclaimer.
00017  * 2. Redistributions in binary form must reproduce the above copyright
00018  *    notice, this list of conditions and the following disclaimer in the
00019  *    documentation and/or other materials provided with the distribution.
00020  *
00021  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
00022  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00023  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00024  * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
00025  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
00026  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
00027  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
00028  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
00029  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
00030  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00031  * POSSIBILITY OF SUCH DAMAGE.
00032  */
00033 #ifndef OPJ_INCLUDES_H
00034 #define OPJ_INCLUDES_H
00035 
00036 /*
00037  * This must be included before any system headers,
00038  * since they can react to macro defined there
00039  */
00040 #include "opj_config_private.h"
00041 
00042 /*
00043  ==========================================================
00044    Standard includes used by the library
00045  ==========================================================
00046 */
00047 #include <memory.h>
00048 #include <stdlib.h>
00049 #include <string.h>
00050 #include <math.h>
00051 #include <float.h>
00052 #include <time.h>
00053 #include <stdio.h>
00054 #include <stdarg.h>
00055 #include <ctype.h>
00056 #include <assert.h>
00057 
00058 /*
00059   Use fseeko() and ftello() if they are available since they use
00060   'off_t' rather than 'long'.  It is wrong to use fseeko() and
00061   ftello() only on systems with special LFS support since some systems
00062   (e.g. FreeBSD) support a 64-bit off_t by default.
00063 */
00064 #if defined(OPJ_HAVE_FSEEKO) && !defined(fseek)
00065 #  define fseek  fseeko
00066 #  define ftell  ftello
00067 #endif
00068 
00069 
00070 #if defined(WIN32) && !defined(Windows95) && !defined(__BORLANDC__) && \
00071   !(defined(_MSC_VER) && _MSC_VER < 1400) && \
00072   !(defined(__MINGW32__) && __MSVCRT_VERSION__ < 0x800)
00073   /*
00074     Windows '95 and Borland C do not support _lseeki64
00075     Visual Studio does not support _fseeki64 and _ftelli64 until the 2005 release.
00076     Without these interfaces, files over 2GB in size are not supported for Windows.
00077   */
00078 #  define OPJ_FSEEK(stream,offset,whence) _fseeki64(stream,/* __int64 */ offset,whence)
00079 #  define OPJ_FSTAT(fildes,stat_buff) _fstati64(fildes,/* struct _stati64 */ stat_buff)
00080 #  define OPJ_FTELL(stream) /* __int64 */ _ftelli64(stream)
00081 #  define OPJ_STAT_STRUCT_T struct _stati64
00082 #  define OPJ_STAT(path,stat_buff) _stati64(path,/* struct _stati64 */ stat_buff)
00083 #else
00084 #  define OPJ_FSEEK(stream,offset,whence) fseek(stream,offset,whence)
00085 #  define OPJ_FSTAT(fildes,stat_buff) fstat(fildes,stat_buff)
00086 #  define OPJ_FTELL(stream) ftell(stream)
00087 #  define OPJ_STAT_STRUCT_T struct stat
00088 #  define OPJ_STAT(path,stat_buff) stat(path,stat_buff)
00089 #endif
00090 
00091 
00092 /*
00093  ==========================================================
00094    OpenJPEG interface
00095  ==========================================================
00096  */
00097 #include "openjpeg.h"
00098 
00099 /*
00100  ==========================================================
00101    OpenJPEG modules
00102  ==========================================================
00103 */
00104 
00105 /* Ignore GCC attributes if this is not GCC */
00106 #ifndef __GNUC__
00107         #define __attribute__(x) /* __attribute__(x) */
00108 #endif
00109 
00110 
00111 /* Are restricted pointers available? (C99) */
00112 #if (__STDC_VERSION__ != 199901L)
00113         /* Not a C99 compiler */
00114         #ifdef __GNUC__
00115                 #define restrict __restrict__
00116         #else
00117                 #define restrict /* restrict */
00118         #endif
00119 #endif
00120 
00121 /* MSVC before 2013 and Borland C do not have lrintf */
00122 #if defined(_MSC_VER) && (_MSC_VER < 1800) || defined(__BORLANDC__)
00123 static INLINE long lrintf(float f){
00124 #ifdef _M_X64
00125     return (long)((f>0.0f) ? (f + 0.5f):(f -0.5f));
00126 #else
00127     int i;
00128  
00129     _asm{
00130         fld f
00131         fistp i
00132     };
00133  
00134     return i;
00135 #endif
00136 }
00137 #endif
00138 
00139 #include "opj_inttypes.h"
00140 #include "opj_clock.h"
00141 #include "opj_malloc.h"
00142 #include "function_list.h"
00143 #include "event.h"
00144 #include "bio.h"
00145 #include "cio.h"
00146 
00147 #include "image.h"
00148 #include "invert.h"
00149 #include "j2k.h"
00150 #include "jp2.h"
00151 
00152 #include "mqc.h"
00153 #include "raw.h"
00154 #include "bio.h"
00155 
00156 #include "pi.h"
00157 #include "tgt.h"
00158 #include "tcd.h"
00159 #include "t1.h"
00160 #include "dwt.h"
00161 #include "t2.h"
00162 #include "mct.h"
00163 #include "opj_intmath.h"
00164 
00165 #ifdef USE_JPIP
00166 #include "cidx_manager.h"
00167 #include "indexbox_manager.h"
00168 #endif
00169 
00170 /* JPWL>> */
00171 #ifdef USE_JPWL
00172 #include "openjpwl/jpwl.h"
00173 #endif /* USE_JPWL */
00174 /* <<JPWL */
00175 
00176 /* V2 */
00177 #include "opj_codec.h"
00178 
00179 
00180 #endif /* OPJ_INCLUDES_H */