wumpus-basic-0.15.0: Basic objects and system code built on Wumpus-Core.

PortabilityGHC
Stabilityhighly unstable
Maintainerstephen.tetley@gmail.com

Wumpus.Basic.Kernel.Objects.Graphic

Contents

Description

Graphic type - this is largely equivalent to Primitive in Wumpus-Core, but drawing attributes are implicitly supplied by the DrawingContext.

API in Wumpus.Core, but here they exploit the implicit DrawingContext.

Synopsis

Documentation

type Graphic u = Image u (UNil u)Source

Simple drawing - produce a primitive, access the DrawingContext as required, e.g for fill colour, stroke colur, line width, etc.

type DGraphic = Graphic DoubleSource

Alias of Graphic where the unit type is specialized to Double.

LocGraphic

type LocGraphic u = LocImage u (UNil u)Source

Originated drawing - produce a primitive respective to the supplied start-point, access the DrawingContext as required.

type DLocGraphic = LocGraphic DoubleSource

Alias of LocGraphic where the unit type is specialized to Double.

type LocThetaGraphic u = LocThetaImage u (UNil u)Source

Originated drawing - produce a primitive respective to the supplied start-point, access the DrawingContext as required.

type DLocThetaGraphic = LocThetaGraphic DoubleSource

Alias of LocThetaGraphic where the unit type is specialized to Double.

Functions

intoImage :: CF a -> Graphic u -> Image u aSource

Build an Image...

intoLocImage :: LocCF u a -> LocGraphic u -> LocImage u aSource

Build a LocImage...

intoLocThetaImage :: LocThetaCF u a -> LocThetaGraphic u -> LocThetaImage u aSource

Build a LocThetaImage...

moveStartPoint :: PointDisplace u -> LocCF u a -> LocCF u aSource

Move the start-point of a LocImage with the supplied displacement function.

moveStartPointTheta :: PointDisplace u -> LocThetaCF u a -> LocThetaCF u aSource

Move the start-point of a LocImage with the supplied displacement function.

locPath :: Num u => [Vec2 u] -> LocCF u (PrimPath u)Source

This is the analogue to vectorPath in Wumpus-core.

emptyLocPath :: Num u => LocCF u (PrimPath u)Source

This is the analogue to emptyPath in Wumpus-core.

emptyLocGraphic :: Num u => LocGraphic uSource

Build an empty LocGraphic - this is a path with a start point but no path segments.

The emptyLocGraphic It is treated as a null primitive by Wumpus-Core and is not drawn, although it does generate a minimum bounding box at the implicit start point.

openStroke :: Num u => PrimPath u -> Graphic uSource

openStroke : path -> Graphic

This is the analogue to ostroke in Wumpus-core, but the drawing properties (colour, line width, etc.) are taken from the implicit DrawingContext.

closedStroke :: Num u => PrimPath u -> Graphic uSource

closedStroke : path -> Graphic

This is the analogue to cstroke in Wumpus-core, but the drawing properties (colour, line width, etc.) are taken from the implicit DrawingContext.

filledPath :: Num u => PrimPath u -> Graphic uSource

filledPath : path -> Graphic

This is the analogue to fill in Wumpus-core, but the fill colour is taken from the implicit DrawingContext.

borderedPath :: Num u => PrimPath u -> Graphic uSource

borderedPath : path -> Graphic

This is the analogue to fillStroke in Wumpus-core, but the drawing properties (fill colour, border colour, line width, etc.) are taken from the implicit DrawingContext.

textline :: Num u => String -> LocGraphic uSource

This is the analogue to textlabel in Wumpus-core.

rtextline :: Num u => String -> LocThetaGraphic uSource

This is the analogue to rtextlabel in Wumpus-core.

escapedline :: Num u => EscapedText -> LocGraphic uSource

This is the analogue to escapedlabel in Wumpus-core.

rescapedline :: Num u => EscapedText -> LocThetaGraphic uSource

This is the analogue to rescapedlabel in Wumpus-core.

hkernline :: Num u => [KerningChar u] -> LocGraphic uSource

This is the analogue to hkernlabel in Wumpus-core.

vkernline :: Num u => [KerningChar u] -> LocGraphic uSource

This is the analogue to vkernlabel in Wumpus-core.

strokedEllipse :: Num u => u -> u -> LocGraphic uSource

This is the analogue to strokeEllipse in Wumpus-core.

rstrokedEllipse :: Num u => u -> u -> LocThetaGraphic uSource

This is the analogue to rstrokeEllispe in Wumpus-core.

filledEllipse :: Num u => u -> u -> LocGraphic uSource

This is the analogue to fillEllispe in Wumpus-core.

rfilledEllipse :: Num u => u -> u -> LocThetaGraphic uSource

This is the analogue to rfillEllispe in Wumpus-core.

borderedEllipse :: Num u => u -> u -> LocGraphic uSource

This is the analogue to fillStrokeEllispe in Wumpus-core.

rborderedEllipse :: Num u => u -> u -> LocThetaGraphic uSource

This is the analogue to rfillStrokeEllispe in Wumpus-core.

straightLine :: Fractional u => Vec2 u -> LocGraphic uSource

Draw a straight line formed from displacing the implicit start point with the supplied vector.

straightLineBetween :: Fractional u => Point2 u -> Point2 u -> Graphic uSource

Draw a straight line - start and end point are supplied explicitly.

curveBetween :: Fractional u => Point2 u -> Point2 u -> Point2 u -> Point2 u -> Graphic uSource

Draw a Bezier curve - all points are supplied explicitly.

strokedRectangle :: Fractional u => u -> u -> LocGraphic uSource

Supplied point is bottom left.

filledRectangle :: Fractional u => u -> u -> LocGraphic uSource

Supplied point is bottom left.

borderedRectangle :: Fractional u => u -> u -> LocGraphic uSource

Supplied point is bottom left.

strokedCircle :: Floating u => Int -> u -> LocGraphic uSource

Supplied point is center. Circle is drawn with Bezier curves.

filledCircle :: Floating u => Int -> u -> LocGraphic uSource

Supplied point is center. Circle is drawn with Bezier curves.

borderedCircle :: Floating u => Int -> u -> LocGraphic uSource

Supplied point is center. Circle is drawn with Bezier curves.

strokedDisk :: Num u => u -> LocGraphic uSource

disk is drawn with Wumpus-Core's ellipse primitive.

This is a efficient representation of circles using PostScript's arc or SVG's circle in the generated output. However, stroked-circles do not draw well after non-uniform scaling - the line width is scaled as well as the shape.

For stroked circles that can be adequately scaled, use strokedCircle instead.

filledDisk :: Num u => u -> LocGraphic uSource

Filled disk...

borderedDisk :: Num u => u -> LocGraphic uSource

bordered disk...