draw-private.h

Go to the documentation of this file.
00001 /*
00002   Copyright 1999-2020 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.  You may
00006   obtain a copy of the License at
00007   
00008     https://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 #include "MagickCore/cache.h"
00022 #include "MagickCore/image.h"
00023 #include "MagickCore/memory_.h"
00024 
00025 #if defined(__cplusplus) || defined(c_plusplus)
00026 extern "C" {
00027 #endif
00028 
00029 static inline void GetFillColor(const DrawInfo *draw_info,const ssize_t x,
00030   const ssize_t y,PixelInfo *fill,ExceptionInfo *exception)
00031 {
00032   if (draw_info->fill_pattern == (Image *) NULL)
00033     {
00034       *fill=draw_info->fill;
00035       return;
00036     }
00037   {
00038     Image
00039       *pattern;
00040 
00041     pattern=draw_info->fill_pattern;
00042     (void) GetOneVirtualPixelInfo(pattern,TileVirtualPixelMethod,x+
00043       pattern->tile_offset.x,y+pattern->tile_offset.y,fill,exception);
00044     if (fabs(draw_info->fill_alpha-TransparentAlpha) >= MagickEpsilon)
00045       fill->alpha*=QuantumScale*draw_info->fill_alpha;
00046   }
00047 }
00048 
00049 static inline void GetStrokeColor(const DrawInfo *draw_info,const ssize_t x,
00050   const ssize_t y,PixelInfo *stroke,ExceptionInfo *exception)
00051 {
00052   if (draw_info->stroke_pattern == (Image *) NULL)
00053     {
00054       *stroke=draw_info->stroke;
00055       return;
00056     }
00057   {
00058     Image
00059       *pattern;
00060 
00061     pattern=draw_info->stroke_pattern;
00062     (void) GetOneVirtualPixelInfo(pattern,TileVirtualPixelMethod,x+
00063       pattern->tile_offset.x,y+pattern->tile_offset.y,stroke,exception);
00064     if (fabs(draw_info->stroke_alpha-TransparentAlpha) >= MagickEpsilon)
00065       stroke->alpha*=QuantumScale*draw_info->stroke_alpha;
00066   }
00067 }
00068 
00069 #if defined(__cplusplus) || defined(c_plusplus)
00070 }
00071 #endif
00072 
00073 #endif

Generated on 17 Feb 2020 for MagickCore by  doxygen 1.6.1