Computer Science 101 Program 4 Due Nov 20 at 11:59 pm Write a complete C program named smooth.c that will apply a smoothing filter to a grayscale image(P5) creating another grayscale image(P5) of the same size. You program should be able to apply the filter ANY NUMBER OF TIMES. The iteration factor should be specified on the command line. 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 follows. Use the following structure to represent a pixel as this approach will facilitate changing to color images later. struct pix_type { unsigned char g; // gray level }; The filter should work as follows: if the pixel is on the edge of the image output pixel = input pixel otherwise apply the following filter to the pixel to obtain the new value float filter[3][3] = { { 0.110, 0.140, 0.110 }, { 0.140, 0.000, 0.140 }, { 0.110, 0.140, 0.110 }, }; The filter computes a weighted average of each the 8 nearest neighbors of each pixel and replaces the pixel with that value. 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 1 < input.ppm > output.ppm The basic algorithm should be as follows: - acquire the command line parameter which specifies the number of iterations of the basic algorithm. - 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 iteration of the filter procedure for each row of the output image for each column of the output image replace pixel value with filtered value shown above store the output pixel values in the output image buffer. interchange input and output buffers - Write the P5 .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 matrix!!!!! ---------------------------------------------------------- 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 smooth.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.