Create a bmp file called mybmpbmp that stores the 4x3 image


In this project: You will complete the following tasks.

1. Create a .bmp file, called myBmp.bmp, that stores the 4x3 image shown in Figure 4, where the 24-bit color code marked in each component.

You must calculate the number of padding bytes required in each row. Submit the memory map that is similar to Figure 3, but contains the data given in Figure 4. Hint: You can use a Hex Editor to create the .bmp file.

2. Write a C program to implement the following functions.

2.1. Include required libraries and define required variables and define a 2D array to store the data loaded from the file;

2.2. Write a function loadFile(myBmp) to read a .bmp file and store them into an 2D array of integers;

2.3. Write a function printMenu to print a menu for users to choose one of the following functions and call the function; The program must include a ‘q' option to exit the program.

2.4. Write a function printArray to print the hexadecimal numbers stored in the 2D array. You can use %x control character in printf;

2.5. Write a function flipHorizonal to flip the image horizontally and save the data into a new file called myBMPFlipped1.bmp;

2.6. Write a function flipVertical to flip the image vertically and save the data into a new file called myBMPFlipped2.bmp.

2.7. Write a function saveToFile to save the array data (modified through flip operation) into another file. This function should be called by flipHorizonal and flipVertical.

2.8. Write a function doAll, which performs the following tasks:

i. loadFile(myBmp)

ii. printArray;

iii. flipHorizonal;

iv. loadFile(myBMPFlipped1.bmp)

v. printArray;

vi. flipVertical

vii. loadFile(myBMPFlipped2.bmp)

viii. printArray;

2.9. Write the main function to perform at least the following tasks: [5 points]

i. Call loadFile to load the .bmp file data into the 2D array;

ii. Call printMenu;

iii. Return the menu after performing one function, and quit the program is ‘q' is entered.

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: Create a bmp file called mybmpbmp that stores the 4x3 image
Reference No:- TGS02902739

Expected delivery within 24 Hours