root / ImageMagick / trunk / magick / draw-private.h

Revision 11486, 1.8 kB (checked in by cristy, 2 months ago)
Line 
1/*
2  Copyright 1999-2008 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#if defined(__cplusplus) || defined(c_plusplus)
22extern "C" {
23#endif
24
25#include "magick/cache.h"
26#include "magick/image.h"
27#include "magick/memory_.h"
28
29static inline PixelPacket GetFillColor(const DrawInfo *draw_info,
30  const long x,const long y)
31{
32  Image
33    *pattern;
34
35  PixelPacket
36    fill_color;
37
38  pattern=draw_info->fill_pattern;
39  if (pattern == (Image *) NULL)
40    return(draw_info->fill);
41  #pragma omp critical
42  fill_color=AcquireOneVirtualPixel(pattern,TileVirtualPixelMethod,
43    x+pattern->tile_offset.x,y+pattern->tile_offset.y,&pattern->exception);
44  return(fill_color);
45}
46
47static inline PixelPacket GetStrokeColor(const DrawInfo *draw_info,
48  const long x,const long y)
49{
50  Image
51    *pattern;
52
53  PixelPacket
54    stroke_color;
55
56  pattern=draw_info->stroke_pattern;
57  if (pattern == (Image *) NULL)
58    return(draw_info->stroke);
59  #pragma omp critical
60  stroke_color=AcquireOneVirtualPixel(pattern,TileVirtualPixelMethod,
61    x+pattern->tile_offset.x,y+pattern->tile_offset.y,&pattern->exception);
62  return(stroke_color);
63}
64
65#if defined(__cplusplus) || defined(c_plusplus)
66}
67#endif
68
69#endif
Note: See TracBrowser for help on using the browser.