Write a program to access image files

Assignment Help C/C++ Programming
Reference no: EM132168011

Assignment

I. Description

In this assignment, you are going to write a C program to access image files. In particular, you are going to read three types of pgm image files. The pgm file format is as follows

P2
# This is a comment
# This is another comment 460 360
255
. . .

The first one is tag (P2, P5, or P6), # is indicating comments, followed by width and height and intensity level. After that, it will be the image data where P2 is for text data, P5 is binary data, and P6 is binary data with three color channels (RGB).

First, you need to read two arguments from the command prompt, which will be used for input file and output file Then, do the following steps.

1. Open the input file

2. Read the tag to determine the format

3. Skip the comments

4. Dynamically allocate the memory and Read the data into a buffer

5. Open the output file

6. Write the data buffer to the file using a binary format (either P5 or P6)

7. Release the memory

Reference no: EM132168011

Questions Cloud

What annual benefit is required : A new airport expansion will cost $85 million. The largest amount, $55 million, is for land acquisition and major earthworks.
Which of the five forces in porter five forces model : Which of the five forces in Porter’s five forces model do you anticipate will most strongly affect Andy’s potential business and why?
What must the annual gradient be : Assume a study period of 100 years with $0 salvage values for Problem 14.9. If the initial annual benefit is $6 million, what must the annual gradient be.
What is your understanding of the present value of money : What is your understanding of the present value of money? How about the future value of money?
Write a program to access image files : Write a C program to access image files. In particular, you are going to read three types of pgm image files - Write the data buffer to the file using a binary
What are the four basic components of the marketing mix : What external environmental factors affect strategic marketing decisions? What are the four basic components of the marketing mix?
How business law concepts apply today or in the future : What new developments do you think will present the need to rethink and re-evaluate how business law concepts apply today or in the future?
How many users per year are needed to justify the road : A road costs $450,000 to build and $12,000 per year for street cleaning. The road is re-striped every 2 years for $28,000 and repaved every 10 years.
Both hard and soft controls may be used at organization : Both hard and soft controls may be used at an organization. An example of a hard control is...

Reviews

len2168011

11/16/2018 1:24:29 AM

Submit your source files along with a readme indicating how to compile your files via blackboard. All assignments will be tested under Unix. Compile and Link Successfully – 10 points Correct makefile with main.c, pgm.c, and pgm.h (10 points) Correctly read the P2 image and save with the P5 image format (20 points) Correctly read the P5 image and save with the P5 image format (20 points) Correctly read the P6 image and save with the P6 image format (20 points)

Write a Review

C/C++ Programming Questions & Answers

  Maintence personnel

Southern Air is considering purchase of new aircraft and has set aside $1.5B dollars for this. They have enough pilots to crew 30 new planes and enough maintence personnel to crew 40 new short range planes.

  Find the retail price for each product

Your program should use a switch statement to find the retail price for each product - Use a sentinel-controlled loop to decide when the program should stop looping and show the final output.

  Write a program that will read in 2 numbers per line

1.Write a program that will read in 2 numbers per line, and print the sum. You program should work for any number of lines of data.

  Generate mazes using different algorithms

Generate mazes using different algorithms - Solve various mazes using pathfinding algorithms and Use polymorphism and design patterns to allow different maze generation/solving algorithms to be added easily.

  Find the value of expression with the subtraction operation

Write a driver program to test your modified class Begin with the subtraction operation - added in Exercise .

  Create a program, using at least one for loop

Create a program, using at least one For loop, that displays the Sales Amounts made in each of 4 regions (North, South, East, and West) during a three month period.

  Program that uses non recursive function to search

Write a C program that uses non recursive function to search for a key value in a given sorted list of integers usingt Binary search

  Average temperature for the month in new york city

As values are read in the loop calculate the necessary sums and values for the following (Do not determine any of the values merely by inspection): The average temperature for the month in New York City and the average temperature for the month in ..

  Write a program that performs functions of the standard unix

Write a program called signal.c that performs the functions of the standard UNIX kill command. We will call our program signal instead of kill.

  Write a method called randominrange

Write a method called randomInRange that accepts two integer parameters representing a range. The method should return a random integer in the specified range.

  Relate the features with the real life scenarios

Explain any three features that must be implemented by the application that will be created by WebSoft Solutions Pvt. Ltd. Support your answer with suitable examples. Relate the features with the real life scenarios.

  Program that implements the bubble sort method

Write a C program that implements the bubble sort method to sort a given list of names in ascending order.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd