Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This C++ for begineer. Plese don't use oriented C++. Assignment 1: ImageModder PPM: Portable Pix Map Image Format Specification The portable pix map image format

This C++ for begineer. Plese don't use oriented C++.

Assignment 1: ImageModder PPM: Portable Pix Map Image Format Specification The portable pix map image format (ppm) is one of the simplest methods of creating an image file. This format is encoded as readable ascii text or viewed as an image with an image viewing program such as gimp. Read the following wiki-link for additional details: https://en.wikipedia.org/wiki/Netpbm_format In this assignment, you will make a program that can convert color images to grayscale and black and white pictures and can create borders around the image. BE SURE TO READ THE DELIVERABLES! Sample ppm file: P3 4 4 255 0 0 0 200 0 0 0 0 0 155 0 155 0 0 0 0 155 175 0 0 0 0 0 0 0 0 0 0 0 0 0 100 175 0 0 0 255 255 255 0 0 0 0 0 0 155 155 155 PPM Header The ppm file is divided into a header and a body. The header contains four values: P3 4 4 255 The first field with the value P3 is called a magic number. This defines what type of image is being represented: Magic Number Image Type P1 Black and White P2 Grayscale P3 Color P3 indicates that the image will use RGB color. The second line indicates width and height. In this example, the image has a width of 4 and a height of 4. The 255 indicates the maximum color value. In the example above colors are between 0-255.

Question 1: Working with Files The first milestone is to get the program to do the following: Ask the user to specify the name of the ppm image file If the file cannot be opened, the program should report this to the user and exit (ie return). Ask the user to specify an output file. Read the header information of the original file Make an exact copy of the original ppm image data by looping through the rest of the file. However, the program should only make a copy of the image if the image contains less than 1000 pixels for width or height. If the original image contains more than 1000 pixels for either dimension, then program should report this to the user and exit. (HINT: The header can help determine how many pixels are in the image.) Here is an Example interaction with the user: Portable Pixmap (PPM) Image Modder Enter image file name (ppm): fluffyBunny.ppm Enter output image file name: out.ppm out.ppm created! Note that the program is not required to display the image. It just manipulates pixels and creates a file in proper PPM format.

Question 2: Menu The next milestone is to create a menu for the user to choose what image process to complete. Here is an example of the menu: Portable Pixmap (PPM) Image Modder Enter image file name (ppm): fluffyBunny.ppm Enter output image file name: out.ppm Image Processing Choices: 1. Convert to grayscale 2. Invert Red 3. Invert Green 4. Invert Blue 5. Invert All Enter Choice: 1 out.ppm created! For now, just concentrate on creating the menu. The next milestone we will create the implementation for each option. PLEASE DO In C++ USING LOOP

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

AWS Certified Database Study Guide Specialty DBS-C01 Exam

Authors: Matheus Arrais, Rene Martinez Bravet, Leonardo Ciccone, Angie Nobre Cocharero, Erika Kurauchi, Hugo Rozestraten

1st Edition

1119778956, 978-1119778950

More Books

Students also viewed these Databases questions

Question

4. What sales experience have you had?

Answered: 1 week ago