cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 1 | /* |
cristy | 45ef08f | 2012-12-07 13:13:34 +0000 | [diff] [blame] | 2 | Copyright 1999-2013 ImageMagick Studio LLC, a non-profit organization |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 3 | dedicated to making software imaging solutions freely available. |
| 4 | |
| 5 | You may not use this file except in compliance with the License. |
| 6 | obtain a copy of the License at |
| 7 | |
| 8 | http://www.imagemagick.org/script/license.php |
| 9 | |
| 10 | Unless required by applicable law or agreed to in writing, software |
| 11 | distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | See the License for the specific language governing permissions and |
| 14 | limitations under the License. |
| 15 | |
| 16 | MagickCore private image drawing methods. |
| 17 | */ |
| 18 | #ifndef _MAGICKCORE_DRAW_PRIVATE_H |
| 19 | #define _MAGICKCORE_DRAW_PRIVATE_H |
| 20 | |
| 21 | #if defined(__cplusplus) || defined(c_plusplus) |
| 22 | extern "C" { |
| 23 | #endif |
| 24 | |
cristy | 4c08aed | 2011-07-01 19:47:50 +0000 | [diff] [blame] | 25 | #include "MagickCore/cache.h" |
| 26 | #include "MagickCore/image.h" |
| 27 | #include "MagickCore/memory_.h" |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 28 | |
| 29 | static inline MagickBooleanType GetFillColor(const DrawInfo *draw_info, |
cristy | 101ab70 | 2011-10-13 13:06:32 +0000 | [diff] [blame] | 30 | const ssize_t x,const ssize_t y,PixelInfo *fill,ExceptionInfo *exception) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 31 | { |
cristy | 2ed42f6 | 2011-10-02 19:49:57 +0000 | [diff] [blame] | 32 | if (draw_info->fill_pattern == (Image *) NULL) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 33 | { |
cristy | 2ed42f6 | 2011-10-02 19:49:57 +0000 | [diff] [blame] | 34 | *fill=draw_info->fill; |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 35 | return(MagickTrue); |
| 36 | } |
cristy | 2ed42f6 | 2011-10-02 19:49:57 +0000 | [diff] [blame] | 37 | { |
| 38 | Image |
| 39 | *pattern; |
| 40 | |
| 41 | MagickBooleanType |
| 42 | status; |
| 43 | |
cristy | 2ed42f6 | 2011-10-02 19:49:57 +0000 | [diff] [blame] | 44 | pattern=draw_info->fill_pattern; |
cristy | 3aa9375 | 2011-12-18 15:54:24 +0000 | [diff] [blame] | 45 | status=GetOneVirtualPixelInfo(pattern,TileVirtualPixelMethod,x+ |
cristy | 5201002 | 2011-10-21 18:07:37 +0000 | [diff] [blame] | 46 | pattern->tile_offset.x,y+pattern->tile_offset.y,fill,exception); |
cristy | 2ed42f6 | 2011-10-02 19:49:57 +0000 | [diff] [blame] | 47 | return(status); |
| 48 | } |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 49 | } |
| 50 | |
| 51 | static inline MagickBooleanType GetStrokeColor(const DrawInfo *draw_info, |
cristy | 101ab70 | 2011-10-13 13:06:32 +0000 | [diff] [blame] | 52 | const ssize_t x,const ssize_t y,PixelInfo *stroke,ExceptionInfo *exception) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 53 | { |
cristy | 2ed42f6 | 2011-10-02 19:49:57 +0000 | [diff] [blame] | 54 | if (draw_info->stroke_pattern == (Image *) NULL) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 55 | { |
cristy | 2ed42f6 | 2011-10-02 19:49:57 +0000 | [diff] [blame] | 56 | *stroke=draw_info->stroke; |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 57 | return(MagickTrue); |
| 58 | } |
cristy | 2ed42f6 | 2011-10-02 19:49:57 +0000 | [diff] [blame] | 59 | { |
| 60 | Image |
| 61 | *pattern; |
| 62 | |
| 63 | MagickBooleanType |
| 64 | status; |
| 65 | |
cristy | 2ed42f6 | 2011-10-02 19:49:57 +0000 | [diff] [blame] | 66 | pattern=draw_info->stroke_pattern; |
cristy | 3aa9375 | 2011-12-18 15:54:24 +0000 | [diff] [blame] | 67 | status=GetOneVirtualPixelInfo(pattern,TileVirtualPixelMethod,x+ |
cristy | 5201002 | 2011-10-21 18:07:37 +0000 | [diff] [blame] | 68 | pattern->tile_offset.x,y+pattern->tile_offset.y,stroke,exception); |
cristy | 2ed42f6 | 2011-10-02 19:49:57 +0000 | [diff] [blame] | 69 | return(status); |
| 70 | } |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 71 | } |
| 72 | |
| 73 | #if defined(__cplusplus) || defined(c_plusplus) |
| 74 | } |
| 75 | #endif |
| 76 | |
| 77 | #endif |