User Tools

Site Tools


cs276:cs276.dhl.tutprog4

This is an old revision of the document!


<Tutorial Program 4>

Due Date: 10/01/2009

Part I

The purpose of this assignment is to modify more images and develop some tools.

In this part you will continue to work with colors and images using mirroring techniques.

* Write and test a function colorDistance to compute the distance between two colors as a double value: First, write a simple test sketch (create some colors, call your function, print the result). Save this sketch. Second, add your function to the utilities.pde file you should have created in a previous assignment (you did do this, didn't you?). Lastly, go back to the test function sketch and remove the colorDistance function. Use Sketch → Add File and choose the utilities.pde file containing colorDistance. Now run the sketch again; it should work fine.

* Write a sketch containing a function to mirror a portion of an image, not the whole thing. Pass in the PImage to be mirrored, along with the starting and ending coordinates for the portion to be mirrored. Do error checking; the ending row and ending column should be larger than their starting counterparts, and the ending row and ending column should not exceed half the width or height of the image, respectively.

* Repeat the above with a vertical mirroring function.

Part II

(coming soon!)

</Tutorial Program 4>

cs276/cs276.dhl.tutprog4.1254373844.txt.gz · Last modified: 2009/10/01 00:10 by wikiwikwik