00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef MAGICKCORE_IMAGE_PRIVATE_H
00019 #define MAGICKCORE_IMAGE_PRIVATE_H
00020
00021 #if defined(__cplusplus) || defined(c_plusplus)
00022 extern "C" {
00023 #endif
00024
00025 #define MagickAbsoluteValue(x) ((x) < 0 ? -(x) : (x))
00026 #define MagickMax(x,y) (((x) > (y)) ? (x) : (y))
00027 #define MagickMin(x,y) (((x) < (y)) ? (x) : (y))
00028 #define Magick2PI 6.28318530717958647692528676655900576839433879875020
00029 #define MagickPHI 1.61803398874989484820458683436563811772030917980576
00030 #define MagickPI 3.14159265358979323846264338327950288419716939937510
00031 #define MagickPI2 1.57079632679489661923132169163975144209858469968755
00032 #define MagickSQ1_2 0.70710678118654752440084436210484903928483593768847
00033 #define MagickSQ2 1.41421356237309504880168872420969807856967187537695
00034 #define MagickSQ2PI 2.50662827463100024161235523934010416269302368164062
00035 #define UndefinedTicksPerSecond 100L
00036 #define UndefinedCompressionQuality 0UL
00037
00038 extern MagickExport const char
00039 AlphaColor[],
00040 BackgroundColor[],
00041 BorderColor[],
00042 DefaultTileFrame[],
00043 DefaultTileGeometry[],
00044 DefaultTileLabel[],
00045 ForegroundColor[],
00046 LoadImageTag[],
00047 LoadImagesTag[],
00048 PSDensityGeometry[],
00049 PSPageGeometry[],
00050 SaveImageTag[],
00051 SaveImagesTag[];
00052
00053 extern MagickExport const double
00054 DefaultResolution;
00055
00056 static inline double DegreesToRadians(const double degrees)
00057 {
00058 return((double) (MagickPI*degrees/180.0));
00059 }
00060
00061 static inline double RadiansToDegrees(const double radians)
00062 {
00063 return((double) (180.0*radians/MagickPI));
00064 }
00065
00066 static inline unsigned char ScaleColor5to8(const unsigned int color)
00067 {
00068 return((unsigned char) (((color) << 3) | ((color) >> 2)));
00069 }
00070
00071 static inline unsigned char ScaleColor6to8(const unsigned int color)
00072 {
00073 return((unsigned char) (((color) << 2) | ((color) >> 4)));
00074 }
00075
00076 static inline unsigned int ScaleColor8to5(const unsigned char color)
00077 {
00078 return((unsigned int) (((color) & ~0x07) >> 3));
00079 }
00080
00081 static inline unsigned int ScaleColor8to6(const unsigned char color)
00082 {
00083 return((unsigned int) (((color) & ~0x03) >> 2));
00084 }
00085
00086 #if defined(__cplusplus) || defined(c_plusplus)
00087 }
00088 #endif
00089
00090 #endif