[Solved] CSE344- Homework 1-a POSIX compatible C program that admits as command line argument the path of a black & white

$25

File Name: CSE344-_Homework_1-a_POSIX_compatible_C_program_that_admits_as_command_line_argument_the_path_of_a_black_&_white.zip
File Size: 1055.04 KB

SKU: [Solved] CSE344- Homework 1-a POSIX compatible C program that admits as command line argument the path of a black & white Category: Tag:
5/5 - (1 vote)

Homework #1

The Tagged Image File Format or Tiff is a format for storing digital images. A digital image can be thought of as a rectangular matrix of non-negative integers, where every point (or pixel) of the image is denoted by a single value. Tiff is a powerful file format that can store multiple scenes in a single file and compress them quite effectively.

This homeworks objective is to write a POSIX compatible C program that admits as command line argument the path of a black & white, uncompressed locally stored tiff file and prints its pixels on the standard output using 0s for black and 1s for white.

Example input image (2525) (test.tif):

Expected output on screen:

$./tiffProcessor test.tif

Width : 25 pixels

Height : 25 pixels

Byte order: Intel

1111111111111111111111110

1111111111111111111111110

1111111111111111111111101

1111111111111111111111011

1111111111111111111110111

1111111111111111111101111

1111111111111111111011111

1111111111111111110111111

1111111111111111101111111

1111111111111111011111111

1111111111111110111111111

1111111111111101111111111

1111111111111011111111111

1111111111110111111111111

1111111111101111111111111

1111111111011111111111111

1111111110111111111111111

1111111101111111111111111

1111111011111111111111111

1111110111111111111111111

1111101111111111111111111

1111011111111111111111111

1110111111111111111111111

1101111111111111111111111

0011111111111111111111111

Rules:

  1. You are not allowed to use any 3rd party libraries for loading tiff files. Use POSIX and Standard C libraries. You can write your program using C11 standards.
  2. Your program must handle eventual errors gracefully according to the POSIX way.
  3. If the command line argument is missing your program must print usage information.
  4. Your program must work with black & white uncompressed tiff files in either Intel of Motorolabyte order.
  5. Make sure your program doesnt have any memory leak and runs clean. You can check that andmany other things using Valgrind tool. Just run your program from shell like this :

valgrind ./tiffprocessor test.tif

It will output whether your program has memory leak or not. Also it will tell you about invalid memory accesses, uninitialized memory and much more. For example, if your program gives segmentation fault, most of the time Valgrind will tell you the reason. So it is also a very powerful tool for debugging.

A program with no errors or leaks will give you an output like this:

We will be expecting your homeworks to run just like the one above. For each process the output should be: all heap blocks are freed no leaks are possible and 0 errors when we run it with Valgrind. A few errors is OK if they are not harmful.

  1. Your program MUST not give segmentation fault or any other fault that causes your program to end in a bad way. It is better for you to send a little part of the homework with clean and executing code instead of full homework with faults like this.
  2. Provide a makefile to compile your homework. Do not run your program inside makefile. Just compile it.
  3. Think smart and try to do the job with as short as possible and easily understandable code. Do not send homeworks with 1000 lines that can be done in 200 lines. When you find a solution to a problem, think like this: What could be a better solution.
  4. Test your homework using the Virtual Machine given to you.
  5. No late submissions.

Tip for this homework: You can produce uncompressed tiff files using Gimp and ImageJ.

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[Solved] CSE344- Homework 1-a POSIX compatible C program that admits as command line argument the path of a black & white
$25