Portability | GHC |
---|---|

Stability | highly unstable |

Maintainer | stephen.tetley@gmail.com |

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`

.

- type Graphic u = Image u (UNil u)
- type DGraphic = Graphic Double
- type LocGraphic u = LocImage u (UNil u)
- type DLocGraphic = LocGraphic Double
- type LocThetaGraphic u = LocThetaImage u (UNil u)
- type DLocThetaGraphic = LocThetaGraphic Double
- safeconcat :: OPlus a => Image u a -> [Image u a] -> Image u a
- ignoreAns :: Functor f => f (a, b) -> f (UNil u, b)
- replaceAns :: Functor f => z -> f (a, b) -> f (z, b)
- mapAns :: Functor f => (a -> z) -> f (a, b) -> f (z, b)
- intoImage :: CF a -> Graphic u -> Image u a
- intoLocImage :: LocCF u a -> LocGraphic u -> LocImage u a
- intoLocThetaImage :: LocThetaCF u a -> LocThetaGraphic u -> LocThetaImage u a
- emptyLocGraphic :: Num u => LocGraphic u
- emptyLocThetaGraphic :: Num u => LocThetaGraphic u
- decorate :: Monad m => m (ImageAns u a) -> m (ImageAns u zz) -> m (ImageAns u a)
- sdecorate :: Monad m => m (ImageAns u a) -> (a -> m (ImageAns u zz)) -> m (ImageAns u a)
- adecorate :: Monad m => m (ImageAns u a) -> (a -> m (ImageAns u zz)) -> m (ImageAns u a)
- hyperlink :: Functor m => XLink -> m (ImageAns u a) -> m (ImageAns u a)

# 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.

# 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

safeconcat :: OPlus a => Image u a -> [Image u a] -> Image u aSource

`safeconcat`

: ` alternative * [image] -> Image`

`safeconcat`

produces a composite `Image`

from a list of
`Image`

's. If the list is empty the alternative `Image`

is
used.

This contrasts to `oconcat`

- when used for `Image`

's,
`oconcat`

has the same type signature as `safeconcat`

but
`oconcat`

considers its arguments to be an already destructured
list:

oconcat (head::Image) (rest::[Image])

ignoreAns :: Functor f => f (a, b) -> f (UNil u, b)Source

Ignore the answer produced by an `Image`

, a `LocImage`

etc.

Use this function to turn an `Image`

into a `Graphic`

, a
'LocImage into a `LocGraphic`

.

replaceAns :: Functor f => z -> f (a, b) -> f (z, b)Source

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

`intoLocImage`

: ` loc_context_function * loc_graphic -> LocImage `

*Loc* version of `intoImage`

.

The `LocImage`

is built as a function from an implicit start
point to the answer.

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

`intoLocThetaImage`

: ` loc_theta_cf * loc_theta_graphic -> LocThetaImage `

*LocTheta* version of `intoImage`

.

The `LocThetaImage`

is built as a function from an implicit
start point and angle of inclination to the answer.

emptyLocGraphic :: Num u => LocGraphic uSource

`emptyLocGraphic`

: ` LocGraphic `

Build an empty `LocGraphic`

(i.e. a function
*from Point to Graphic*). This is a path with a start point
but no path segments.

The `emptyLocGraphic`

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.

emptyLocThetaGraphic :: Num u => LocThetaGraphic uSource

`emptyLocThetaGraphic`

: ` LocThetaGraphic `

Build an empty `LocThetaGraphic`

(i.e. a function
*from Point and Inclination to Graphic*).

The `emptyLocThetaGraphic`

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.

decorate :: Monad m => m (ImageAns u a) -> m (ImageAns u zz) -> m (ImageAns u a)Source

Decorate an Image by superimposing a Graphic.

Note - this function has a very general type signature and supports various graphic types:

decorate :: Image u a -> Graphic u -> Image u a decorate :: LocImage u a -> LocGraphic u -> LocImage u a decorate :: LocThetaImage u a -> LocThetaGraphic u -> LocTheteImage u a

sdecorate :: Monad m => m (ImageAns u a) -> (a -> m (ImageAns u zz)) -> m (ImageAns u a)Source

*Superior decorate* - decorate an image by superimposing a
graphic on top of it.

Note, here the Graphic has access to the result produced by the
the Image unlike `decorate`

.

Again, this function has a very general type signature and supports various graphic types:

sdecorate :: Image u a -> Graphic u -> Image u a sdecorate :: LocImage u a -> LocGraphic u -> LocImage u a sdecorate :: LocThetaImage u a -> LocThetaGraphic u -> LocTheteImage u a

adecorate :: Monad m => m (ImageAns u a) -> (a -> m (ImageAns u zz)) -> m (ImageAns u a)Source

*Anterior decorate* - decorate an Image by superimposing it
on a Graphic.

Note - here the Graphic has access to the result produced by the
the Image unlike `decorate`

.

Again, this function has a very general type signature and supports various graphic types:

adecorate :: Image u a -> Graphic u -> Image u a adecorate :: LocImage u a -> LocGraphic u -> LocImage u a adecorate :: LocThetaImage u a -> LocThetaGraphic u -> LocTheteImage u a

hyperlink :: Functor m => XLink -> m (ImageAns u a) -> m (ImageAns u a)Source

Hyperlink a graphic object.

This function has a very general type signature and supports various graphic types:

hyperlink :: XLink -> Graphic u -> Graphic u hyperlink :: XLink -> Image u a -> Image u a hyperlink :: XLink -> LocImage u a -> LocImage u a hyperlink :: XLink -> LocThetaImage u a -> LocThetaImage u a