]> granicus.if.org Git - imagemagick/blob - MagickCore/draw-private.h
(no commit message)
[imagemagick] / MagickCore / draw-private.h
1 /*
2   Copyright 1999-2014 ImageMagick Studio LLC, a non-profit organization
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 #include "MagickCore/cache.h"
22 #include "MagickCore/image.h"
23 #include "MagickCore/memory_.h"
24
25 #if defined(__cplusplus) || defined(c_plusplus)
26 extern "C" {
27 #endif
28
29 static inline MagickBooleanType GetFillColor(const DrawInfo *draw_info,
30   const ssize_t x,const ssize_t y,PixelInfo *fill,ExceptionInfo *exception)
31 {
32   if (draw_info->fill_pattern == (Image *) NULL)
33     {
34       *fill=draw_info->fill;
35       return(MagickTrue);
36     }
37   {
38     Image
39       *pattern;
40
41     MagickBooleanType
42       status;
43
44     pattern=draw_info->fill_pattern;
45     status=GetOneVirtualPixelInfo(pattern,TileVirtualPixelMethod,x+
46       pattern->tile_offset.x,y+pattern->tile_offset.y,fill,exception);
47     return(status);
48   }
49 }
50
51 static inline MagickBooleanType GetStrokeColor(const DrawInfo *draw_info,
52   const ssize_t x,const ssize_t y,PixelInfo *stroke,ExceptionInfo *exception)
53 {
54   if (draw_info->stroke_pattern == (Image *) NULL)
55     {
56       *stroke=draw_info->stroke;
57       return(MagickTrue);
58     }
59   {
60     Image
61       *pattern;
62
63     MagickBooleanType
64       status;
65
66     pattern=draw_info->stroke_pattern;
67     status=GetOneVirtualPixelInfo(pattern,TileVirtualPixelMethod,x+
68       pattern->tile_offset.x,y+pattern->tile_offset.y,stroke,exception);
69     return(status);
70   }
71 }
72
73 #if defined(__cplusplus) || defined(c_plusplus)
74 }
75 #endif
76
77 #endif