10 likes | 104 Views
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.
E N D
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. HaskellGraphicsLibrary Example 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: , 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. 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. • Input checking to avoid errors It is clearly apparent here that the old version (left) is less attractive than even a very simple implementation of it in HGL (right).