Question: Write a c++ program that will manipulate an image when it is provided. The program should read the image then produce a P6 output of
Write a c++ program that will manipulate an image when it is provided. The program should read the image then produce a P6 output of the transformed image. The transformations of the P6 output image should be:
1. Become resized to double it's height and width. One way to do this is to calculate the relative height and width to find the pixel of the original image that is closest in location to the pixel needed in the new image. The function prototype for the above solution is as follows:
void resizeImage(image_t*, image_t* );
The two image_t* parameters represent the original image and the new resized image.
2. Grayscale the image. A formula to calculate the grayscale RGB values is: 0.21R + 0.72G + 0.07B. This value will become the Pixels RGB values. The values could result in the RGB values being outside of the allowed range of 0 255. If the value is less than 0 make it 0, if it is > 255 them make it 255. This should be a function in itself.
3. Rotate the image 90 degrees to the left.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
