draw-private.h

Go to the documentation of this file.
00001 /*
00002   Copyright 1999-2009 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 MagickBooleanType GetFillColor(const DrawInfo *draw_info,
00030   const long x,const long y,PixelPacket *pixel)
00031 {
00032   Image
00033     *pattern;
00034 
00035   MagickBooleanType
00036     status;
00037 
00038   pattern=draw_info->fill_pattern;
00039   if (pattern == (Image *) NULL)
00040     {
00041       *pixel=draw_info->fill;
00042       return(MagickTrue);
00043     }
00044 #if defined(MAGICKCORE_OPENMP_SUPPORT) && (_OPENMP >= 200203)
00045   #pragma omp critical
00046 #endif
00047   status=GetOneVirtualMethodPixel(pattern,TileVirtualPixelMethod,
00048     x+pattern->tile_offset.x,y+pattern->tile_offset.y,pixel,
00049     &pattern->exception);
00050   if (pattern->matte == MagickFalse)
00051     pixel->opacity=OpaqueOpacity;
00052   return(status);
00053 }
00054 
00055 static inline MagickBooleanType GetStrokeColor(const DrawInfo *draw_info,
00056   const long x,const long y,PixelPacket *pixel)
00057 {
00058   Image
00059     *pattern;
00060 
00061   MagickBooleanType
00062     status;
00063 
00064   pattern=draw_info->stroke_pattern;
00065   if (pattern == (Image *) NULL)
00066     {
00067       *pixel=draw_info->stroke;
00068       return(MagickTrue);
00069     }
00070 #if defined(MAGICKCORE_OPENMP_SUPPORT) && (_OPENMP >= 200203)
00071   #pragma omp critical
00072 #endif
00073   status=GetOneVirtualMethodPixel(pattern,TileVirtualPixelMethod,
00074     x+pattern->tile_offset.x,y+pattern->tile_offset.y,pixel,
00075     &pattern->exception);
00076   if (pattern->matte == MagickFalse)
00077     pixel->opacity=OpaqueOpacity;
00078   return(status);
00079 }
00080 
00081 #if defined(__cplusplus) || defined(c_plusplus)
00082 }
00083 #endif
00084 
00085 #endif

Generated on 19 Nov 2009 for MagickCore by  doxygen 1.6.1