Portability | GHC |
---|---|
Stability | highly unstable |
Maintainer | stephen.tetley@gmail.com |
Helpers for working with Images and LocImages that produce bounding boxes.
- type BoundedGraphic u = Image u (BoundingBox u)
- type BoundedLocGraphic u = LocImage u (BoundingBox u)
- type BoundedLocThetaGraphic u = LocThetaImage u (BoundingBox u)
- centerOrthoBBox :: (Real u, Floating u, Ord u) => Radian -> BoundingBox u -> BoundingBox u
- emptyBoundedLocGraphic :: InterpretUnit u => BoundedLocGraphic u
- emptyBoundedLocThetaGraphic :: InterpretUnit u => BoundedLocThetaGraphic u
- illustrateBoundedGraphic :: InterpretUnit u => Image u (BoundingBox u) -> Image u (BoundingBox u)
- illustrateBoundedLocGraphic :: InterpretUnit u => LocImage u (BoundingBox u) -> LocImage u (BoundingBox u)
- illustrateBoundedLocThetaGraphic :: InterpretUnit u => LocThetaImage u (BoundingBox u) -> LocThetaImage u (BoundingBox u)
- bbrectangle :: InterpretUnit u => BoundingBox u -> Graphic u
- boundedRect :: InterpretUnit u => DrawMode -> u -> u -> BoundedLocGraphic u
Type synonyms
type BoundedGraphic u = Image u (BoundingBox u)Source
type BoundedLocGraphic u = LocImage u (BoundingBox u)Source
type BoundedLocThetaGraphic u = LocThetaImage u (BoundingBox u)Source
Bounding box graphic helpers
centerOrthoBBox :: (Real u, Floating u, Ord u) => Radian -> BoundingBox u -> BoundingBox uSource
centerOrthoBBox
: theta * bbox -> BBox
Rotate a bounding box by theta
about its center. Take the
new bounding box.
Remember that bounding boxes are always orthonormal rectangles, so the dimensions as well as the positions may change under rotation.
emptyBoundedLocGraphic :: InterpretUnit u => BoundedLocGraphic uSource
Build an empty LocGraphic
returning a bounding box.
The emptyBoundedLocGraphic
is treated as a null primitive
by Wumpus-Core
and is not drawn, although it does generate
the minimum bounding box with both the bottom-left and
upper-right corners at the implicit start point.
emptyBoundedLocThetaGraphic :: InterpretUnit u => BoundedLocThetaGraphic uSource
Build an empty LocThetaGraphic
returning a bounding box.
The emptyBoundedLocThetaGraphic
is treated as a
null primitive by Wumpus-Core
and is not drawn, although
it does generate the minimum bounding box with both the
bottom-left and upper-right corners at the implicit start point
illustrateBoundedGraphic :: InterpretUnit u => Image u (BoundingBox u) -> Image u (BoundingBox u)Source
Draw a BoundedGraphic, illustrating the bounding box.
illustrateBoundedLocGraphic :: InterpretUnit u => LocImage u (BoundingBox u) -> LocImage u (BoundingBox u)Source
Draw a BoundedLocGraphic, illustrating the bounding box.
illustrateBoundedLocThetaGraphic :: InterpretUnit u => LocThetaImage u (BoundingBox u) -> LocThetaImage u (BoundingBox u)Source
Draw a BoundedLocThetaGraphic, illustrating the bounding box.
bbrectangle :: InterpretUnit u => BoundingBox u -> Graphic uSource
Draw a bounding box as a stroked rectangle with dotted lines.
boundedRect :: InterpretUnit u => DrawMode -> u -> u -> BoundedLocGraphic uSource
boundedRect
: style * width * height -> LocGraphic
Create a stroked rectangle - the implicit start point is bottom-left, return the bounding box of the rectangle as the answer.
The line properties (colour, pen thickness, etc.) are taken
from the implicit DrawingContext
.