MagickCore  6.7.5
magick-type.h
Go to the documentation of this file.
00001 /*
00002   Copyright 1999-2012 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.
00006   obtain a copy of the License at
00007   
00008     http://www.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 #if defined(__cplusplus) || defined(c_plusplus)
00022 extern "C" {
00023 #endif
00024 
00025 #include "MagickCore/magick-config.h"
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_QUANTUM_DEPTH == 8)
00040 #define MagickEpsilon  1.0e-6
00041 #define MaxColormapSize  256UL
00042 #define MaxMap  255UL
00043 
00044 #if defined __arm__ || defined __thumb__
00045 typedef float MagickRealType;
00046 #else
00047 typedef double MagickRealType;
00048 #endif
00049 #if defined(MAGICKCORE_HDRI_SUPPORT)
00050 typedef float Quantum;
00051 #define QuantumRange  255.0
00052 #define QuantumFormat  "%g"
00053 #else
00054 typedef unsigned char Quantum;
00055 #define QuantumRange  255
00056 #define QuantumFormat  "%u"
00057 #endif
00058 #elif (MAGICKCORE_QUANTUM_DEPTH == 16)
00059 #define MagickEpsilon  1.0e-10
00060 #define MaxColormapSize  65536UL
00061 #define MaxMap  65535UL
00062 
00063 #if defined __arm__ || defined __thumb__
00064 typedef float MagickRealType;
00065 #else
00066 typedef double MagickRealType;
00067 #endif
00068 #if defined(MAGICKCORE_HDRI_SUPPORT)
00069 typedef float Quantum;
00070 #define QuantumRange  65535.0
00071 #define QuantumFormat  "%g"
00072 #else
00073 typedef unsigned short Quantum;
00074 #define QuantumRange  65535
00075 #define QuantumFormat  "%u"
00076 #endif
00077 #elif (MAGICKCORE_QUANTUM_DEPTH == 32)
00078 #define MagickEpsilon  1.0e-10
00079 #define MaxColormapSize  65536UL
00080 #define MaxMap  65535UL
00081 
00082 typedef double MagickRealType;
00083 #if defined(MAGICKCORE_HDRI_SUPPORT)
00084 typedef float Quantum;
00085 #define QuantumRange  4294967295.0
00086 #define QuantumFormat  "%g"
00087 #else
00088 typedef unsigned int Quantum;
00089 #define QuantumRange  4294967295
00090 #define QuantumFormat  "%u"
00091 #endif
00092 #elif (MAGICKCORE_QUANTUM_DEPTH == 64) && defined(MAGICKCORE_HAVE_LONG_DOUBLE_WIDER)
00093 #define MagickEpsilon  1.0e-10
00094 #define MaxColormapSize  65536UL
00095 #define MaxMap  65535UL
00096 
00097 typedef long double MagickRealType;
00098 typedef double Quantum;
00099 #define QuantumRange  18446744073709551615.0
00100 #define QuantumFormat  "%g"
00101 #else
00102 #if !defined(_CH_)
00103 # error "MAGICKCORE_QUANTUM_DEPTH must be one of 8, 16, 32, or 64"
00104 #endif
00105 #endif
00106 #define MagickHuge  3.402823466E+38F
00107 #define MagickPI  3.14159265358979323846264338327950288419716939937510L
00108 #define QuantumScale  ((double) 1.0/(double) QuantumRange)
00109 
00110 /*
00111   Typedef declarations.
00112 */
00113 typedef unsigned int MagickStatusType;
00114 #if !defined(MAGICKCORE_WINDOWS_SUPPORT)
00115 #if (MAGICKCORE_SIZEOF_UNSIGNED_LONG_LONG == 8)
00116 typedef long long MagickOffsetType;
00117 typedef unsigned long long MagickSizeType;
00118 #define MagickOffsetFormat  "lld"
00119 #define MagickSizeFormat  "llu"
00120 #else
00121 typedef ssize_t MagickOffsetType;
00122 typedef size_t MagickSizeType;
00123 #define MagickOffsetFormat  "ld"
00124 #define MagickSizeFormat  "lu"
00125 #endif
00126 #else
00127 typedef __int64 MagickOffsetType;
00128 typedef unsigned __int64 MagickSizeType;
00129 #define MagickOffsetFormat  "I64i"
00130 #define MagickSizeFormat  "I64u"
00131 #endif
00132 
00133 #if QuantumDepth > 16
00134   typedef double SignedQuantum;
00135 #else
00136   typedef ssize_t SignedQuantum;
00137 #endif
00138 
00139 #if defined(_MSC_VER) && (_MSC_VER == 1200)
00140 typedef MagickOffsetType QuantumAny;
00141 #else
00142 typedef MagickSizeType QuantumAny;
00143 #endif
00144 
00145 #if defined(macintosh)
00146 #define ExceptionInfo  MagickExceptionInfo
00147 #endif
00148 
00149 typedef enum
00150 {
00151   UndefinedClass,
00152   DirectClass,
00153   PseudoClass
00154 } ClassType;
00155 
00156 typedef enum
00157 {
00158   MagickFalse = 0,
00159   MagickTrue = 1
00160 } MagickBooleanType;
00161 
00162 typedef struct _BlobInfo BlobInfo;
00163 
00164 typedef struct _ExceptionInfo ExceptionInfo;
00165 
00166 typedef struct _Image Image;
00167 
00168 typedef struct _ImageInfo ImageInfo;
00169 
00170 #if defined(__cplusplus) || defined(c_plusplus)
00171 }
00172 #endif
00173 
00174 #endif