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

Generated on 30 Nov 2020 for MagickCore by  doxygen 1.6.1