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 PosObject u a
- type DPosObject a = PosObject Double a
- type PosGraphic u = PosObject u (UNil u)
- type DPosGraphic = PosGraphic Double
- runPosObject :: InterpretUnit u => PosObject u a -> RectAddress -> LocImage u a
- runPosObjectBBox :: InterpretUnit u => PosObject u a -> RectAddress -> LocImage u (BoundingBox u)
- makePosObject :: InterpretUnit u => Query u (Orientation u) -> LocImage u a -> PosObject u a
- emptyPosObject :: (Monoid a, InterpretUnit u) => PosObject u a
- elaboratePosObject :: (Fractional u, Ord u, InterpretUnit u) => ZDeco -> RectAddress -> LocGraphic u -> PosObject u a -> PosObject u a
- decoratePosObject :: InterpretUnit u => ZDeco -> (Orientation u -> LocGraphic u) -> PosObject u a -> PosObject u a
- extendPosObject :: InterpretUnit u => u -> u -> u -> u -> PosObject u a -> PosObject u a
- mapOrientation :: InterpretUnit u => (Orientation u -> Orientation u) -> PosObject u a -> PosObject u a
- illustratePosObject :: InterpretUnit u => PosObject u a -> LocGraphic u
- posChar :: InterpretUnit u => Char -> PosGraphic u
- posEscChar :: InterpretUnit u => EscapedChar -> PosGraphic u
- posCharUpright :: InterpretUnit u => Char -> PosGraphic u
- posEscCharUpright :: InterpretUnit u => EscapedChar -> PosGraphic u
- posCharPrim :: InterpretUnit u => Either Char EscapedChar -> PosGraphic u
- posText :: InterpretUnit u => String -> PosGraphic u
- posEscText :: InterpretUnit u => EscapedText -> PosGraphic u
- posTextUpright :: InterpretUnit u => String -> PosGraphic u
- posEscTextUpright :: InterpretUnit u => EscapedText -> PosGraphic u
- posTextPrim :: InterpretUnit u => Either String EscapedText -> PosGraphic u
- multilinePosText :: (Fractional u, InterpretUnit u) => VAlign -> String -> PosGraphic u
- multilinePosEscText :: (Fractional u, InterpretUnit u) => VAlign -> [EscapedText] -> PosGraphic u
- rposText :: (Real u, Floating u, InterpretUnit u) => Radian -> String -> PosGraphic u
- rposEscText :: (Real u, Floating u, InterpretUnit u) => Radian -> EscapedText -> PosGraphic u
- posHKernText :: InterpretUnit u => [KernChar u] -> PosGraphic u
- monospaceText :: InterpretUnit u => Query u u -> String -> PosGraphic u
- monospaceEscText :: InterpretUnit u => Query u u -> EscapedText -> PosGraphic u
Positionable image
A positionable "Object".
Monad (PosObject u) | |
Functor (PosObject u) | |
Applicative (PosObject u) | |
DrawingCtxM (PosObject u) | |
(Monoid a, InterpretUnit u) => Monoid (PosObject u a) | |
(Monoid a, InterpretUnit u) => AlignSpace (PosObject u a) | |
Monoid a => Align (PosObject u a) | |
(Monoid a, InterpretUnit u) => CatSpace (PosObject u a) | |
Monoid a => Concat (PosObject u a) | |
(Monoid a, InterpretUnit u) => ZConcat (PosObject u a) |
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
runPosObject :: InterpretUnit u => PosObject u a -> RectAddress -> LocImage u aSource
Running an PosObject produces a LocImage.
runPosObjectBBox :: InterpretUnit u => PosObject u a -> RectAddress -> LocImage u (BoundingBox u)Source
Run a PosObject producing a LocImage (BoundingBox u).
makePosObject :: InterpretUnit u => Query u (Orientation u) -> LocImage u a -> PosObject 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) => PosObject u aSource
emptyPosObject
: PosObject
Build an empty PosGraphicObject
.
elaboratePosObject :: (Fractional u, Ord u, InterpretUnit u) => ZDeco -> RectAddress -> LocGraphic u -> PosObject u a -> PosObject u aSource
decoratePosObject :: InterpretUnit u => ZDeco -> (Orientation u -> LocGraphic u) -> PosObject u a -> PosObject u aSource
extendPosObject :: InterpretUnit u => u -> u -> u -> u -> PosObject u a -> PosObject u aSource
Extend the orientation.
mapOrientation :: InterpretUnit u => (Orientation u -> Orientation u) -> PosObject u a -> PosObject 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.
posChar :: InterpretUnit u => Char -> PosGraphic 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 -> PosGraphic uSource
posCharUpright :: InterpretUnit u => Char -> PosGraphic uSource
posEscCharUpright :: InterpretUnit u => EscapedChar -> PosGraphic uSource
posCharPrim :: InterpretUnit u => Either Char EscapedChar -> PosGraphic uSource
Primtive builder that does not add margins.
posText :: InterpretUnit u => String -> PosGraphic uSource
posEscText :: InterpretUnit u => EscapedText -> PosGraphic uSource
posTextUpright :: InterpretUnit u => String -> PosGraphic uSource
posEscTextUpright :: InterpretUnit u => EscapedText -> PosGraphic uSource
posTextPrim :: InterpretUnit u => Either String EscapedText -> PosGraphic uSource
Primtive builder that does not add margins.
multilinePosText :: (Fractional u, InterpretUnit u) => VAlign -> String -> PosGraphic uSource
multilinePosEscText :: (Fractional u, InterpretUnit u) => VAlign -> [EscapedText] -> PosGraphic uSource
rposText :: (Real u, Floating u, InterpretUnit u) => Radian -> String -> PosGraphic uSource
Note - for single line text.
rposEscText :: (Real u, Floating u, InterpretUnit u) => Radian -> EscapedText -> PosGraphic uSource
Note - for single line text.
posHKernText :: InterpretUnit u => [KernChar u] -> PosGraphic uSource
monospaceText :: InterpretUnit u => Query u u -> String -> PosGraphic uSource
The query should retrieve the width of one char.
monospaceEscText :: InterpretUnit u => Query u u -> EscapedText -> PosGraphic uSource
The query should retrieve the width of one char.