Project: Image Suite
For this project, you will write the following series of functions which modify a picture. For each function, the address of a picture is passed as a parameter, so the picture passed into the function (e.g., from main) will be changed. Note: you will also need to write a main program that will take the pictures (using the robot) and call each of your functions to modify the images, save them (using the
rSavePicture() function) and display them. Remember that the image will be changed by each function called on it.
void pixelStrip (Picture * pic, char color)
This function should set the R, G, or B value of every pixel in the picture to 0 (depending on what char color is).
For example if parameter color is 'G', then this procedure should change the 'G' component of each pixel in the picture to 0; the 'R' and 'B' components would remain unchanged.
void pictureRedder (Picture * pic)
void pictureGreener (Picture * pic)
void pictureBluer (Picture * pic)
These three related functions should increase the intensity of their respective colors (red, green, or blue). This increase should never go past 255. The color should increase less when it is already high than when it is low.
void circleSelect (Picture * pic, int xCenter, int yCenter, int radius)
This function should select a circle from your picture and turn each pixel within that circle to the corresponding grayscale value.
a creative function of your choosing
This function should do something interesting and creative to your picture. It should not just be a rehashing of a previous exercise or lab, and there should be a good amount of thought and effort placed into this function.
Note on Testing and Project Submission
When turning in your project, be sure to include a document that states what tests you ran and examples of pictures from each function. This needs to be in a separate document from your C source code file. You must remember to email your C source code file to the grader account!!
Be sure to cite any materials from which your solution is derived or by which it is influenced.
In addition to general style and readability checklist, the following project-specific points will be allocated. Please note: if the C sourcefile (the .c file) is not emailed to the grader account, a 10% penalty will be assessed!
- [5 points] The pixelStrip function changes the image by setting the appropriate value to 0 for each pixel throughout the image. A .jpg image of a test of this function must appear in the testing documentation.
- [5 points] The three functions pictureRedder, pictureGreener and pictureBluer must all increase the appropriate value of each pixel throughout the image. A .jpg image of a test of this function must appear in the testing documentation.
- [5 points] The circleSelect function selects a circle from your picture and turns each pixel within that circle to the corresponding grayscale value. A .jpg image of a test of this function must appear in the testing documentation.
- [5 points] You include a creative, image modification function of your choosing. A .jpg image of a test of this function must appear in the testing documentation.
- [5 points] All of the functions should be clear and concise with comments documenting what they are intended to do, especially your creative function. You should include a testing plan and a printout showing the results of testing, which should include images as they appeared before and after modification by the functions.
- [3 points extra credit] Uses at least one function pointer correctly