[SOLVED] COMP2560 Assignment1-binary-based ppm files

35.00 $

Category:
Click Category Button to View Your Next Assignment | Homework

You will receive the following solution file(s) instantly after successful payment:

zip file icon assign1-vzpgsd.zip (1.7 KB)
Assignment Instructions Updated Recently? Submit Below and we will provide new Solution!
Submit New Instructions
🔒 Securely Powered by:
Secure Checkout
5/5 - (1 vote)

Write a C program to merge two given binary-based ppm files (P6). The names of the two given image files and the name of the combined image file are given as command line arguments. The combined image is obtained by putting the second image to the top-right corner of the first image. The sizes of the given image files are not fixed. If the width or the height of the first image is less than that of the second, your program should report error.

All these image files can be opened with image viewer tools that can work with ppm file format.

For simplicity, the following restrictions are added to the file format of the input:

  • no comment line after the file type specification
  • width (number of columns) and height (number of rows) formatted as ASCII decimal in the second line
  • maximal value of color components given in the third line

 

This is a practice on using System Call I/O. You are not allowed to use standard I/O library functions or other graphics related libraries.

Sample input (firework.ppm and 150.ppm):

 

 

 

60-256 System Programming                                                                                                            Dr. Chen

 

 

 

 

 

Corresponding output:

 

 

 

  • assign1-vzpgsd.zip