MagickCore  6.9.9
Convert, Edit, Or Compose Bitmap Images
draw-private.h
Go to the documentation of this file.
1 /*
2  Copyright 1999-2018 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  https://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 "magick/cache.h"
22 #include "magick/image.h"
23 #include "magick/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,PixelPacket *pixel)
31 {
32  Image
33  *pattern;
34 
36  status;
37 
38  pattern=draw_info->fill_pattern;
39  if (pattern == (Image *) NULL)
40  {
41  *pixel=draw_info->fill;
42  return(MagickTrue);
43  }
45  x+pattern->tile_offset.x,y+pattern->tile_offset.y,pixel,
46  &pattern->exception);
47  if (pattern->matte == MagickFalse)
48  pixel->opacity=OpaqueOpacity;
49  return(status);
50 }
51 
52 static inline MagickBooleanType GetStrokeColor(const DrawInfo *draw_info,
53  const ssize_t x,const ssize_t y,PixelPacket *pixel)
54 {
55  Image
56  *pattern;
57 
59  status;
60 
61  pattern=draw_info->stroke_pattern;
62  if (pattern == (Image *) NULL)
63  {
64  *pixel=draw_info->stroke;
65  return(MagickTrue);
66  }
68  x+pattern->tile_offset.x,y+pattern->tile_offset.y,pixel,
69  &pattern->exception);
70  if (pattern->matte == MagickFalse)
71  pixel->opacity=OpaqueOpacity;
72  return(status);
73 }
74 
75 #if defined(__cplusplus) || defined(c_plusplus)
76 }
77 #endif
78 
79 #endif
Image * fill_pattern
Definition: draw.h:235
Definition: draw.h:209
Definition: pixel.h:131
RectangleInfo tile_offset
Definition: image.h:327
Definition: image.h:152
Image * stroke_pattern
Definition: draw.h:235
static MagickBooleanType GetFillColor(const DrawInfo *draw_info, const ssize_t x, const ssize_t y, PixelPacket *pixel)
Definition: draw-private.h:29
MagickBooleanType
Definition: magick-type.h:189
PixelPacket stroke
Definition: draw.h:225
Definition: magick-type.h:192
Quantum opacity
Definition: pixel.h:143
static MagickBooleanType GetStrokeColor(const DrawInfo *draw_info, const ssize_t x, const ssize_t y, PixelPacket *pixel)
Definition: draw-private.h:52
MagickExport MagickBooleanType GetOneVirtualMethodPixel(const Image *image, const VirtualPixelMethod virtual_pixel_method, const ssize_t x, const ssize_t y, PixelPacket *pixel, ExceptionInfo *exception)
Definition: cache.c:2182
ssize_t x
Definition: geometry.h:129
Definition: cache-view.h:36
MagickBooleanType matte
Definition: image.h:170
Definition: magick-type.h:191
#define OpaqueOpacity
Definition: image.h:27
PixelPacket fill
Definition: draw.h:225
ssize_t y
Definition: geometry.h:129
ExceptionInfo exception
Definition: image.h:287