MagickCore: draw-private.h Source File

# draw-private.h

Go to the documentation of this file.

    00001 /*
    00002   Copyright 1999-2010 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 "magick/cache.h"
    00026 #include "magick/image.h"
    00027 #include "magick/memory_.h"
    00028
    00029 static inline PixelPacket GetFillColor(const DrawInfo *draw_info,
    00030   const long x,const long y)
    00031 {
    00032   Image
    00033     *pattern;
    00034
    00035   PixelPacket
    00036     fill_color;
    00037
    00038   pattern=draw_info->fill_pattern;
    00039   if (pattern == (Image *) NULL)
    00040     return(draw_info->fill);
    00041   fill_color=AcquireOneVirtualPixel(pattern,TileVirtualPixelMethod,
    00042     x+pattern->tile_offset.x,y+pattern->tile_offset.y,&pattern->exception);
    00043   return(fill_color);
    00044 }
    00045
    00046 static inline PixelPacket GetStrokeColor(const DrawInfo *draw_info,
    00047   const long x,const long y)
    00048 {
    00049   Image
    00050     *pattern;
    00051
    00052   PixelPacket
    00053     stroke_color;
    00054
    00055   pattern=draw_info->stroke_pattern;
    00056   if (pattern == (Image *) NULL)
    00057     return(draw_info->stroke);
    00058   stroke_color=AcquireOneVirtualPixel(pattern,TileVirtualPixelMethod,
    00059     x+pattern->tile_offset.x,y+pattern->tile_offset.y,&pattern->exception);
    00060   return(stroke_color);
    00061 }
    00062
    00063 #if defined(__cplusplus) || defined(c_plusplus)
    00064 }
    00065 #endif
    00066
    00067 #endif