pangfengliu / programmingtasks

programming tasks from my courses
67 stars 17 forks source link

Mirror a BMP #95

Open sinmaplewing opened 9 years ago

sinmaplewing commented 9 years ago

Task Description

Write a program to mirror a bitmap file (flip horizontally). We assume that the bitmap file follows the following format. We also assume that each pixel has three bytes.

dfxwww3s_56ccg5pg7j_b.png

In this problem you need to mirror a bitmap file and output the result as "mirrored.bmp". The filename of the bmp file will be given as a command line argument. There will be only one bmp file to mirror. It is assumed the width of input image is a multiple of 4 and no more than 1680. Please refer to homework 9 (only the wiki page is needed) for more information on bitmap format.

Sample Execution

./a.out BMP_wiki.bmp

BMP_wiki.bmp

Sample Output File

mirrored.bmp

mirrored.bmp

Tip

You can use mspaint (Start -> Run -> mspaint) to mirror a bitmap file easily (just for checking).

Test Data

You can download the test data (which JudgeGirl uses) from here.

pangfengliu commented 9 years ago

Add the missing figures.