image-private.h
Go to the documentation of this file.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 MagickPI 3.14159265358979323846264338327950288419716939937510
00026 #define Magick2PI 6.28318530717958647692528676655900576839433879875020
00027 #define MagickPI2 1.57079632679489661923132169163975144209858469968755
00028 #define MagickSQ1_2 0.7071067811865475244008443621048490
00029 #define MagickSQ2PI 2.50662827463100024161235523934010416269302368164062
00030 #define QuantumScale ((double) 1.0/(double) QuantumRange)
00031 #define UndefinedTicksPerSecond 100L
00032 #define UndefinedCompressionQuality 0UL
00033
00034 extern MagickExport const char
00035 *BackgroundColor,
00036 *BorderColor,
00037 *DefaultTileFrame,
00038 *DefaultTileGeometry,
00039 *DefaultTileLabel,
00040 *ForegroundColor,
00041 *MatteColor,
00042 *LoadImageTag,
00043 *LoadImagesTag,
00044 *PSDensityGeometry,
00045 *PSPageGeometry,
00046 *SaveImageTag,
00047 *SaveImagesTag;
00048
00049 extern MagickExport const double
00050 DefaultResolution;
00051
00052 static inline double DegreesToRadians(const double degrees)
00053 {
00054 return(MagickPI*degrees/180.0);
00055 }
00056
00057 static inline MagickRealType RadiansToDegrees(const MagickRealType radians)
00058 {
00059 return(180.0*radians/MagickPI);
00060 }
00061
00062 static inline unsigned char ScaleColor5to8(const unsigned long color)
00063 {
00064 return((unsigned char) (((color) << 3) | ((color) >> 2)));
00065 }
00066
00067 static inline unsigned char ScaleColor6to8(const unsigned long color)
00068 {
00069 return((unsigned char) (((color) << 2) | ((color) >> 4)));
00070 }
00071
00072 static inline unsigned long ScaleColor8to5(const unsigned char color)
00073 {
00074 return((unsigned long) (((color) & ~0x07) >> 3));
00075 }
00076
00077 static inline unsigned long ScaleColor8to6(const unsigned char color)
00078 {
00079 return((unsigned long) (((color) & ~0x03) >> 2));
00080 }
00081
00082 #if defined(__cplusplus) || defined(c_plusplus)
00083 }
00084 #endif
00085
00086 #endif