Due: Friday 02/16 10:00am

GitHub link: https://classroom.github.com/a/lQBlJcdP

You may wish to refer to the line algorithm section of the online text while working on this assignment.

You will write your own line algorithm!

  1. First decide what you will be programming in for this assignment. You can use any language you’d like, but you must write your own line algorithm (do not use any built in function that may exist for your language of choice).
    • I have provided frameworks for c, java, and python, these will be included when you create the assignment via GitHub classroom.
    • Also included at the root level is a .gitignore file that will prevent you from including image files in your submission. If your programming language has temporary files (like .pyc files in python or .o files in c/c++), please add that to the .gitignore. The only files that should be pushed to GitHub are your makefile and any source code files.
    • Your makefile must be at the root level of your repository. I suggest this for your code as well, but some people do prefer using /src subdirectories, which is ok.
    • Remove all files that you are not using. For example, if you’re working in python, get rid to the base_c and base_java directories.
    • The provided source will also generate a test image. You can find this code in main.c or main.py, NO MATTER WHAT LANGUAGE YOU USE your code must use the same inputs and generate the correct test image. A correct version of the image will be visible in the gallery.
  2. Code Bresenham’s line algorithm!
    • Start with positive slopes less than 1, well talk about other cases next week.
  3. Running $ make should result in your program creating and displaying the test image generated by the main file provided.

Important Programming Notes.

If your are using my frameworks you only need to modify the following files:

  • java
    • Screen.java
    • Main.java
  • c
    • draw.c
    • main.c
    • In display.c there are two display methods, display and sdl_display. display requires that you have imagemagick installed. sdl_display is a native function but required that you have libsdl2 and libsdl2-image both installed. You must also compile with special linker flags, included in the makefile.
  • python
    • In order to use the built in display command, you will need to have the python image library, pillow installed.
    • draw.py
    • main.py