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 "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 defined(_MSC_VER) && (_MSC_VER == 1200)
00148 typedef MagickOffsetType QuantumAny;
00149 #else
00150 typedef MagickSizeType QuantumAny;
00151 #endif
00152 
00153 #if defined(macintosh)
00154 #define ExceptionInfo  MagickExceptionInfo
00155 #endif
00156 
00157 typedef enum
00158 {
00159   UndefinedChannel,
00160   RedChannel = 0x0001,
00161   GrayChannel = 0x0001,
00162   CyanChannel = 0x0001,
00163   GreenChannel = 0x0002,
00164   MagentaChannel = 0x0002,
00165   BlueChannel = 0x0004,
00166   YellowChannel = 0x0004,
00167   AlphaChannel = 0x0008,
00168   OpacityChannel = 0x0008,
00169   MatteChannel = 0x0008,     /* deprecated */
00170   BlackChannel = 0x0020,
00171   IndexChannel = 0x0020,
00172   CompositeChannels = 0x002F,
00173   AllChannels = 0x7ffffff,
00174   /*
00175     Special purpose channel types.
00176   */
00177   TrueAlphaChannel = 0x0040, /* extract actual alpha channel from opacity */
00178   RGBChannels = 0x0080,      /* set alpha from  grayscale mask in RGB */
00179   GrayChannels = 0x0080,
00180   SyncChannels = 0x0100,     /* channels should be modified equally */
00181   DefaultChannels = ((AllChannels | SyncChannels) &~ OpacityChannel)
00182 } ChannelType;
00183 
00184 typedef enum
00185 {
00186   UndefinedClass,
00187   DirectClass,
00188   PseudoClass
00189 } ClassType;
00190 
00191 typedef enum
00192 {
00193   MagickFalse = 0,
00194   MagickTrue = 1
00195 } MagickBooleanType;
00196 
00197 /*
00198   The IsNaN test is for special floating point numbers of value Nan (not a
00199   number). NaN's are defined as part of the IEEE standard for floating point
00200   number representation, and need to be watched out for. Morphology Kernels
00201   often use these special numbers as neighbourhood masks.
00202 
00203   The special property that two NaN's are never equal, even if they are from
00204   the same variable allows you to test if a value is special NaN value.
00205 
00206   The macros are thus is only true if the value given is NaN.
00207 */
00208 #if defined(MAGICKCORE_HAVE_ISNAN)
00209 #  define IsNaN(a) isnan(a)
00210 #elif defined(_MSC_VER) && (_MSC_VER >= 1310)
00211 #  include <float.h>
00212 #  define IsNaN(a) _isnan(a)
00213 #else
00214 #  define IsNaN(a) ((a) != (a))
00215 #endif
00216 #if !defined(INFINITY)
00217 #  define INFINITY ((double) -logf(0f))
00218 #endif
00219 
00220 typedef struct _BlobInfo BlobInfo;
00221 
00222 typedef struct _ExceptionInfo ExceptionInfo;
00223 
00224 typedef struct _Image Image;
00225 
00226 typedef struct _ImageInfo ImageInfo;
00227 
00228 #if defined(__cplusplus) || defined(c_plusplus)
00229 }
00230 #endif
00231 
00232 #endif

Generated on 29 Oct 2019 for MagickCore by  doxygen 1.6.1