====================================================================== ===== COMP2720 ===== Semester 2, 2006 ===== Lab sheet ===== ====================================================================== Student name: Dean Dal Broi Student Uni ID: u4222206 Lab goup: Tue 10-12 Tutor: Peter Christen ---------------------------------------------------------------------- Lab number: 1 Date: 2/7/06 ====================================================================== Part 1. Completed part 1, nothing really interesting here, just ran the small commands and read the required help files. Part 2. Loaded a picture file path in JES and then printed the picture file path using "print myfile" the result was "/Users/HomeDirectory/Documents/Comp2720/lab1/thailand-01.jpg" Ran the command "mypict = makePicture(myfile)" which loaded the picture into JES with the name "mypict", I then typed "print mypict" and got back "/Users/HomeDirectory/Documents/Comp2720/lab1/thailand-01.jpg height 400 width 533". I then typed "show(mypict)" and it brought up new window with the picture in it. I then examined the picture with the picture tool. Part 3. Loaded in a new picture and applied the "makeSunset" function to it using "makeSunset(mypic)" and then repainted it using "repaint(mypic)" and found the picture had been modified to make it appear that it was taken at sunset. YAY. for the purposes of the diary keeping requirements: "myfile = pickAFile" loads a file location into JES "mypic = makePicture(myfile)" loads the picture from the file location into JES "show(mypic)" displays that picture in a new window "makeSunset(mypic)" applies the makeSunset function to the picture loaded into JES, however this will not redraw the picture. "repaint(mypic)" actually re-draws the picture so we can the the modification made by the makeSunset function. modified the makeSunset to makeFullmoon, achived this by mutiplying all blue RGB values by 0.7, green by 0.2, red by 0.2. Part 4. The mysterious function gets the average of red and blue RGB values of a pixel, it then sets this average to the value for red and blue in that pixel, it also takes the green value for each pixel and inverts it and sets the invert as the new green RGB value. This program loops and does this for each pixel in the image. The variables in mysterious were poorly named, thus I re-named the variables to more meaningful names. ======================================================================