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 "magick/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 #if !defined(MagickPathExtent)
00031 #define MagickPathExtent  MaxTextExtent
00032 #endif
00033 
00034 #if defined(MAGICKCORE_WINDOWS_SUPPORT) && !defined(__MINGW32__)
00035 #  define MagickLLConstant(c)  ((MagickOffsetType) (c ## i64))
00036 #  define MagickULLConstant(c)  ((MagickSizeType) (c ## ui64))
00037 #else
00038 #  define MagickLLConstant(c)  ((MagickOffsetType) (c ## LL))
00039 #  define MagickULLConstant(c)  ((MagickSizeType) (c ## ULL))
00040 #endif
00041 
00042 #if MAGICKCORE_SIZEOF_FLOAT_T == 0
00043 typedef float MagickFloatType;
00044 #elif (MAGICKCORE_SIZEOF_FLOAT_T == MAGICKCORE_SIZEOF_FLOAT)
00045 typedef float MagickFloatType;
00046 #elif (MAGICKCORE_SIZEOF_FLOAT_T == MAGICKCORE_SIZEOF_DOUBLE)
00047 typedef double MagickFloatType;
00048 #elif (MAGICKCORE_SIZEOF_FLOAT_T == MAGICKCORE_SIZEOF_LONG_DOUBLE)
00049 typedef long double MagickFloatType;
00050 #else
00051 #error Your MagickFloatType type is neither a float, nor a double, nor a long double
00052 #endif
00053 #if MAGICKCORE_SIZEOF_DOUBLE_T == 0
00054 typedef double MagickDoubleType;
00055 #elif (MAGICKCORE_SIZEOF_DOUBLE_T == MAGICKCORE_SIZEOF_DOUBLE)
00056 typedef double MagickDoubleType;
00057 #elif (MAGICKCORE_SIZEOF_DOUBLE_T == MAGICKCORE_SIZEOF_LONG_DOUBLE)
00058 typedef long double MagickDoubleType;
00059 #else
00060 #error Your MagickDoubleType type is neither a float, nor a double, nor a long double
00061 #endif
00062 
00063 #if (MAGICKCORE_QUANTUM_DEPTH == 8)
00064 #define MaxColormapSize  256UL
00065 #define MaxMap  255UL
00066 typedef ssize_t SignedQuantum;
00067 #if defined(MAGICKCORE_HDRI_SUPPORT)
00068 typedef MagickFloatType Quantum;
00069 #define QuantumRange  255.0
00070 #define QuantumFormat  "%g"
00071 #else
00072 typedef unsigned char Quantum;
00073 #define QuantumRange  ((Quantum) 255)
00074 #define QuantumFormat  "%u"
00075 #endif
00076 #elif (MAGICKCORE_QUANTUM_DEPTH == 16)
00077 #define MaxColormapSize  65536UL
00078 #define MaxMap  65535UL
00079 typedef ssize_t SignedQuantum;
00080 #if defined(MAGICKCORE_HDRI_SUPPORT)
00081 typedef MagickFloatType Quantum;
00082 #define QuantumRange  65535.0
00083 #define QuantumFormat  "%g"
00084 #else
00085 typedef unsigned short Quantum;
00086 #define QuantumRange  ((Quantum) 65535)
00087 #define QuantumFormat  "%u"
00088 #endif
00089 #elif (MAGICKCORE_QUANTUM_DEPTH == 32)
00090 #define MaxColormapSize  65536UL
00091 #define MaxMap  65535UL
00092 typedef MagickDoubleType SignedQuantum;
00093 #if defined(MAGICKCORE_HDRI_SUPPORT)
00094 typedef MagickDoubleType Quantum;
00095 #define QuantumRange  4294967295.0
00096 #define QuantumFormat  "%g"
00097 #else
00098 typedef unsigned int Quantum;
00099 #define QuantumRange  ((Quantum) 4294967295)
00100 #define QuantumFormat  "%u"
00101 #endif
00102 #elif (MAGICKCORE_QUANTUM_DEPTH == 64)
00103 #define MAGICKCORE_HDRI_SUPPORT 1
00104 #define MaxColormapSize  65536UL
00105 #define MaxMap  65535UL
00106 typedef MagickDoubleType SignedQuantum;
00107 typedef MagickDoubleType Quantum;
00108 #define QuantumRange  18446744073709551615.0
00109 #define QuantumFormat  "%g"
00110 #else
00111 #if !defined(_CH_)
00112 # error "MAGICKCORE_QUANTUM_DEPTH must be one of 8, 16, 32, or 64"
00113 #endif
00114 #endif
00115 #define MagickEpsilon  (1.0e-12)
00116 #define MagickMaximumValue  1.79769313486231570E+308
00117 #define MagickMinimumValue   2.22507385850720140E-308
00118 #define MagickStringify(macro_or_string)  MagickStringifyArg(macro_or_string)
00119 #define MagickStringifyArg(contents)  #contents
00120 #define QuantumScale  ((double) 1.0/(double) QuantumRange)
00121 
00122 /*
00123   Typedef declarations.
00124 */
00125 typedef MagickDoubleType MagickRealType;
00126 
00127 typedef unsigned int MagickStatusType;
00128 #if !defined(MAGICKCORE_WINDOWS_SUPPORT)
00129 #if (MAGICKCORE_SIZEOF_UNSIGNED_LONG_LONG == 8)
00130 typedef long long MagickOffsetType;
00131 typedef unsigned long long MagickSizeType;
00132 #define MagickOffsetFormat  "lld"
00133 #define MagickSizeFormat  "llu"
00134 #else
00135 typedef ssize_t MagickOffsetType;
00136 typedef size_t MagickSizeType;
00137 #define MagickOffsetFormat  "ld"
00138 #define MagickSizeFormat  "lu"
00139 #endif
00140 #else
00141 typedef __int64 MagickOffsetType;
00142 typedef unsigned __int64 MagickSizeType;
00143 #define MagickOffsetFormat  "I64i"
00144 #define MagickSizeFormat  "I64u"
00145 #endif
00146 
00147 #if MAGICKCORE_HAVE_UINTPTR_T || defined(uintptr_t)
00148 typedef uintptr_t MagickAddressType;
00149 #else
00150 /* Hope for the best, I guess. */
00151 typedef size_t MagickAddressType;
00152 #endif
00153 
00154 #if defined(_MSC_VER) && (_MSC_VER == 1200)
00155 typedef MagickOffsetType QuantumAny;
00156 #else
00157 typedef MagickSizeType QuantumAny;
00158 #endif
00159 
00160 #if defined(macintosh)
00161 #define ExceptionInfo  MagickExceptionInfo
00162 #endif
00163 
00164 typedef enum
00165 {
00166   UndefinedChannel,
00167   RedChannel = 0x0001,
00168   GrayChannel = 0x0001,
00169   CyanChannel = 0x0001,
00170   GreenChannel = 0x0002,
00171   MagentaChannel = 0x0002,
00172   BlueChannel = 0x0004,
00173   YellowChannel = 0x0004,
00174   AlphaChannel = 0x0008,
00175   OpacityChannel = 0x0008,
00176   MatteChannel = 0x0008,     /* deprecated */
00177   BlackChannel = 0x0020,
00178   IndexChannel = 0x0020,
00179   CompositeChannels = 0x002F,
00180   AllChannels = 0x7ffffff,
00181   /*
00182     Special purpose channel types.
00183   */
00184   TrueAlphaChannel = 0x0040, /* extract actual alpha channel from opacity */
00185   RGBChannels = 0x0080,      /* set alpha from  grayscale mask in RGB */
00186   GrayChannels = 0x0080,
00187   SyncChannels = 0x0100,     /* channels should be modified equally */
00188   DefaultChannels = ((AllChannels | SyncChannels) &~ OpacityChannel)
00189 } ChannelType;
00190 
00191 typedef enum
00192 {
00193   UndefinedClass,
00194   DirectClass,
00195   PseudoClass
00196 } ClassType;
00197 
00198 typedef enum
00199 {
00200   MagickFalse = 0,
00201   MagickTrue = 1
00202 } MagickBooleanType;
00203 
00204 /*
00205   The IsNaN test is for special floating point numbers of value Nan (not a
00206   number). NaN's are defined as part of the IEEE standard for floating point
00207   number representation, and need to be watched out for. Morphology Kernels
00208   often use these special numbers as neighbourhood masks.
00209 
00210   The special property that two NaN's are never equal, even if they are from
00211   the same variable allows you to test if a value is special NaN value.
00212 
00213   The macros are thus is only true if the value given is NaN.
00214 */
00215 #if defined(MAGICKCORE_HAVE_ISNAN)
00216 #  define IsNaN(a) isnan(a)
00217 #elif defined(_MSC_VER) && (_MSC_VER >= 1310)
00218 #  include <float.h>
00219 #  define IsNaN(a) _isnan(a)
00220 #else
00221 #  define IsNaN(a) ((a) != (a))
00222 #endif
00223 #if !defined(INFINITY)
00224 #  define INFINITY ((double) -logf(0f))
00225 #endif
00226 
00227 typedef struct _BlobInfo BlobInfo;
00228 
00229 typedef struct _ExceptionInfo ExceptionInfo;
00230 
00231 typedef struct _Image Image;
00232 
00233 typedef struct _ImageInfo ImageInfo;
00234 
00235 #if defined(__cplusplus) || defined(c_plusplus)
00236 }
00237 #endif
00238 
00239 #endif

Generated on 10 Aug 2020 for MagickCore by  doxygen 1.6.1