Graphics and GUI Programming
Lecture Notes |
An examination of the concepts and methods in programming graphical
user interfaces made up of windows and mouse clicks as well as other
computer graphics such as 3D rendering and animation. The specific
topics and level of the course will depend on the students. (We'll
likely use Java, Perl, or C.)
Grading will be based on
I'm not quite sure what topics at what levels we'll be covering;
in part that'll depend on who takes the course.
- Weekly assignments (one grade for how many done)
- Several projects; I'm not sure exactly how many yet.
This webpage will continue to change throughout the semester
as assignments and resources are added.
- for Tues Jan 27
- Send me (email@example.com)
an email telling me you're registering for this class.
- Install Perl and Perl/Tk on a system you have access to.
Review and/or start translating what you know into Perl,
including object oriented syntax. Peruse the Perl/Tk tutorial
listed below in the Resources, and get something like that running
yourself. (This can be done on cs.marlboro.edu; remind me to
get accounts up for folks.) Report on progress next Tues.
- for Tues Feb 3
- Look into either a Perl/Tk or a Java/Swing,
and write something along the lines of one of the demos,
including some comments. Come to class ready to show your
work and discuss which objects, events, and views your code uses.
I have links below in the resources section, or share one of the
- Perl: On cs.marlboro.edu ("ssh -X user@cs") or
on your own Perl/Tk installation (if its up and running),
run the Perl/Tk "widget" demo. Just type "widget"
at the command line; its installed in /usr/bin/
Browse through the available widgets and code to get a rough
idea of what's available. Adopt some of the code
for your own purposes - perhaps in a Tic Tac Toe game.
- Java: Follow the "Creating a GUI with Swing" trail.
Download one of their demos, and adopt it to do something
simple of your own choosing. (Tic tac toe, anyone?)
Be ready to discuss next Tuesday in class.
- for Tues Feb 10
- Write a Perl/Tk application that draws a
fractal in a canvas, something along the lines of
the Koch Curve
that I showed in class.
- for Tues Feb 17
- We're moving toward online CGI web scripts
and GD.pm. Please read the documentation for
Write a web script that generates a dynamic image. Your choice
of what or how.
- for Tues Feb 25
- 2D mathematics and vectors practice; assigned in class.
- for Thurs Mar 4
- Read the materials and links on JPEG techniques:
compression, cosine transforms, and color spaces.
- for Thurs Mar 11 (or at end of spring break)
- Mid-term project: write a program which will
We've been working in Perl, and you can do this that way,
but if you'd rather use Java, C, Mathematica, or whatever that's OK too.
Feel free to use any libraries you like
to import/export the JPEG image to an array of numbers;
Perl's GD.pm in particular comes to mind. You can apply the
cosine transform by hand or with a library such as Perl's Math::FFT.
I'm planning on doing this as a CGI script, but a stand alone
application is OK, too.
- display a JPEG image
- apply a cosine transform the image,
using a block size of your choice,
- display the cosine transform
- filter the transform to remove some
of the higher frequencies, and finally
- displays a blurred (higher frequencies removed) image.
In any case, use your application to illustrate what the
cosine transform and this frequency filter does with various examples.
I intend to grade the result, including what evidence you provide
that you understand what's going on.
- for Thurs April 1
- Answer some questions about 4x4 Discrete Cosine Transforms,
with any program or tool you wish.
See graphics/dct/ for the questions and answers
- Jan 20 graphics/introclass.txt
- Jan 22 perl summary
- Jan 27 start Perl/TkTues Jan 27 - go over Perl/Tk "widgets" command,
Tk/helloWorld.pl, Tk/red_blue.pl, and discuss a bit more of Perl syntax: references and objects
- Feb 3
- Feb 10 - images and events in Perl/Tk - see image_demo.pl
- Feb 12 - discussed at show_env.cgi (source)
, CGI.pm, and general ideas behind web applications.
- Feb 17 - more CGI discussion. Examples in /code/perl/cgi/ (as usual, append _html to URL to see source). Also
went over 2D rotations and vectors. See feb17.txt.
- Feb 24 - rotate,shift,stretch: house/transform.cgi. See sources for readings on compression, JPEG, PNG, etc.
Continue discussion of JPEG transformation: YUV, compress UV, 8x8 blocks,
DFT, compress, zig-zag order, then run-length and Huffman compression.
- March 9 - see the notes and programs
which play around with discrete cosine transforms.
Also see notes on mathematica,
which is a good way to muck about with this stuff.
- April 27 graphics/perspective_raytrace.txt
- General interest
- Perl general
- welcome to the monastary...
- Perldoc.com - perl documentation
(Comprehensive Perl Archive Network)
- modules for many purposes
- Perl/Tk -
- Compression and file formats
- Image Transforms
- Gimp (Google "gimp perl")
- Java documentaion
- Java Swing
Web, Graphics, and Perl/Tk : Best of TPJ, volume 2
by Jon Orwant (Ed)
Last modified <% scalar localtime($m->current_comp->load_time) %>