There are two problems in this PSA:
Picture by specified values. To do this, you will write one method in Picture.java and a main program
to test your method by showing and exploring the original and changed picutres.
Picture so that the
top 1/3rd of the picture is the negative of the picture, the middle 1/3rd is grayscale,
and the bottom 1/3rd of the picture is any effect of your choice. To do this, you will
write and call three methods in Picture.java. In addition, you will post the
resulting image from this problem on the class wiki.
You must put a comment at the top of your code that specifies, for both you and your partner, your: real names, login names, and PIDs, AND a two to four sentence description of the program (one description for each program).
Use a multi-line comment (/* */).
You must observe an 80 column limit. No line of your program may be longer
than the 80th column on the screen.
subtractColor
subtractColor (be sure to use PSA4/bookClasses/Picture.java). Your method takes three parameters --
which specify how much the color components of all pixels of the picture should be reduced.
For example, if you pass (100, 20, 45) as parameters to your method and the color values of
one of the pixels of the picture is (150, 200, 50), then these color values should be reduced to
(50, 180, 5) after your method is called. Note that a negative color value is automatically counted as 0.
The order in which the color values are passed to the method should be red, blue, and green.
Testing your methods (in an application):
Picture copy = new Picture(original);
explore() method on that picture.
negative
grayscale
grayscale similar to the
negative method called grayscale which
also takes the first and last index in the pixel array to be modified.
For those pixels in range, you need to change the colors to their
appropriate grayscale color using another while loop.
myFilter
When you are ready to turn in your homework, first open a terminal window by right clicking on the empty area of your computer's desktop (have to use
lab computers or remotely connect from your home computer using SSH or Putty)
and select "Open a New Terminal". Then, run bundlePSA4 from your PSA4/bookClasses directory.
3 files are required to be submitted for PSA4:
-bash-2.05b$ cd ~/PSA4/bookClasses
-bash-2.05b$ bundlePSA4
Good; all required files are present:
Picture.java
PSA4A.java
PSA4B.java
Do you want to go ahead and turnin these files? [y/n] y
OK. Proceeding.
Performing turnin of approx. XXXX bytes
Copying to /home/linux/ieng6/cs8f/turnin.dest/cs8wxx.PSA4
.
Done.
Total bytes written: XXXX
Please check to be sure that's reasonable.
Turnin successful.
Make sure the Turnin is successful, otherwise we won't receive your submission! . If you want to make changes after you've turned in your homework, make the changes and run bundlePSA2 again. The program will warn you that a "previously turned-in file exists" and ask if "you wish to over-write this existing file". Respond in the affirmative by typing y and pressing the Enter key.
10% of your grade on this assignment will come from an interview you will have with one of the tutors during Open Lab Hours. You have 48 weekday hours after the electronic turnin deadline to get your interview done. The deadline for the interview for PSA4 is Thurs Jan 29 (theoretically at midnight, but actually by the end of the last tutor hour scheduled). Remember, the tutors may be busy after 4pm helping CSE8B students
You get an interview by going into B260 during a scheduled tutor hour. Find the tutor, ask them if you can interview for the 8A PSA. If they have others who are waiting for interviews, your name will go on the end of the list of people waiting. Interviews take about 5 minutes each. It is your responsibility to go in early enough that you can get your interview completed. If everyone waits until the last hour on Thurs, this will not work.
For the interview you will need to have a copy of your team's assignment in your account. If you are using your partner's account to submit the files, make sure you email them to yourself and save them under your account so that you have them available for the interview. The tutor will ask you to log in, change to the directory where your work is and then to follow their directions. They will ask you to run your program to show that it works, open files in Dr. Java (or your favorite editor), and ask you questions about HOW your code works. Additionally, they may question you as to how you would (theoretically) make small changes to the program to have it do something slightly different. You will not actually be required to change your code.
Learning to be able to explain your problem solving process and discuss code with another human being is a very important professional skill. We hope that this process will help you develop this skill.