| Copyright | (c) 2006-2016 alpheccar.org |
|---|---|
| License | BSD-style |
| Maintainer | misc@NOSPAMalpheccar.org |
| Stability | experimental |
| Portability | portable |
| Safe Haskell | None |
| Language | Haskell2010 |
Graphics.PDF.Shapes
Contents
Description
PDF Shapes
Synopsis
- moveto :: Point -> Draw ()
- lineto :: Point -> Draw ()
- arcto :: Angle -> Point -> Draw ()
- curveto :: Point -> Point -> Point -> Draw ()
- beginPath :: Point -> Draw ()
- closePath :: Draw ()
- addBezierCubic :: Point -> Point -> Point -> Draw ()
- addPolygonToPath :: [Point] -> Draw ()
- addLineToPath :: Point -> Draw ()
- strokePath :: Draw ()
- fillPath :: Draw ()
- fillAndStrokePath :: Draw ()
- fillPathEO :: Draw ()
- fillAndStrokePathEO :: Draw ()
- setAsClipPath :: Draw ()
- setAsClipPathEO :: Draw ()
- class Shape a where
- data Line = Line PDFFloat PDFFloat PDFFloat PDFFloat
- data Rectangle = Rectangle !Point !Point
- newtype Polygon = Polygon [Point]
- data Arc = Arc PDFFloat PDFFloat PDFFloat PDFFloat
- data Ellipse = Ellipse PDFFloat PDFFloat PDFFloat PDFFloat
- data Circle = Circle PDFFloat PDFFloat PDFFloat
- data RoundRectangle = RoundRectangle PDFFloat PDFFloat PDFFloat PDFFloat PDFFloat PDFFloat
- data CapStyle
- data JoinStyle
- data DashPattern = DashPattern ![PDFFloat] PDFFloat
- setWidth :: MonadPath m => PDFFloat -> m ()
- setLineCap :: MonadPath m => CapStyle -> m ()
- setLineJoin :: MonadPath m => JoinStyle -> m ()
- setDash :: MonadPath m => DashPattern -> m ()
- setNoDash :: MonadPath m => m ()
- setMiterLimit :: MonadPath m => PDFFloat -> m ()
Shapes
Paths
Approximate a circular arc by one cubic bezier curve. larger arc angles mean larger distortions
addBezierCubic :: Point -> Point -> Point -> Draw () #
Append a cubic Bezier curve to the current path. The curve extends from the current point to the point (x3 , y3), using (x1 , y1 ) and (x2, y2) as the Bezier control points
addPolygonToPath :: [Point] -> Draw () #
Add a polygon to current path
addLineToPath :: Point -> Draw () #
strokePath :: Draw () #
Draw current path
fillAndStrokePath :: Draw () #
Fill current path
fillPathEO :: Draw () #
Fill current path using even odd rule
fillAndStrokePathEO :: Draw () #
Fill current path using even odd rule
setAsClipPath :: Draw () #
Set clipping path
setAsClipPathEO :: Draw () #
Set clipping path
Usual shapes
Minimal complete definition
Instances
| Shape Polygon # | |
| Shape Circle # | |
| Shape RoundRectangle # | |
Defined in Graphics.PDF.Shapes Methods addShape :: RoundRectangle -> Draw () # stroke :: RoundRectangle -> Draw () # fill :: RoundRectangle -> Draw () # fillAndStroke :: RoundRectangle -> Draw () # fillEO :: RoundRectangle -> Draw () # fillAndStrokeEO :: RoundRectangle -> Draw () # | |
| Shape Ellipse # | |
| Shape Arc # | |
| Shape Rectangle # | |
| Shape Line # | |
data RoundRectangle #
Instances
| Eq RoundRectangle # | |
Defined in Graphics.PDF.Shapes Methods (==) :: RoundRectangle -> RoundRectangle -> Bool # (/=) :: RoundRectangle -> RoundRectangle -> Bool # | |
| Shape RoundRectangle # | |
Defined in Graphics.PDF.Shapes Methods addShape :: RoundRectangle -> Draw () # stroke :: RoundRectangle -> Draw () # fill :: RoundRectangle -> Draw () # fillAndStroke :: RoundRectangle -> Draw () # fillEO :: RoundRectangle -> Draw () # fillAndStrokeEO :: RoundRectangle -> Draw () # | |
Style
Line cap styles
Instances
| Enum CapStyle # | |
Defined in Graphics.PDF.Shapes | |
| Eq CapStyle # | |
Line join styles
Instances
| Enum JoinStyle # | |
Defined in Graphics.PDF.Shapes Methods succ :: JoinStyle -> JoinStyle # pred :: JoinStyle -> JoinStyle # fromEnum :: JoinStyle -> Int # enumFrom :: JoinStyle -> [JoinStyle] # enumFromThen :: JoinStyle -> JoinStyle -> [JoinStyle] # enumFromTo :: JoinStyle -> JoinStyle -> [JoinStyle] # enumFromThenTo :: JoinStyle -> JoinStyle -> JoinStyle -> [JoinStyle] # | |
| Eq JoinStyle # | |
data DashPattern #
Constructors
| DashPattern ![PDFFloat] PDFFloat |
Instances
| Eq DashPattern # | |
Defined in Graphics.PDF.Shapes | |
setLineCap :: MonadPath m => CapStyle -> m () #
Set line cap
setLineJoin :: MonadPath m => JoinStyle -> m () #
Set line join
setDash :: MonadPath m => DashPattern -> m () #
Set the dash pattern
setMiterLimit :: MonadPath m => PDFFloat -> m () #
Set pen width