draw-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_DRAW_PRIVATE_H
00019 #define _MAGICKCORE_DRAW_PRIVATE_H
00020
00021 #if defined(__cplusplus) || defined(c_plusplus)
00022 extern "C" {
00023 #endif
00024
00025 #include "magick/cache.h"
00026 #include "magick/image.h"
00027 #include "magick/memory_.h"
00028
00029 static inline MagickBooleanType GetFillColor(const DrawInfo *draw_info,
00030 const long x,const long y,PixelPacket *pixel)
00031 {
00032 Image
00033 *pattern;
00034
00035 MagickBooleanType
00036 status;
00037
00038 pattern=draw_info->fill_pattern;
00039 if (pattern == (Image *) NULL)
00040 {
00041 *pixel=draw_info->fill;
00042 return(MagickTrue);
00043 }
00044 #if defined(MAGICKCORE_OPENMP_SUPPORT) && (_OPENMP >= 200203)
00045 #pragma omp critical
00046 #endif
00047 status=GetOneVirtualMethodPixel(pattern,TileVirtualPixelMethod,
00048 x+pattern->tile_offset.x,y+pattern->tile_offset.y,pixel,
00049 &pattern->exception);
00050 if (pattern->matte == MagickFalse)
00051 pixel->opacity=OpaqueOpacity;
00052 return(status);
00053 }
00054
00055 static inline MagickBooleanType GetStrokeColor(const DrawInfo *draw_info,
00056 const long x,const long y,PixelPacket *pixel)
00057 {
00058 Image
00059 *pattern;
00060
00061 MagickBooleanType
00062 status;
00063
00064 pattern=draw_info->stroke_pattern;
00065 if (pattern == (Image *) NULL)
00066 {
00067 *pixel=draw_info->stroke;
00068 return(MagickTrue);
00069 }
00070 #if defined(MAGICKCORE_OPENMP_SUPPORT) && (_OPENMP >= 200203)
00071 #pragma omp critical
00072 #endif
00073 status=GetOneVirtualMethodPixel(pattern,TileVirtualPixelMethod,
00074 x+pattern->tile_offset.x,y+pattern->tile_offset.y,pixel,
00075 &pattern->exception);
00076 if (pattern->matte == MagickFalse)
00077 pixel->opacity=OpaqueOpacity;
00078 return(status);
00079 }
00080
00081 #if defined(__cplusplus) || defined(c_plusplus)
00082 }
00083 #endif
00084
00085 #endif