Copyright | (c) Francesco Gazzetta 2016 |
---|---|
License | MIT |
Maintainer | francygazz@gmail.com |
Stability | experimental |
Safe Haskell | None |
Language | Haskell98 |
This module contains the Picture
datatype, used to represent the image to draw
on the canvas, and some functions to operate on it.
- data Picture
- = Empty
- | Rect Double Double
- | RectF Double Double
- | Line Double Double Double Double
- | Polygon [(Double, Double)]
- | Arc Double Double Double Bool
- | CircleF Double
- | Text Font TextAlignment (Maybe Double) String
- | Image ImageSize ImageData
- | Over Picture Picture
- | Colored Color Picture
- | Rotate Double Picture
- | Translate Double Double Picture
- data Color = Color Int Int Int Float
- data TextAlignment
- type Font = String
- circle :: Double -> Picture
- path :: [(Double, Double)] -> Picture
- (<>) :: Monoid m => m -> m -> m
Documentation
A drawable element. All Pictures are centered.
Empty | The empty picture. Draws nothing. |
Rect Double Double | A rectangle from the dimensions |
RectF Double Double | Same thing but filled |
Line Double Double Double Double | A line from the coordinates of two points |
Polygon [(Double, Double)] | A polygon from a list of vertices |
Arc Double Double Double Bool | An arc from the radius, start angle, end angle. If the last parameter is True, the direction is counterclockwise TODO replace with Clockwise | Counterclockwise or remove entirely |
CircleF Double | A filled circle from the radius |
Text Font TextAlignment (Maybe Double) String | Draws some text. The |
Image ImageSize ImageData | Draws an image |
Over Picture Picture | Draws the second |
Colored Color Picture | Applies the |
Rotate Double Picture | Rotates the Picture (in radians) |
Translate Double Double Picture | Moves the Picture by the given x and y distances |
A color given r, g, b (all from 0 to 255) and alpha (from 0 to 1)
data TextAlignment Source #
How the text should be aligned