|
MagickCore
6.7.5
|
00001 /* 00002 Copyright 1999-2012 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. 00006 obtain a copy of the License at 00007 00008 http://www.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 private image drawing methods. 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 "MagickCore/cache.h" 00026 #include "MagickCore/image.h" 00027 #include "MagickCore/memory_.h" 00028 00029 static inline MagickBooleanType GetFillColor(const DrawInfo *draw_info, 00030 const ssize_t x,const ssize_t y,PixelInfo *fill,ExceptionInfo *exception) 00031 { 00032 if (draw_info->fill_pattern == (Image *) NULL) 00033 { 00034 *fill=draw_info->fill; 00035 return(MagickTrue); 00036 } 00037 { 00038 Image 00039 *pattern; 00040 00041 MagickBooleanType 00042 status; 00043 00044 pattern=draw_info->fill_pattern; 00045 status=GetOneVirtualPixelInfo(pattern,TileVirtualPixelMethod,x+ 00046 pattern->tile_offset.x,y+pattern->tile_offset.y,fill,exception); 00047 return(status); 00048 } 00049 } 00050 00051 static inline MagickBooleanType GetStrokeColor(const DrawInfo *draw_info, 00052 const ssize_t x,const ssize_t y,PixelInfo *stroke,ExceptionInfo *exception) 00053 { 00054 if (draw_info->stroke_pattern == (Image *) NULL) 00055 { 00056 *stroke=draw_info->stroke; 00057 return(MagickTrue); 00058 } 00059 { 00060 Image 00061 *pattern; 00062 00063 MagickBooleanType 00064 status; 00065 00066 pattern=draw_info->stroke_pattern; 00067 status=GetOneVirtualPixelInfo(pattern,TileVirtualPixelMethod,x+ 00068 pattern->tile_offset.x,y+pattern->tile_offset.y,stroke,exception); 00069 return(status); 00070 } 00071 } 00072 00073 #if defined(__cplusplus) || defined(c_plusplus) 00074 } 00075 #endif 00076 00077 #endif