The Current Situation

Download Report

Transcript The Current Situation

Aim
To create a graphics library for Haskell which produces attractive graphics and provides a
flexible array of manipulation functions whilst keeping into consideration the library will be used
for learning and therefore must be understandable by people who are not experienced at using
Haskell.
Example
Haskell Graphics Library
The Current Situation
First year computer science students at UKC are required to take
a module in Haskell, a functional programming language. In this
module students are taught how to use this language in various
ways, one of which is in the form of manipulating an image.
,
However the term ‘image’ here is meant as lists of strings of
ASCII characters ‘#’ or ‘.’ which made up a fairly simple image.
The ‘horse’ example shown below:
Example input used to construct image shown right
.......##...
.....##..#..
...##.....#.
..#.......#.
..#...#...#.
..#...###.#.
.#....#..##.
..#...#.....
...#...#....
....#..#....
.....#.#....
......##....
A simple scene constructed with the input, left
Features
• Utilises PDF as its output type to produce rendered vector graphics
• Functionality for the creation of lines, rectangles, ellipses and polygons
• Uses RGB colour model to specify ranges of colours to objects
• Functionality for transformations such as translation, scaling and rotation.
It is clearly apparent here that the old version (left) is less
attractive than even a very simple implementation of it in HGL
(right).
• Input checking to avoid errors
This graphics library is the work of Matthew Forrest for a third year research project.
Created using HEAT ( Haskell Educational Advancement Tool ). Supervised by Olaf Chitil.