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 MAGICKCORE_SIZEOF_FLOAT_T == 0
00044 typedef float MagickFloatType;
00045 #elif (MAGICKCORE_SIZEOF_FLOAT_T == MAGICKCORE_SIZEOF_FLOAT)
00046 typedef float MagickFloatType;
00047 #elif (MAGICKCORE_SIZEOF_FLOAT_T == MAGICKCORE_SIZEOF_DOUBLE)
00048 typedef double MagickFloatType;
00049 #elif (MAGICKCORE_SIZEOF_FLOAT_T == MAGICKCORE_SIZEOF_LONG_DOUBLE)
00050 typedef double MagickFloatType;
00051 #else
00052 #error Your MagickFloatType type is neither a float, nor a double, nor a long double
00053 #endif
00054 #if MAGICKCORE_SIZEOF_DOUBLE_T == 0
00055 typedef double MagickDoubleType;
00056 #elif (MAGICKCORE_SIZEOF_DOUBLE_T == MAGICKCORE_SIZEOF_DOUBLE)
00057 typedef double MagickDoubleType;
00058 #elif (MAGICKCORE_SIZEOF_DOUBLE_T == MAGICKCORE_SIZEOF_LONG_DOUBLE)
00059 typedef double MagickDoubleType;
00060 #else
00061 #error Your MagickDoubleType type is neither a float, nor a double, nor a long double
00062 #endif
00063 
00064 #if (MAGICKCORE_QUANTUM_DEPTH == 8)
00065 #define MaxColormapSize  256UL
00066 #define MaxMap  255UL
00067 
00068 #if defined(MAGICKCORE_HDRI_SUPPORT)
00069 typedef MagickFloatType Quantum;
00070 #define QuantumRange  255.0
00071 #define QuantumFormat  "%g"
00072 #else
00073 typedef unsigned char Quantum;
00074 #define QuantumRange  ((Quantum) 255)
00075 #define QuantumFormat  "%u"
00076 #endif
00077 #elif (MAGICKCORE_QUANTUM_DEPTH == 16)
00078 #define MaxColormapSize  65536UL
00079 #define MaxMap  65535UL
00080 
00081 #if defined(MAGICKCORE_HDRI_SUPPORT)
00082 typedef MagickFloatType Quantum;
00083 #define QuantumRange  65535.0f
00084 #define QuantumFormat  "%g"
00085 #else
00086 typedef unsigned short Quantum;
00087 #define QuantumRange  ((Quantum) 65535)
00088 #define QuantumFormat  "%u"
00089 #endif
00090 #elif (MAGICKCORE_QUANTUM_DEPTH == 32)
00091 #define MaxColormapSize  65536UL
00092 #define MaxMap  65535UL
00093 
00094 #if defined(MAGICKCORE_HDRI_SUPPORT)
00095 typedef MagickDoubleType Quantum;
00096 #define QuantumRange  4294967295.0
00097 #define QuantumFormat  "%g"
00098 #else
00099 typedef unsigned int Quantum;
00100 #define QuantumRange  ((Quantum) 4294967295)
00101 #define QuantumFormat  "%u"
00102 #endif
00103 #elif (MAGICKCORE_QUANTUM_DEPTH == 64)
00104 #define MAGICKCORE_HDRI_SUPPORT  1
00105 #define MaxColormapSize  65536UL
00106 #define MaxMap  65535UL
00107 
00108 typedef MagickDoubleType Quantum;
00109 #define QuantumRange  18446744073709551615.0
00110 #define QuantumFormat  "%g"
00111 #else
00112 #error "MAGICKCORE_QUANTUM_DEPTH must be one of 8, 16, 32, or 64"
00113 #endif
00114 #define MagickEpsilon  1.0e-12
00115 #define MagickMaximumValue  1.79769313486231570E+308
00116 #define MagickMinimumValue   2.22507385850720140E-308
00117 #define MagickStringify(macro_or_string)  MagickStringifyArg(macro_or_string)
00118 #define MagickStringifyArg(contents)  #contents
00119 #define QuantumScale  ((double) 1.0/(double) QuantumRange)
00120 
00121 /*
00122   Typedef declarations.
00123 */
00124 typedef MagickDoubleType MagickRealType;
00125 typedef unsigned int MagickStatusType;
00126 #if !defined(MAGICKCORE_WINDOWS_SUPPORT)
00127 #if (MAGICKCORE_SIZEOF_UNSIGNED_LONG_LONG == 8)
00128 typedef long long MagickOffsetType;
00129 typedef unsigned long long MagickSizeType;
00130 #define MagickOffsetFormat  "lld"
00131 #define MagickSizeFormat  "llu"
00132 #else
00133 typedef ssize_t MagickOffsetType;
00134 typedef size_t MagickSizeType;
00135 #define MagickOffsetFormat  "ld"
00136 #define MagickSizeFormat  "lu"
00137 #endif
00138 #else
00139 typedef __int64 MagickOffsetType;
00140 typedef unsigned __int64 MagickSizeType;
00141 #define MagickOffsetFormat  "I64i"
00142 #define MagickSizeFormat  "I64u"
00143 #endif
00144 
00145 #if MAGICKCORE_HAVE_UINTPTR_T || defined(uintptr_t)
00146 typedef uintptr_t MagickAddressType;
00147 #else
00148 /* Hope for the best, I guess. */
00149 typedef size_t MagickAddressType;
00150 #endif
00151 
00152 #if defined(_MSC_VER) && (_MSC_VER == 1200)
00153 typedef MagickOffsetType QuantumAny;
00154 #else
00155 typedef MagickSizeType QuantumAny;
00156 #endif
00157 
00158 #if defined(macintosh)
00159 #define ExceptionInfo  MagickExceptionInfo
00160 #endif
00161 
00162 typedef enum
00163 {
00164   UndefinedClass,
00165   DirectClass,
00166   PseudoClass
00167 } ClassType;
00168 
00169 typedef enum
00170 {
00171   MagickFalse = 0,
00172   MagickTrue = 1
00173 } MagickBooleanType;
00174 
00175 /*
00176   The IsNaN test is for special floating point numbers of value Nan (not a
00177   number). NaN's are defined as part of the IEEE standard for floating point
00178   number representation, and need to be watched out for. Morphology Kernels
00179   often use these special numbers as neighbourhood masks.
00180 
00181   The special property that two NaN's are never equal, even if they are from
00182   the same variable allows you to test if a value is special NaN value.
00183 
00184   The macros are thus is only true if the value given is NaN.
00185 */
00186 #if defined(MAGICKCORE_HAVE_ISNAN)
00187 #  define IsNaN(a) isnan(a)
00188 #elif defined(_MSC_VER) && (_MSC_VER >= 1310)
00189 #  include <float.h>
00190 #  define IsNaN(a) _isnan(a)
00191 #else
00192 #  define IsNaN(a) ((a) != (a))
00193 #endif
00194 #if !defined(INFINITY)
00195 #  define INFINITY ((double) -logf(0f))
00196 #endif
00197 
00198 typedef struct _BlobInfo BlobInfo;
00199 
00200 typedef struct _ExceptionInfo ExceptionInfo;
00201 
00202 typedef struct _Image Image;
00203 
00204 typedef struct _ImageInfo ImageInfo;
00205 
00206 #if defined(__cplusplus) || defined(c_plusplus)
00207 }
00208 #endif
00209 
00210 #endif

Generated on 21 Sep 2020 for MagickCore by  doxygen 1.6.1