image-private.h

Go to the documentation of this file.
00001 /*
00002   Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization
00003   dedicated to making software imaging solutions freely available.
00004 
00005   You may not use this file except in compliance with the License.  You may
00006   obtain a copy of the License at
00007 
00008     https://imagemagick.org/script/license.php
00009 
00010   Unless required by applicable law or agreed to in writing, software
00011   distributed under the License is distributed on an "AS IS" BASIS,
00012   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013   See the License for the specific language governing permissions and
00014   limitations under the License.
00015 
00016   MagickCore image private methods.
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 BackgroundColor  "#ffffff"  /* white */
00026 #define BorderColor  "#dfdfdf"  /* gray */
00027 #define DefaultResolution  72.0
00028 #define DefaultTileFrame  "15x15+3+3"
00029 #define DefaultTileGeometry  "120x120+4+3>"
00030 #define DefaultTileLabel  "%f\n%G\n%b"
00031 #define ForegroundColor  "#000"  /* black */
00032 #define LoadImagesTag  "Load/Images"
00033 #define LoadImageTag  "Load/Image"
00034 #define Magick2PI  6.28318530717958647692528676655900576839433879875020
00035 #define MagickAbsoluteValue(x)  ((x) < 0 ? -(x) : (x))
00036 #define MagickMax(x,y)  (((x) > (y)) ? (x) : (y))
00037 #define MagickMin(x,y)  (((x) < (y)) ? (x) : (y))
00038 #define MagickPHI  1.61803398874989484820458683436563811772030917980576
00039 #define MagickPI2  1.57079632679489661923132169163975144209858469968755
00040 #define MagickPI  3.14159265358979323846264338327950288419716939937510
00041 #define MagickSQ1_2  0.70710678118654752440084436210484903928483593768847
00042 #define MagickSQ2  1.41421356237309504880168872420969807856967187537695
00043 #define MagickSQ2PI  2.50662827463100024161235523934010416269302368164062
00044 #define MatteColor  "#bdbdbd"  /* gray */
00045 #define PSDensityGeometry  "72.0x72.0"
00046 #define PSPageGeometry  "612x792"
00047 #define SaveImagesTag  "Save/Images"
00048 #define SaveImageTag  "Save/Image"
00049 #define TransparentColor  "#00000000"  /* transparent black */
00050 #define UndefinedCompressionQuality  0UL
00051 #define UndefinedTicksPerSecond  100L
00052 
00053 static inline double DegreesToRadians(const double degrees)
00054 {
00055   return((double) (MagickPI*degrees/180.0));
00056 }
00057 
00058 static inline MagickRealType RadiansToDegrees(const MagickRealType radians)
00059 {
00060   return((MagickRealType) (180.0*radians/MagickPI));
00061 }
00062 
00063 static inline unsigned char ScaleColor5to8(const unsigned int color)
00064 {
00065   return((unsigned char) (((color) << 3) | ((color) >> 2)));
00066 }
00067 
00068 static inline unsigned char ScaleColor6to8(const unsigned int color)
00069 {
00070   return((unsigned char) (((color) << 2) | ((color) >> 4)));
00071 }
00072 
00073 static inline unsigned int ScaleColor8to5(const unsigned char color)
00074 {
00075   return((unsigned int) (((color) & ~0x07) >> 3));
00076 }
00077 
00078 static inline unsigned int ScaleColor8to6(const unsigned char color)
00079 {
00080   return((unsigned int) (((color) & ~0x03) >> 2));
00081 }
00082 
00083 #if defined(__cplusplus) || defined(c_plusplus)
00084 }
00085 #endif
00086 
00087 #endif

Generated on 17 Mar 2020 for MagickCore by  doxygen 1.6.1