COP 4225 Advanced Unix Programming
Project 3

 

Description  

    In this project, you will write a C program that prints out the image width and height (in pixels) of a BMP file (source.bmp), and then draws (i.e. inserts) two diagonal lines (in black, i.e. R=0, G=0, and B=0) on a duplicate image (target.bmp). The command line syntax is: 

    bmputil source.bmp target.bmp

    The detailed description of BMP image format can be found here. You are allowed to use system calls only (no C I/O librabry!), except printf. Assume the number of bits per pixel is always 24. Note that you do NOT need to parse the entire BMP header, and your C program should be as concise as possible. Points will be deducted for unnecessarily long source code (and the penalty will be high).

Hint

You should be aware that BMP and C programs on various computers might have different data interpretations (e.g. signed vs. unsigned integers; little endian vs. big endian).  

Submission