Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hi, I have made the bitmap file already and have barely started the structure to the code, I have started the file open and file

Hi, I have made the bitmap file already and have barely started the structure to the code, I have started the file open and file read, but have no idea really how to turn the bitmap into an array then manipulate the data so that it rotates vertically and horizontally. Any guidance will be awesome.

#include

#include

#include

#include

#

#pragma warning(disable: 4996)

int bitmapArr[7][32];

void main () { int n; int count1; int count2; FILE *f =fopen("C:\\Users\\abirutis\\Downloads\\myBMP.bmp", "rb");

fscanf(f,"%d", &n); while (n != EOF) { //do some stuff bitmapArr[][]

//read the next number fscanf(f, "%d", &n); }

fclose(f); }

void loadFile()

{

}

void printArray() { / printArray to print the hexadecimal numbers stored in the 2D array. }

void printMenu {

printf{""}

while (ans != q) switch case 1: case 2: case 3: case q:

}

void flipHorizonal() { //save to myBMPFlipped1.bmp }

void flipVertical() {

// save to myBMPFlipped2.bmp }

int saveToFile() {

}

void doAll() {

}

HERES THE BITMAP FILE, if you need it

42 4d 66 00 00 00 00 00 00 00 36 00 00 00 28 00 00 00 03 00 00 00 04 00 00 00 01 00 18 00 00 00 00 00 00 00 00 00 c4 0e 00 00 c4 0e 00 00 00 00 00 00 00 00 00 00 00 00 ff ff 00 00 00 ff ff 00 00 00 00 ff 00 00 00 ff ff ff ff 00 00 00 ff 00 00 00 ff ff 00 00 ff 00 00 00 00 00 ff 00 ff 00 ff ff ff 00 00 00 00 00 00 00 00 00 00 00 00

Here are some guildlines for the project:

image text in transcribed

This is the structure of the bmp

image text in transcribed

image text in transcribed

l. Create a .bmp file, called myBmp.bmp, that stores the 4x3 image shown in Figure 4, where the 24-bit color in each component. You must calculate the number of padding bytes required in each ro 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 [10 points] 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 15 points] 2.2. Write a function loadFile(myBmp to read a .bmp file and store them into an2D array of integers [10 points] 2.3. Write a function printMenu to print a menu for users to choose one of the following functions a call the function, The program must include a 'q' option to exit the program [10 points] 2.4. Write a function printArray to print the hexadecimal numbers stored in the 2D array. You can use %x control character in printf [10 points] 2.5. Write a function flipHorizonal to flip the image horizontally and save the data intoanew file called myBMPFlippedl. bmp, [10 points] 2.6. Write a function flipVertical to flip the image vertically and save the data into a new file called myBMPFlipped2.bmp. [10 points] 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 [10 points] 2.8. Write a function doAll, which performs the following tasks: [10 points] i. load File(myBmp) ii. printArray iii. flipHorizonal; iv. load File (myBMPFlippedl. bmp) v. print Array, vi. flipVertical vii. load File(myBMPFlipped2.bmp) viii. print Array, 2.9. Write the main function to perform at least the following tasks 15 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 l. Create a .bmp file, called myBmp.bmp, that stores the 4x3 image shown in Figure 4, where the 24-bit color in each component. You must calculate the number of padding bytes required in each ro 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 [10 points] 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 15 points] 2.2. Write a function loadFile(myBmp to read a .bmp file and store them into an2D array of integers [10 points] 2.3. Write a function printMenu to print a menu for users to choose one of the following functions a call the function, The program must include a 'q' option to exit the program [10 points] 2.4. Write a function printArray to print the hexadecimal numbers stored in the 2D array. You can use %x control character in printf [10 points] 2.5. Write a function flipHorizonal to flip the image horizontally and save the data intoanew file called myBMPFlippedl. bmp, [10 points] 2.6. Write a function flipVertical to flip the image vertically and save the data into a new file called myBMPFlipped2.bmp. [10 points] 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 [10 points] 2.8. Write a function doAll, which performs the following tasks: [10 points] i. load File(myBmp) ii. printArray iii. flipHorizonal; iv. load File (myBMPFlippedl. bmp) v. print Array, vi. flipVertical vii. load File(myBMPFlipped2.bmp) viii. print Array, 2.9. Write the main function to perform at least the following tasks 15 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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Put Your Data To Work 52 Tips And Techniques For Effectively Managing Your Database

Authors: Wes Trochlil

1st Edition

0880343079, 978-0880343077

More Books

Students also viewed these Databases questions

Question

Does it have correct contact information?

Answered: 1 week ago

Question

Which team solution is more likely to be pursued and why?

Answered: 1 week ago

Question

4. I can tell when team members dont mean what they say.

Answered: 1 week ago