Assignment due by 11:59 pm on Wednesday, October 21, 2009
Assignment submission instructions:
- Download the following C program and add your code to it.
- Rename it using your UNCW username like this: abc1234_a2.c
- Make sure to type your name in at the top of the program and read the statement that follows.
- Login to your UNCW email account
- Create an email addressed to narayans@uncw.edu with the subject:Your Name: CSC 112 Project 2 Submission
- Copy yourself on the email.
- Attach your C program file to the email.
- Send the email before the deadline.
Assignment Instructions
Write a C program that reads in an image in PPM format, applies a color filter to it and outputs the resulting image to a file in PPM format.
Here are several examples of how you might use your program. Note that these are only examples. Your colorFilter program must accept arbitrary RGB values that specify the color of the filter, as command line arguments.
- colorFilter 255 0 0 < input.ppm > output.ppm, applies a red filter to the image contained in the file input.ppm and saves the resulting image in the file output.ppm. The RGB specification 255 0 0 represents the color red.
- colorFilter 255 175 175 < input.ppm > output.ppm, applies a pink filter to the image contained in the file input.ppm, and saves the resulting image in the file output.ppm. The RGB specification 255 175 175 represents the color pink.
- colorFilter 255 255 0 < input.ppm > output.ppm, applies a yellow filter to the image contained in the file input.ppm, and saves the resulting image in the file output.ppm. The RGB specification 255 255 0 represents the color yellow.
- colorFilter 0 255 0 < input.ppm > output.ppm, applies a green filter to the image contained in the file input.ppm, and saves the resulting image in the file output.ppm. The RGB specification 0 255 0 represents the color green.
- colorFilter 255 0 255 < input.ppm > output.ppm, applies a magenta filter to the image contained in the file input.ppm, and saves the resulting image in the file output.ppm. The RGB specification 255 0 255 represents the color magenta.