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 RectPosition
- data ObjectPos u = ObjectPos {
- op_x_minor :: !u
- op_x_major :: !u
- op_y_minor :: !u
- op_y_major :: !u
- type PosImage u a = CF2 (Point2 u) RectPosition (ImageAns u a)
- type DPosImage a = PosImage Double a
- type PosGraphic u = PosImage u (UNil u)
- type DPosGraphic = PosGraphic Double
- makePosImage :: Fractional u => ObjectPos u -> LocImage u a -> PosImage u a
- startPos :: Floating u => PosImage u a -> RectPosition -> LocImage u a
- atStartPos :: Floating u => PosImage u a -> Point2 u -> RectPosition -> Image u a
- objectPosBounds :: Fractional u => Point2 u -> RectPosition -> ObjectPos u -> BoundingBox u
Documentation
data RectPosition Source
Datatype enumerating positions within a rectangle that can be
derived for a PosGraphic
.
Utility datatype representing orientation within a rectangular frame. ObjectPos is useful for graphics such as text where the start point is not necessarily at the center (or bottom left).
x_minor is the horizontal distance from the left to the start point x_major is the horizontal distance from the start point to the right y_minor is the vertical distance from the bottom to the start point y_major is the vertical distance from the start point to the top
Values should be not be negative!
ObjectPos | |
|
Positionable image
type DPosImage a = PosImage Double aSource
Version of PosImage specialized to Double for the unit type.
type PosGraphic u = PosImage u (UNil u)Source
A positionable Graphic.
type DPosGraphic = PosGraphic DoubleSource
Version of PosGraphic specialized to Double for the unit type.
makePosImage :: Fractional u => ObjectPos u -> LocImage u a -> PosImage u aSource
makePosImage
: object_pos * loc_graphic -> PosGraphic
Create a PosImage
from an ObjectPos
describing how it
is orientated within a border rectangle and a LocImage
that
draws it.
startPos :: Floating u => PosImage u a -> RectPosition -> LocImage u aSource
startPos
: pos_image * rect_pos -> LocImage
Downcast a PosImage
to a LocImage
by supplying it
with a RectPosition
(start position).
atStartPos :: Floating u => PosImage u a -> Point2 u -> RectPosition -> Image u aSource
atStartPos
: pos_image * start_point * rect_pos -> LocImage
Downcast a PosGraphic
to an Image
by supplying it
with an initial point and a RectPosition
(start position).
objectPosBounds :: Fractional u => Point2 u -> RectPosition -> ObjectPos u -> BoundingBox uSource
Calculate the bounding box formed by locating the ObjectPos
at the supplied point.