Portability | GHC |
---|---|
Stability | highly unstable |
Maintainer | stephen.tetley@gmail.com |
Extended Graphic object - a rectangular positionable Image.
This graphic object has a more flexible API for positioning
than other graphic objects. Rather than a LocGraphic which
supports a single method of positioning at some start-point,
a PosGraphic
can be drawn at its center or locations on its
outer rectangle.
- data GenPosObject st u a
- type GenPosGraphic st u = GenPosObject st u (UNil u)
- type PosObject u a = GenPosObject () u a
- type DPosObject a = PosObject Double a
- type PosGraphic u = PosObject u (UNil u)
- type DPosGraphic = PosGraphic Double
- runGenPosObject :: InterpretUnit u => RectAddress -> st -> GenPosObject st u a -> LocImage u (a, st)
- evalGenPosObject :: InterpretUnit u => RectAddress -> st -> GenPosObject st u a -> LocImage u a
- execGenPosObject :: InterpretUnit u => RectAddress -> st -> GenPosObject st u a -> LocImage u st
- runPosObject :: InterpretUnit u => RectAddress -> PosObject u a -> LocImage u a
- runPosObjectBBox :: InterpretUnit u => RectAddress -> PosObject u a -> LocImage u (BoundingBox u)
- makePosObject :: InterpretUnit u => Query u (Orientation u) -> LocImage u a -> GenPosObject st u a
- emptyPosObject :: (Monoid a, InterpretUnit u) => GenPosObject st u a
- elaboratePosObject :: (Fractional u, Ord u, InterpretUnit u) => ZDeco -> RectAddress -> LocGraphic u -> GenPosObject st u a -> GenPosObject st u a
- decoratePosObject :: InterpretUnit u => ZDeco -> (Orientation u -> LocGraphic u) -> GenPosObject st u a -> GenPosObject st u a
- extendPosObject :: InterpretUnit u => u -> u -> u -> u -> GenPosObject st u a -> GenPosObject st u a
- mapOrientation :: InterpretUnit u => (Orientation u -> Orientation u) -> GenPosObject st u a -> GenPosObject st u a
- illustratePosObject :: InterpretUnit u => PosObject u a -> LocGraphic u
- posChar :: InterpretUnit u => Char -> GenPosGraphic st u
- posEscChar :: InterpretUnit u => EscapedChar -> GenPosGraphic st u
- posCharUpright :: InterpretUnit u => Char -> GenPosGraphic st u
- posEscCharUpright :: InterpretUnit u => EscapedChar -> GenPosGraphic st u
- posCharPrim :: InterpretUnit u => Either Char EscapedChar -> GenPosGraphic st u
- posText :: InterpretUnit u => String -> GenPosGraphic st u
- posEscText :: InterpretUnit u => EscapedText -> GenPosGraphic st u
- posTextUpright :: InterpretUnit u => String -> GenPosGraphic st u
- posEscTextUpright :: InterpretUnit u => EscapedText -> GenPosGraphic st u
- posTextPrim :: InterpretUnit u => Either String EscapedText -> GenPosGraphic st u
- multilinePosText :: (Fractional u, InterpretUnit u) => VAlign -> String -> PosGraphic u
- multilinePosEscText :: (Fractional u, InterpretUnit u) => VAlign -> [EscapedText] -> GenPosGraphic st u
- rposText :: (Real u, Floating u, InterpretUnit u) => Radian -> String -> GenPosGraphic st u
- rposEscText :: (Real u, Floating u, InterpretUnit u) => Radian -> EscapedText -> GenPosGraphic st u
- rposChar :: (Real u, Floating u, InterpretUnit u) => Radian -> Char -> GenPosGraphic st u
- rposEscChar :: (Real u, Floating u, InterpretUnit u) => Radian -> EscapedChar -> GenPosGraphic st u
- posHKernText :: InterpretUnit u => [KernChar u] -> GenPosGraphic st u
- monospaceText :: InterpretUnit u => Query u u -> String -> GenPosGraphic st u
- monospaceEscText :: InterpretUnit u => Query u u -> EscapedText -> GenPosGraphic st u
Positionable image
data GenPosObject st u a Source
A positionable "Object".
Monad (GenPosObject st u) | |
Functor (GenPosObject st u) | |
Applicative (GenPosObject st u) | |
DrawingCtxM (GenPosObject st u) | |
UserStateM (GenPosObject st u) | |
(Monoid a, InterpretUnit u) => Monoid (GenPosObject st u a) | |
(Monoid a, InterpretUnit u) => AlignSpace (GenPosObject st u a) | |
Monoid a => Align (GenPosObject st u a) | |
(Monoid a, InterpretUnit u) => CatSpace (GenPosObject st u a) | |
Monoid a => Concat (GenPosObject st u a) | |
(Monoid a, InterpretUnit u) => ZConcat (GenPosObject st u a) |
type GenPosGraphic st u = GenPosObject st u (UNil u)Source
type PosObject u a = GenPosObject () u aSource
Type synonym for GenPosObject () u a
, a PosObject without
user state.
type DPosObject a = PosObject Double aSource
Version of PosObject specialized to Double for the unit type.
type PosGraphic u = PosObject u (UNil u)Source
Version of PosObject with answer specialized to UNil.
type DPosGraphic = PosGraphic DoubleSource
Version of PosGraphic specialized to Double for the unit type.
Operations
runGenPosObject :: InterpretUnit u => RectAddress -> st -> GenPosObject st u a -> LocImage u (a, st)Source
Running an PosObject produces a LocImage.
evalGenPosObject :: InterpretUnit u => RectAddress -> st -> GenPosObject st u a -> LocImage u aSource
execGenPosObject :: InterpretUnit u => RectAddress -> st -> GenPosObject st u a -> LocImage u stSource
runPosObject :: InterpretUnit u => RectAddress -> PosObject u a -> LocImage u aSource
runPosObjectBBox :: InterpretUnit u => RectAddress -> PosObject u a -> LocImage u (BoundingBox u)Source
Run a PosObject producing a LocImage (BoundingBox u).
makePosObject :: InterpretUnit u => Query u (Orientation u) -> LocImage u a -> GenPosObject st u aSource
makePosObject
: object_pos * loc_image -> PosObject
Create a PosObject
from an Orientation
describing how it
is orientated within a border rectangle and a LocImage
that
draws it.
This is the primary constructor for PosObjects. Because the PosObject type is considered as a specialized object it does not have the range of functions of LocImage or LocThetaImage.
emptyPosObject :: (Monoid a, InterpretUnit u) => GenPosObject st u aSource
emptyPosObject
: PosObject
Build an empty PosGraphicObject
.
elaboratePosObject :: (Fractional u, Ord u, InterpretUnit u) => ZDeco -> RectAddress -> LocGraphic u -> GenPosObject st u a -> GenPosObject st u aSource
decoratePosObject :: InterpretUnit u => ZDeco -> (Orientation u -> LocGraphic u) -> GenPosObject st u a -> GenPosObject st u aSource
extendPosObject :: InterpretUnit u => u -> u -> u -> u -> GenPosObject st u a -> GenPosObject st u aSource
Extend the orientation.
mapOrientation :: InterpretUnit u => (Orientation u -> Orientation u) -> GenPosObject st u a -> GenPosObject st u aSource
Note - this is a bad API, it would be better to have padders and fillers and not expose the orientation directly.
illustratePosObject :: InterpretUnit u => PosObject u a -> LocGraphic uSource
Illustrate a PosObject
by super-imposing its Orientation
.
This turns the PosObject
into a LocImage
drawn at the locus
of the PosObject.
Primitive text PosObjects
posChar :: InterpretUnit u => Char -> GenPosGraphic st uSource
Note - no margins are added to the containing rectangle.
To get a Char with margins, use posText
instead:
posText ['1']
posEscChar :: InterpretUnit u => EscapedChar -> GenPosGraphic st uSource
posCharUpright :: InterpretUnit u => Char -> GenPosGraphic st uSource
posEscCharUpright :: InterpretUnit u => EscapedChar -> GenPosGraphic st uSource
posCharPrim :: InterpretUnit u => Either Char EscapedChar -> GenPosGraphic st uSource
Primtive builder that does not add margins.
posText :: InterpretUnit u => String -> GenPosGraphic st uSource
posEscText :: InterpretUnit u => EscapedText -> GenPosGraphic st uSource
posTextUpright :: InterpretUnit u => String -> GenPosGraphic st uSource
posEscTextUpright :: InterpretUnit u => EscapedText -> GenPosGraphic st uSource
posTextPrim :: InterpretUnit u => Either String EscapedText -> GenPosGraphic st uSource
Primtive builder that does not add margins.
multilinePosText :: (Fractional u, InterpretUnit u) => VAlign -> String -> PosGraphic uSource
multilinePosEscText :: (Fractional u, InterpretUnit u) => VAlign -> [EscapedText] -> GenPosGraphic st uSource
rposText :: (Real u, Floating u, InterpretUnit u) => Radian -> String -> GenPosGraphic st uSource
Note - for single line text.
rposEscText :: (Real u, Floating u, InterpretUnit u) => Radian -> EscapedText -> GenPosGraphic st uSource
Note - for single line text.
rposChar :: (Real u, Floating u, InterpretUnit u) => Radian -> Char -> GenPosGraphic st uSource
rposEscChar :: (Real u, Floating u, InterpretUnit u) => Radian -> EscapedChar -> GenPosGraphic st uSource
posHKernText :: InterpretUnit u => [KernChar u] -> GenPosGraphic st uSource
monospaceText :: InterpretUnit u => Query u u -> String -> GenPosGraphic st uSource
The query should retrieve the width of one char.
monospaceEscText :: InterpretUnit u => Query u u -> EscapedText -> GenPosGraphic st uSource
The query should retrieve the width of one char.