Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In C ++ I need help with creating a function that flips the PPM VECTOR along the X and Y AXIS. I have finished the

In C ++ I need help with creating a function that flips the PPM VECTOR along the X and Y AXIS.

I have finished the rest. Prototype a new class that stores pixel information in a "vector of vectors" given the following declaration: vector> picture_data; The Picture class will contain the following members: A private vector of vector of pixels (declaration shown above). private variables for intensity, number of rows, and number of columns A public function that takes an input file stream and reads a given PPM file into the private vector. This function will return true if the file was able to be fully read, or false otherwise. A public function that takes an output file stream and writes to a PPM file. This function will return false if the number of rows to write is 0, or true otherwise. A public function that flips the PPM vector around the Y axis. The resulting PPM file will be "backwards". A public function that flips the PPM vector around the X axis. The resulting PPM file will be "upside-down". A public function that will set the red value to zero. This is flattening the red. A public function that changes the picture into a grey scale image. This is done by averaging the values of all three color numbers for a pixel, the red, green and blue, and then replacing them all by that average. So if the three colors were 25, 75 and 250, the average would be 116, and all three numbers would become 116. Inputs Inputs for this program come from command line arguments. There will be either two or three arguments: inputFilename outputFilename optionalModificationCode You will be reading a PPM file specified by the user in the first user-supplied command line argument (the input file name). You will be making some sort of modification to the PPM file, which will be provided in a possible third user-supplied argument (modification code) as either Y, X, F or G. If the user specifies Y, then you will flip the PPM file around the Y axis If the user specifies X, then you will flip the PPM file around the X axis.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Databases And Information Systems 22nd European Conference Adbis 2018 Budapest Hungary September 2 5 2018 Proceedings Lncs 11019

Authors: Andras Benczur ,Bernhard Thalheim ,Tomas Horvath

1st Edition

3319983970, 978-3319983974

More Books

Students also viewed these Databases questions

Question

=+ how might this lead to faster growth in productivity?

Answered: 1 week ago