Computer Science 101 Program 5 Due Dec 7 at 11:59 pm Write a complete C program named edge.c that will apply an edge detecting filter to a color image(P6) creating another color image(P6) of the same size. For this program the ONLY authorized source of assistance is Dr. Westall. ANY OTHER DISCUSSION of the program no matter how "high level" or "peripheral" (e.g. Have you started/finished it yet?) is STRICTLY FORBIDDEN. Any student who observes improper behavior is encouraged to report it to Dr. Westall. Reports that can be verified will be rewarded with a 20 point bonus on the assignment for the student doing the reporting and an F for the course for the student being reported!! The algorithm should work as described near the end of the structs.pdf section of the notes. For this assignment you should use the following definition for your pixel structure: struct pix_type { unsigned char r; // red level unsigned char g; // grn level unsigned char b; // blue level }; Program operation: As usual your program will read the input image from stdin and write the output image to stdout. It will be invoked with a command line similar to the following: a.out < input.ppm > output.ppm The basic algorithm should be as follows: - read ppm header of input image and assign dimensions to variables incols and inrows. These will also be the dimensions of the output image. - malloc space for reading in the input image data sizeof(struct pixtype) * inrows * incols) - malloc space for building the output image sizeof struct pixtype) * inrows * incols) - use a single call to fread to read the input image pixel data - for each row of the output image for each column of the output image replace pixel value with filtered value computed as in the notes store the output pixel values in the output image buffer. - Write the P6 .ppm header for the output image - Use a single call to fwrite to write the output image. - DO NOT HARDCODE FILTER VALUES IN YOUR CODE. You should be able to change the filter by simply changing the matrices!!!!! ------------------------------------------------------------- To assist in verifying correct operation, I have placed three pairs of (thought to be correct) input/output images in the examples directory: Input: Output: dive.ppm dive_s.ppm trump.ppm trump_s.ppm zook1.ppm zook1_s.ppm It will be far easier to diagnose errors using the dive flag image than with the other two. Therefore, do NOT waste your time (or mine!) trying to figure out why trump and zook1 don't work until dive WORKS PERFECTLY! ------------------------------------------------------------- Adhere to the following programming standards. Violations will lead to deductions. (1) no function should be longer than 30 lines code + whitespace. (2) the maximum nesting level in any function is ONE (3) code lines should not extend beyond column 72 (4) no more that one statement may be written on a single line (5) use reasonably descriptive names for variables and functions (6) package all functions into a single source code module named edge.c (7) your program should compile without any warnings with gcc -Wall (8) indenting should be consistent with logical nesting (9) diagnostic / debug prints should be disabled/deleted in your submission.