magick-type.h

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

Generated on 14 Nov 2019 for MagickCore by  doxygen 1.6.1