Skip to content

Commit

Permalink
added stroke settings functions
Browse files Browse the repository at this point in the history
  • Loading branch information
ricree committed Aug 16, 2011
1 parent e075124 commit 232f0ed
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Graphics/Transform/Magick/Images.hsc
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ module Graphics.Transform.Magick.Images(initializeMagick, readImage, writeImage,
drawSetFontWeight,
drawSetGravity,
drawSetStrokeColor,
drawSetStrokeMiterLimit,
drawSetStrokeOpacity,
drawSetStrokeWidth,
drawSetFillColor,
drawSetFillRule,
drawSetFillColorString,
Expand Down Expand Up @@ -182,6 +185,15 @@ setDrawColor colorFun r g b o ctx = do
drawSetStrokeColor :: Int -> Int-> Int -> Int -> Ptr DrawContext -> IO (Ptr DrawContext)
drawSetStrokeColor = setDrawColor draw_set_stroke_color

drawSetStrokeMiterLimit :: Int -> Ptr DrawContext -> IO (Ptr DrawContext)
drawSetStrokeMiterLimit = doDrawOp draw_set_stroke_miter_limit

drawSetStrokeOpacity :: Double -> Ptr DrawContext -> IO (Ptr DrawContext)
drawSetStrokeOpacity = doDrawOp draw_set_stroke_opacity

drawSetStrokeWidth :: Double -> Ptr DrawContext -> IO (Ptr DrawContext)
drawSetStrokeWidth = doDrawOp draw_set_stroke_width

drawSetFillColor :: Int -> Int-> Int -> Int -> Ptr DrawContext -> IO (Ptr DrawContext)
drawSetFillColor= setDrawColor draw_set_fill_color

Expand Down
11 changes: 11 additions & 0 deletions Graphics/Transform/Magick/Magick.hs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ module Graphics.Transform.Magick.Magick(module Foreign.C.Types,
draw_set_font_weight,
draw_set_gravity,
draw_set_stroke_color,
draw_set_stroke_miter_limit,
draw_set_stroke_opacity,
draw_set_stroke_width,
draw_set_fill_color,
draw_set_fill_rule,
draw_get_clip_path,
Expand Down Expand Up @@ -347,6 +350,14 @@ foreign import ccall "static magick/api.h DrawComposite"
foreign import ccall "static magick/api.h DrawEllipse"
draw_ellipse :: Ptr DrawContext -> CDouble -> CDouble -> CDouble -> CDouble -> CDouble -> CDouble -> IO ()

foreign import ccall "static magick/api.h DrawSetStrokeMiterLimit"
draw_set_stroke_miter_limit :: Ptr DrawContext -> CULong -> IO ()

foreign import ccall "static magick/api.h DrawSetStrokeOpacity"
draw_set_stroke_opacity :: Ptr DrawContext -> CDouble -> IO ()

foreign import ccall "static magick/api.h DrawSetStrokeWidth"
draw_set_stroke_width :: Ptr DrawContext -> CDouble -> IO ()
---------- Enhancements

-- Note that these side-effect the image! Higher-level API
Expand Down

0 comments on commit 232f0ed

Please sign in to comment.