Program 3 Guide

[ Assignment Writeup | Summary | Details | Prerequisites ]
[ PPM Format | PGM Format | Solution ]

Summary and Goal

Students are to read in a PPM file and perform an interesting modification to it. ( Assignment writeup )

Details

  • The students will read the file specified on the command line and output it to standard out with some sort of interesting modification.
  • They will read all the data without a loop using fread.

Prerequisites for completing assignment

In addition to the skills required for assignment 2, students need the following:
  • Knowledge of access to the command line: argv[0] is the executable, argv[1] is the first argument.
  • Ability to open files for reading with fopen(filename, "r");
  • Knowledge of fscanf .
  • Knowledge of arrays.
  • Knowledge of dynamic memory allocation/deallocation with malloc and free .
  • Knowledge of fread(buf, type_size, num_items, file);
  • Knowledge of an interesting modification (from self study or office visits).

Solution  Sample input files: P3 file, P6 file, P6 file

P6 Format Solutions | P3 Format Solutions
Grade Program Name Description (click description to see one implementation - yours may differ) Command-line Arguments
80% simple_lines.c Add black TV scan lines input file
85% lines.c Blend in black TV scan lines input file
90% flipV.c Flip an image vertically input file
95% flipH.c Flip an image horizontally input file
110% rotate90.c Rotate an image 90 degrees input file




[ Assignment Writeup | Summary | Details | Prerequisites ]
[ PPM Format | PGM Format | Solution ]