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

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

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