Portability | GHC only |
---|---|
Stability | experimental |
Maintainer | stephen.tetley@gmail.com |
- blankPicture :: Num u => BoundingBox u -> Picture u
- frame :: (Fractional u, Ord u) => Primitive u -> Picture u
- frameWithin :: (Fractional u, Ord u) => Primitive u -> BoundingBox u -> Picture u
- frameMulti :: (Fractional u, Ord u) => [Primitive u] -> Picture u
- multi :: (Fractional u, Ord u) => [Picture u] -> Picture u
- path :: Point2 u -> [PathSegment u] -> Path u
- lineTo :: Point2 u -> PathSegment u
- curveTo :: Point2 u -> Point2 u -> Point2 u -> PathSegment u
- vertexPath :: [Point2 u] -> Path u
- curvedPath :: [Point2 u] -> Path u
- class Stroke t where
- zostroke :: (Num u, Ord u) => Path u -> Primitive u
- zcstroke :: (Num u, Ord u) => Path u -> Primitive u
- class Fill t where
- zfill :: (Num u, Ord u) => Path u -> Primitive u
- clip :: (Num u, Ord u) => Path u -> Picture u -> Picture u
- class TextLabel t where
- ztextlabel :: Point2 u -> String -> Primitive u
- multilabel :: (Fractional u, Ord u) => [Label u] -> LabelProps -> BoundingBox u -> Picture u
- class Ellipse t where
- ellipse :: Fractional u => t -> Point2 u -> u -> u -> Primitive u
- zellipse :: Num u => Point2 u -> u -> u -> Primitive u
- extendBoundary :: (Num u, Ord u) => u -> u -> Picture u -> Picture u
Construction
blankPicture :: Num u => BoundingBox u -> Picture uSource
This module (Wumpus.Core.Picture) should be the only interface to the outside world for creating
Create a blank picture sized to the supplied bounding box. This is useful for spacing rows or columns of pictures.
frame :: (Fractional u, Ord u) => Primitive u -> Picture uSource
Lift a Primitive to a Picture, located in the standard frame.
frameWithin :: (Fractional u, Ord u) => Primitive u -> BoundingBox u -> Picture uSource
Frame a picture within the supplied bounding box
A text label uses the supplied bounding box as is - no clipping is performed if the bounding box is smaller than the boundary size of the text. This may cause strange overlap for subsequent composite pictures, and incorrect bounding box annotations in the prologue of the generated EPS file.
Paths and ellipses are bound within the union of the supplied bounding box and the inherent bounding box or the path or ellipse. Thus the bounding box will never reframed to a smaller size than the natural bounding box.
frameMulti :: (Fractional u, Ord u) => [Primitive u] -> Picture uSource
Lift a list of Primitives to a composite Picture, all Primitives will be located within the standard frame. The list of Primitives must be non-empty.
multi :: (Fractional u, Ord u) => [Picture u] -> Picture uSource
Place multiple pictures within the same affine frame This function throws an error when supplied the empty list.
path :: Point2 u -> [PathSegment u] -> Path uSource
Create a Path from the start point and alist of PathSegments.
lineTo :: Point2 u -> PathSegment uSource
Create a straight-line PathSegment.
vertexPath :: [Point2 u] -> Path uSource
Convert the list of vertices to a path of straight line segments.
curvedPath :: [Point2 u] -> Path uSource
Convert a list of vertices to a path of curve segments. The first point in the list makes the start point, each curve segment thereafter takes 3 points. Spare points at the end are discarded.
Constructing primitives
ostroke :: (Num u, Ord u) => t -> Path u -> Primitive uSource
cstroke :: (Num u, Ord u) => t -> Path u -> Primitive uSource
Stroke () | |
Stroke StrokeAttr | |
Stroke [StrokeAttr] | |
Stroke (Gray Double) | |
Stroke (HSB3 Double) | |
Stroke (RGB3 Double) | |
Stroke (Gray Double, [StrokeAttr]) | |
Stroke (Gray Double, StrokeAttr) | |
Stroke (HSB3 Double, [StrokeAttr]) | |
Stroke (HSB3 Double, StrokeAttr) | |
Stroke (RGB3 Double, [StrokeAttr]) | |
Stroke (RGB3 Double, StrokeAttr) |
ztextlabel :: Point2 u -> String -> Primitive uSource
Create a label where the font is Courier
, text size is 10
and colour is black.
multilabel :: (Fractional u, Ord u) => [Label u] -> LabelProps -> BoundingBox u -> Picture uSource
Instances will create a filled ellipse unless the supplied element implies a stoked ellipse, e.g.:
ellipse (LineWidth 4) zeroPt 40 40 ellipse EFill zeroPt 40 40
ellipse :: Fractional u => t -> Point2 u -> u -> u -> Primitive uSource
Ellipse () | |
Ellipse StrokeAttr | |
Ellipse DrawEllipse | |
Ellipse [StrokeAttr] | |
Ellipse (Gray Double) | |
Ellipse (HSB3 Double) | |
Ellipse (RGB3 Double) | |
Ellipse (Gray Double, [StrokeAttr]) | |
Ellipse (Gray Double, StrokeAttr) | |
Ellipse (Gray Double, DrawEllipse) | |
Ellipse (HSB3 Double, [StrokeAttr]) | |
Ellipse (HSB3 Double, StrokeAttr) | |
Ellipse (HSB3 Double, DrawEllipse) | |
Ellipse (RGB3 Double, [StrokeAttr]) | |
Ellipse (RGB3 Double, StrokeAttr) | |
Ellipse (RGB3 Double, DrawEllipse) |