18 #ifndef MAGICKCORE_IMAGE_PRIVATE_H 19 #define MAGICKCORE_IMAGE_PRIVATE_H 25 #if defined(__cplusplus) || defined(c_plusplus) 29 #define MagickAbsoluteValue(x) ((x) < 0 ? -(x) : (x)) 30 #define MagickMax(x,y) (((x) > (y)) ? (x) : (y)) 31 #define MagickMin(x,y) (((x) < (y)) ? (x) : (y)) 32 #define MAGICK_INT_MAX (INT_MAX) 33 #define MagickPI 3.14159265358979323846264338327950288419716939937510 34 #define Magick2PI 6.28318530717958647692528676655900576839433879875020 35 #define MagickPHI 1.61803398874989484820458683436563811772030917980576 36 #define MagickPI2 1.57079632679489661923132169163975144209858469968755 37 #define MAGICK_PTRDIFF_MAX (PTRDIFF_MAX) 38 #define MAGICK_PTRDIFF_MIN (-PTRDIFF_MAX-1) 39 #define MagickSQ1_2 0.70710678118654752440084436210484903928483593768847 40 #define MagickSQ2 1.41421356237309504880168872420969807856967187537695 41 #define MagickSQ2PI 2.50662827463100024161235523934010416269302368164062 42 #define MAGICK_SIZE_MAX (SIZE_MAX) 43 #define MAGICK_SSIZE_MAX (SSIZE_MAX) 44 #define MAGICK_SSIZE_MIN (-(SSIZE_MAX)-1) 45 #define MAGICK_UCHAR_MAX (UCHAR_MAX) 46 #define MAGICK_USHORT_MAX (USHRT_MAX) 47 #define UndefinedTicksPerSecond 100L 48 #define UndefinedCompressionQuality 0UL 79 value=(x < 0.0) ? ceil(x) : floor(x);
88 return(MAGICK_INT_MAX);
103 value=(x < 0.0) ? ceil(x) : floor(x);
107 return(MAGICK_SSIZE_MIN);
112 return(MAGICK_SSIZE_MAX);
114 return((ssize_t) value);
127 value=(x < 0.0) ? ceil(x) : floor(x);
151 value=(x < 0.0) ? ceil(x) : floor(x);
160 return(MAGICK_SIZE_MAX);
162 return((
size_t) value);
175 value=(x < 0.0) ? ceil(x) : floor(x);
179 return(MAGICK_SSIZE_MIN);
184 return(MAGICK_SSIZE_MAX);
186 return((ssize_t) value);
199 value=(x < 0.0) ? ceil(x) : floor(x);
208 return(MAGICK_UCHAR_MAX);
210 return((
unsigned char) value);
223 value=(x < 0.0) ? ceil(x) : floor(x);
232 return(MAGICK_USHORT_MAX);
234 return((
unsigned short) value);
247 value=(x < 0.0) ? ceil(x) : floor(x);
256 return(MAGICK_SIZE_MAX);
258 return((
size_t) value);
263 return((
double) (
MagickPI*degrees/180.0));
273 return((
unsigned char) (((color) << 3) | ((color) >> 2)));
278 return((
unsigned char) (((color) << 2) | ((color) >> 4)));
283 return((
unsigned int) (((color) & ~0x07) >> 3));
288 return((
unsigned int) (((color) & ~0x03) >> 2));
291 #if defined(__cplusplus) || defined(c_plusplus) MagickDoubleType MagickRealType
Definition: magick-type.h:125
MagickExport const char BackgroundColor[]
Definition: image.c:109
#define MAGICK_SSIZE_MIN
Definition: image-private.h:44
MagickExport const char PSDensityGeometry[]
Definition: image.c:118
static unsigned char ScaleColor6to8(const unsigned int color)
Definition: image-private.h:276
#define MAGICK_SIZE_MAX
Definition: image-private.h:42
MagickExport const char DefaultTileFrame[]
Definition: image.c:111
static unsigned char ScaleColor5to8(const unsigned int color)
Definition: image-private.h:271
#define MAGICK_SSIZE_MAX
Definition: image-private.h:43
MagickExport const char DefaultTileGeometry[]
Definition: image.c:112
static int CastDoubleToInt(const double x)
Definition: image-private.h:69
static size_t CastDoubleToUnsigned(const double x)
Definition: image-private.h:237
#define MagickPI
Definition: image-private.h:33
MagickExport const char LoadImageTag[]
Definition: image.c:115
MagickExport const char ForegroundColor[]
Definition: image.c:114
static QuantumAny CastDoubleToQuantumAny(const double x)
Definition: image-private.h:117
static unsigned int ScaleColor8to6(const unsigned char color)
Definition: image-private.h:286
static ssize_t CastDoubleToLong(const double x)
Definition: image-private.h:93
static double DegreesToRadians(const double degrees)
Definition: image-private.h:261
static unsigned int ScaleColor8to5(const unsigned char color)
Definition: image-private.h:281
MagickExport const char DefaultTileLabel[]
Definition: image.c:113
static unsigned short CastDoubleToUShort(const double x)
Definition: image-private.h:213
MagickExport const char BorderColor[]
Definition: image.c:110
static size_t CastDoubleToSizeT(const double x)
Definition: image-private.h:141
#define MAGICK_UCHAR_MAX
Definition: image-private.h:45
MagickExport const char SaveImageTag[]
Definition: image.c:120
#define IsNaN(a)
Definition: magick-type.h:214
MagickExport const char LoadImagesTag[]
Definition: image.c:116
MagickExport const char MatteColor[]
Definition: image.c:117
static ssize_t CastDoubleToSsizeT(const double x)
Definition: image-private.h:165
#define MAGICK_INT_MAX
Definition: image-private.h:32
static MagickRealType RadiansToDegrees(const MagickRealType radians)
Definition: image-private.h:266
#define MagickExport
Definition: method-attribute.h:80
static unsigned char CastDoubleToUChar(const double x)
Definition: image-private.h:189
MagickExport const double DefaultResolution
Definition: image.c:125
#define MAGICK_USHORT_MAX
Definition: image-private.h:46
MagickSizeType QuantumAny
Definition: magick-type.h:150
MagickExport const char PSPageGeometry[]
Definition: image.c:119
MagickExport const char SaveImagesTag[]
Definition: image.c:121