| 1 | |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | |
|---|
| 5 | |
|---|
| 6 | |
|---|
| 7 | |
|---|
| 8 | |
|---|
| 9 | |
|---|
| 10 | |
|---|
| 11 | |
|---|
| 12 | |
|---|
| 13 | |
|---|
| 14 | |
|---|
| 15 | |
|---|
| 16 | |
|---|
| 17 | |
|---|
| 18 | #ifndef _MAGICKCORE_IMAGE_PRIVATE_H |
|---|
| 19 | #define _MAGICKCORE_IMAGE_PRIVATE_H |
|---|
| 20 | |
|---|
| 21 | #if defined(__cplusplus) || defined(c_plusplus) |
|---|
| 22 | extern "C" { |
|---|
| 23 | #endif |
|---|
| 24 | |
|---|
| 25 | #define MagickPI 3.14159265358979323846264338327950288419716939937510 |
|---|
| 26 | #define MagickSQ1_2 0.7071067811865475244008443621048490 |
|---|
| 27 | #define MagickSQ2PI 2.50662827463100024161235523934010416269302368164062 |
|---|
| 28 | #define QuantumScale ((MagickRealType) 1.0/(MagickRealType) QuantumRange) |
|---|
| 29 | #define UndefinedTicksPerSecond 100L |
|---|
| 30 | #define UndefinedCompressionQuality 0UL |
|---|
| 31 | |
|---|
| 32 | extern MagickExport const char |
|---|
| 33 | *BackgroundColor, |
|---|
| 34 | *BorderColor, |
|---|
| 35 | *DefaultTileFrame, |
|---|
| 36 | *DefaultTileGeometry, |
|---|
| 37 | *DefaultTileLabel, |
|---|
| 38 | *ForegroundColor, |
|---|
| 39 | *MatteColor, |
|---|
| 40 | *LoadImageTag, |
|---|
| 41 | *LoadImagesTag, |
|---|
| 42 | *PSDensityGeometry, |
|---|
| 43 | *PSPageGeometry, |
|---|
| 44 | *SaveImageTag, |
|---|
| 45 | *SaveImagesTag; |
|---|
| 46 | |
|---|
| 47 | extern MagickExport const double |
|---|
| 48 | DefaultResolution; |
|---|
| 49 | |
|---|
| 50 | static inline double DegreesToRadians(const double degrees) |
|---|
| 51 | { |
|---|
| 52 | return(MagickPI*degrees/180.0); |
|---|
| 53 | } |
|---|
| 54 | |
|---|
| 55 | static inline MagickBooleanType QuantumTick(const MagickOffsetType offset, |
|---|
| 56 | const MagickSizeType span) |
|---|
| 57 | { |
|---|
| 58 | if ((offset & (offset-1)) == 0) |
|---|
| 59 | return(MagickTrue); |
|---|
| 60 | if ((offset & 0x7f) == 0) |
|---|
| 61 | return(MagickTrue); |
|---|
| 62 | if (offset == (MagickOffsetType) (span-1)) |
|---|
| 63 | return(MagickTrue); |
|---|
| 64 | return(MagickFalse); |
|---|
| 65 | } |
|---|
| 66 | |
|---|
| 67 | static inline MagickRealType RadiansToDegrees(const MagickRealType radians) |
|---|
| 68 | { |
|---|
| 69 | return(180.0*radians/MagickPI); |
|---|
| 70 | } |
|---|
| 71 | |
|---|
| 72 | static inline unsigned char ScaleColor5to8(const unsigned long color) |
|---|
| 73 | { |
|---|
| 74 | return((unsigned char) (((color) << 3) | ((color) >> 2))); |
|---|
| 75 | } |
|---|
| 76 | |
|---|
| 77 | static inline unsigned char ScaleColor6to8(const unsigned long color) |
|---|
| 78 | { |
|---|
| 79 | return((unsigned char) (((color) << 2) | ((color) >> 4))); |
|---|
| 80 | } |
|---|
| 81 | |
|---|
| 82 | static inline unsigned long ScaleColor8to5(const unsigned char color) |
|---|
| 83 | { |
|---|
| 84 | return((unsigned long) (((color) & ~0x07) >> 3)); |
|---|
| 85 | } |
|---|
| 86 | |
|---|
| 87 | static inline unsigned long ScaleColor8to6(const unsigned char color) |
|---|
| 88 | { |
|---|
| 89 | return((unsigned long) (((color) & ~0x03) >> 2)); |
|---|
| 90 | } |
|---|
| 91 | |
|---|
| 92 | #if defined(__cplusplus) || defined(c_plusplus) |
|---|
| 93 | } |
|---|
| 94 | #endif |
|---|
| 95 | |
|---|
| 96 | #endif |
|---|