magick-type.h

Go to the documentation of this file.
00001 /*
00002   Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
00003   dedicated to making software imaging solutions freely available.
00004 
00005   You may not use this file except in compliance with the License.  You may
00006   obtain a copy of the License at
00007 
00008     https://imagemagick.org/script/license.php
00009 
00010   Unless required by applicable law or agreed to in writing, software
00011   distributed under the License is distributed on an "AS IS" BASIS,
00012   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013   See the License for the specific language governing permissions and
00014   limitations under the License.
00015 
00016   MagickCore types.
00017 */
00018 #ifndef MAGICKCORE_MAGICK_TYPE_H
00019 #define MAGICKCORE_MAGICK_TYPE_H
00020 
00021 #include "MagickCore/magick-config.h"
00022 
00023 #if MAGICKCORE_HAVE_UINTPTR_T
00024 #  include <stdint.h>
00025 #endif
00026 
00027 #if defined(__cplusplus) || defined(c_plusplus)
00028 extern "C" {
00029 #endif
00030 
00031 #if !defined(MAGICKCORE_QUANTUM_DEPTH)
00032 #define MAGICKCORE_QUANTUM_DEPTH  16
00033 #endif
00034 
00035 #if defined(MAGICKCORE_WINDOWS_SUPPORT) && !defined(__MINGW32__)
00036 #  define MagickLLConstant(c)  ((MagickOffsetType) (c ## i64))
00037 #  define MagickULLConstant(c)  ((MagickSizeType) (c ## ui64))
00038 #else
00039 #  define MagickLLConstant(c)  ((MagickOffsetType) (c ## LL))
00040 #  define MagickULLConstant(c)  ((MagickSizeType) (c ## ULL))
00041 #endif
00042 
00043 #if defined(__s390__)
00044 typedef double MagickFloatType;
00045 #else
00046 #if MAGICKCORE_SIZEOF_FLOAT_T == 0
00047 typedef float MagickFloatType;
00048 #elif (MAGICKCORE_SIZEOF_FLOAT_T == MAGICKCORE_SIZEOF_FLOAT)
00049 typedef float MagickFloatType;
00050 #elif (MAGICKCORE_SIZEOF_FLOAT_T == MAGICKCORE_SIZEOF_DOUBLE)
00051 typedef double MagickFloatType;
00052 #elif (MAGICKCORE_SIZEOF_FLOAT_T == MAGICKCORE_SIZEOF_LONG_DOUBLE)
00053 typedef double MagickFloatType;
00054 #else
00055 #error Your MagickFloatType type is neither a float, nor a double, nor a long double
00056 #endif
00057 #endif
00058 #if MAGICKCORE_SIZEOF_DOUBLE_T == 0
00059 typedef double MagickDoubleType;
00060 #elif (MAGICKCORE_SIZEOF_DOUBLE_T == MAGICKCORE_SIZEOF_DOUBLE)
00061 typedef double MagickDoubleType;
00062 #elif (MAGICKCORE_SIZEOF_DOUBLE_T == MAGICKCORE_SIZEOF_LONG_DOUBLE)
00063 typedef double MagickDoubleType;
00064 #else
00065 #error Your MagickDoubleType type is neither a float, nor a double, nor a long double
00066 #endif
00067 
00068 #if (MAGICKCORE_QUANTUM_DEPTH == 8)
00069 #define MaxColormapSize  256UL
00070 #define MaxMap  255UL
00071 
00072 #if defined(MAGICKCORE_HDRI_SUPPORT)
00073 typedef MagickFloatType Quantum;
00074 #define QuantumRange  255.0
00075 #define QuantumFormat  "%g"
00076 #else
00077 typedef unsigned char Quantum;
00078 #define QuantumRange  ((Quantum) 255)
00079 #define QuantumFormat  "%u"
00080 #endif
00081 #elif (MAGICKCORE_QUANTUM_DEPTH == 16)
00082 #define MaxColormapSize  65536UL
00083 #define MaxMap  65535UL
00084 
00085 #if defined(MAGICKCORE_HDRI_SUPPORT)
00086 typedef MagickFloatType Quantum;
00087 #define QuantumRange  65535.0f
00088 #define QuantumFormat  "%g"
00089 #else
00090 typedef unsigned short Quantum;
00091 #define QuantumRange  ((Quantum) 65535)
00092 #define QuantumFormat  "%u"
00093 #endif
00094 #elif (MAGICKCORE_QUANTUM_DEPTH == 32)
00095 #define MaxColormapSize  65536UL
00096 #define MaxMap  65535UL
00097 
00098 #if defined(MAGICKCORE_HDRI_SUPPORT)
00099 typedef MagickDoubleType Quantum;
00100 #define QuantumRange  4294967295.0
00101 #define QuantumFormat  "%g"
00102 #else
00103 typedef unsigned int Quantum;
00104 #define QuantumRange  ((Quantum) 4294967295)
00105 #define QuantumFormat  "%u"
00106 #endif
00107 #elif (MAGICKCORE_QUANTUM_DEPTH == 64)
00108 #define MAGICKCORE_HDRI_SUPPORT  1
00109 #define MaxColormapSize  65536UL
00110 #define MaxMap  65535UL
00111 
00112 typedef MagickDoubleType Quantum;
00113 #define QuantumRange  18446744073709551615.0
00114 #define QuantumFormat  "%g"
00115 #else
00116 #error "MAGICKCORE_QUANTUM_DEPTH must be one of 8, 16, 32, or 64"
00117 #endif
00118 #define MagickEpsilon  1.0e-12
00119 #define MagickMaximumValue  1.79769313486231570E+308
00120 #define MagickMinimumValue   2.22507385850720140E-308
00121 #define MagickStringify(macro_or_string)  MagickStringifyArg(macro_or_string)
00122 #define MagickStringifyArg(contents)  #contents
00123 #define QuantumScale  ((double) 1.0/(double) QuantumRange)
00124 
00125 /*
00126   Typedef declarations.
00127 */
00128 typedef MagickDoubleType MagickRealType;
00129 typedef unsigned int MagickStatusType;
00130 #if !defined(MAGICKCORE_WINDOWS_SUPPORT)
00131 #if (MAGICKCORE_SIZEOF_UNSIGNED_LONG_LONG == 8)
00132 typedef long long MagickOffsetType;
00133 typedef unsigned long long MagickSizeType;
00134 #define MagickOffsetFormat  "lld"
00135 #define MagickSizeFormat  "llu"
00136 #else
00137 typedef ssize_t MagickOffsetType;
00138 typedef size_t MagickSizeType;
00139 #define MagickOffsetFormat  "ld"
00140 #define MagickSizeFormat  "lu"
00141 #endif
00142 #else
00143 typedef __int64 MagickOffsetType;
00144 typedef unsigned __int64 MagickSizeType;
00145 #define MagickOffsetFormat  "I64i"
00146 #define MagickSizeFormat  "I64u"
00147 #endif
00148 
00149 #if MAGICKCORE_HAVE_UINTPTR_T || defined(uintptr_t)
00150 typedef uintptr_t MagickAddressType;
00151 #else
00152 /* Hope for the best, I guess. */
00153 typedef size_t MagickAddressType;
00154 #endif
00155 
00156 #if defined(_MSC_VER) && (_MSC_VER == 1200)
00157 typedef MagickOffsetType QuantumAny;
00158 #else
00159 typedef MagickSizeType QuantumAny;
00160 #endif
00161 
00162 #if defined(macintosh)
00163 #define ExceptionInfo  MagickExceptionInfo
00164 #endif
00165 
00166 typedef enum
00167 {
00168   UndefinedClass,
00169   DirectClass,
00170   PseudoClass
00171 } ClassType;
00172 
00173 typedef enum
00174 {
00175   MagickFalse = 0,
00176   MagickTrue = 1
00177 } MagickBooleanType;
00178 
00179 /*
00180   The IsNaN test is for special floating point numbers of value Nan (not a
00181   number). NaN's are defined as part of the IEEE standard for floating point
00182   number representation, and need to be watched out for. Morphology Kernels
00183   often use these special numbers as neighbourhood masks.
00184 
00185   The special property that two NaN's are never equal, even if they are from
00186   the same variable allows you to test if a value is special NaN value.
00187 
00188   The macros are thus is only true if the value given is NaN.
00189 */
00190 #if defined(MAGICKCORE_HAVE_ISNAN)
00191 #  define IsNaN(a) isnan(a)
00192 #elif defined(_MSC_VER) && (_MSC_VER >= 1310)
00193 #  include <float.h>
00194 #  define IsNaN(a) _isnan(a)
00195 #else
00196 #  define IsNaN(a) ((a) != (a))
00197 #endif
00198 #if !defined(INFINITY)
00199 #  define INFINITY ((double) -logf(0f))
00200 #endif
00201 
00202 typedef struct _BlobInfo BlobInfo;
00203 
00204 typedef struct _ExceptionInfo ExceptionInfo;
00205 
00206 typedef struct _Image Image;
00207 
00208 typedef struct _ImageInfo ImageInfo;
00209 
00210 #if defined(__cplusplus) || defined(c_plusplus)
00211 }
00212 #endif
00213 
00214 #endif

Generated on 18 Nov 2020 for MagickCore by  doxygen 1.6.1