/*
- Copyright 1999-2011 ImageMagick Studio LLC, a non-profit organization
+ Copyright 1999-2012 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License.
#define MaxColormapSize 256UL
#define MaxMap 255UL
+#if defined __arm__ || defined __thumb__
+typedef float MagickRealType;
+#else
typedef double MagickRealType;
+#endif
#if defined(MAGICKCORE_HDRI_SUPPORT)
typedef float Quantum;
#define QuantumRange 255.0
#define MaxColormapSize 65536UL
#define MaxMap 65535UL
+#if defined __arm__ || defined __thumb__
+typedef float MagickRealType;
+#else
typedef double MagickRealType;
+#endif
#if defined(MAGICKCORE_HDRI_SUPPORT)
typedef float Quantum;
#define QuantumRange 65535.0
#define MagickSizeFormat "I64u"
#endif
+#if QuantumDepth > 16
+ typedef double SignedQuantum;
+#else
+ typedef ssize_t SignedQuantum;
+#endif
+
#if defined(_MSC_VER) && (_MSC_VER == 1200)
typedef MagickOffsetType QuantumAny;
#else
#define ExceptionInfo MagickExceptionInfo
#endif
-typedef enum
-{
- UndefinedChannel = 0x0000,
- RedChannel = 0x0001,
- GrayChannel = 0x0001,
- CyanChannel = 0x0001,
- GreenChannel = 0x0002,
- MagentaChannel = 0x0002,
- BlueChannel = 0x0004,
- YellowChannel = 0x0004,
- AlphaChannel = 0x0008,
- OpacityChannel = 0x0008,
- BlackChannel = 0x0010,
- IndexChannel = 0x0020,
- CompositeChannels = 0x002F,
- AllChannels = 0x7ffffff,
- /*
- Special purpose channel types.
- */
- TrueAlphaChannel = 0x0040, /* extract actual alpha channel from opacity */
- RGBChannels = 0x0080, /* set alpha from grayscale mask in RGB */
- GrayChannels = 0x0080,
- SyncChannels = 0x0100, /* channels should be modified equally */
- DefaultChannels = ((AllChannels | SyncChannels) &~ AlphaChannel)
-} ChannelType;
-
typedef enum
{
UndefinedClass,
MagickTrue = 1
} MagickBooleanType;
+/*
+ Define some short-hand macros for handling MagickBooleanType
+ Some of these assume MagickBooleanType uses values 0 and 1,
+ and uses fast C typing with C boolean operations
+
+ Is -- returns MagickBooleanType
+ If -- returns C integer boolean (for if's and while's)
+
+ IsTrue() converts a C integer boolean to a MagickBooleanType
+ IsFalse() is a MagickBooleanType 'not' operation
+
+ IfTrue() converts MagickBooleanType to C integer Boolean
+ IfFalse() Not the MagickBooleanType to C integer Boolean
+
+ IsNULL() and IsNotNULL() converts C pointers to MagickBooleanType
+*/
+#if 1
+# define IsMagickTrue(v) ((MagickBooleanType)((int)(v)!= 0))
+# define IsMagickFalse(v) ((MagickBooleanType)(!(int)(v)))
+# define IfMagickTrue(v) ((int)(v))
+# define IfMagickFalse(v) (!(int)(v))
+#else
+# define IsMagickTrue(v) (((MagickBooleanType)(v))!=MagickFalse?MagickTrue:MagickFalse)
+# define IsMagickFalse(v) (((MagickBooleanType)(v))==MagickFalse?MagickTrue:MagickFalse)
+# define IfMagickTrue(v) ((v) != MagickFalse)
+# define IfMagickFalse(v) ((v) == MagickFalse)
+#endif
+#define IsMagickNULL(v) (((void *)(v) == NULL)?MagickTrue:MagickFalse)
+#define IsMagickNotNULL(v) (((void *)(v) != NULL)?MagickTrue:MagickFalse)
+
typedef struct _BlobInfo BlobInfo;
typedef struct _ExceptionInfo ExceptionInfo;