Question: Need help writing this. (PLEASE ONLY USE C) [NOT Python, C++, or anything else! I will give a thumbs down for this] My professor uses
Need help writing this. (PLEASE ONLY USE C) [NOT Python, C++, or anything else! I will give a thumbs down for this] My professor uses Plagiarism Algorithm. I will use answer here to formulate MY OWN answer due to ethics and programmer pride. THANKS!!

![anything else! I will give a thumbs down for this] My professor](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f328d9d836a_73766f328d95e0cd.jpg)


**Run in linux
Needed files:
https://drive.google.com/open?id=0B-0zOc_yi68GLTJpS3lRbVNQekk
The goal of this machine problem is to learn to use dynamic memory, two and bitmap image files. In this lab, each student is to write a program called lab5.c that allows the user to process a bitmap image file with a transformation matrix to detect edges ional arrays, structures, The program must accept three command line arguments: the conversion method, the name of the input file, and the output file /lab5 command input.bmp output.bmp Your program must verify that the name of the output file is different than the name of the input file The command must be one of the following strings: ftrunc, center, mag, scale). Your program must verify the command is valid. If the input is invalid for any reason, your program must print a message that includes the input format and the possible commands. The input file is a 24-bit color bitmap image of the windows .bmp format A 24-bit color .bmp file has two parts to its header describing the image file. The first header has the following structure struct Header /*Magic identifier /*File size in bytes 1 unsigned short int Type; unsigned int Size; unsigned short int Reservedl, Reserved2; unsigned int Offset; /*Offset to data (in B) /*14 Bytes The Type must be 0x4D42 to indicate the file is a bitmap file (i.e., the letters MB for BitMap). The second part of the header has the following structure struct InfoHeader /*Header size in bytes /* Width / Height of image * 1 unsigned int Size; int Width, Height; unsigned short int Planes*Number of colour planes/ unsigned short int Bits; unsigned int Compression; unsigned int Imagesize int xResolution, yResolution;/* Pixels per meter unsigned int Colors unsigned int ImportantColors;/* Important colors *Bits per pixel /*Compression type /Image size in bytes /*Number of colors /*40 Bytes While there are multiple different formats for the InfoHeader, we will consider only the one for which the Size is exactly 40. We also will be able to handle only files in which Planes is 1, Bits is 24, and Compression is 0. An example program, parsebmp.c, is provided which reads a bitmap file and verifies that the critical fields of the structures are comect. The image information follows as groups of three bytes representing the color of each pixel in RGB format. The pixels are stored as rows of columns just as a two dimensional matrix is stored in C. RGB The goal of this machine problem is to learn to use dynamic memory, two and bitmap image files. In this lab, each student is to write a program called lab5.c that allows the user to process a bitmap image file with a transformation matrix to detect edges ional arrays, structures, The program must accept three command line arguments: the conversion method, the name of the input file, and the output file /lab5 command input.bmp output.bmp Your program must verify that the name of the output file is different than the name of the input file The command must be one of the following strings: ftrunc, center, mag, scale). Your program must verify the command is valid. If the input is invalid for any reason, your program must print a message that includes the input format and the possible commands. The input file is a 24-bit color bitmap image of the windows .bmp format A 24-bit color .bmp file has two parts to its header describing the image file. The first header has the following structure struct Header /*Magic identifier /*File size in bytes 1 unsigned short int Type; unsigned int Size; unsigned short int Reservedl, Reserved2; unsigned int Offset; /*Offset to data (in B) /*14 Bytes The Type must be 0x4D42 to indicate the file is a bitmap file (i.e., the letters MB for BitMap). The second part of the header has the following structure struct InfoHeader /*Header size in bytes /* Width / Height of image * 1 unsigned int Size; int Width, Height; unsigned short int Planes*Number of colour planes/ unsigned short int Bits; unsigned int Compression; unsigned int Imagesize int xResolution, yResolution;/* Pixels per meter unsigned int Colors unsigned int ImportantColors;/* Important colors *Bits per pixel /*Compression type /Image size in bytes /*Number of colors /*40 Bytes While there are multiple different formats for the InfoHeader, we will consider only the one for which the Size is exactly 40. We also will be able to handle only files in which Planes is 1, Bits is 24, and Compression is 0. An example program, parsebmp.c, is provided which reads a bitmap file and verifies that the critical fields of the structures are comect. The image information follows as groups of three bytes representing the color of each pixel in RGB format. The pixels are stored as rows of columns just as a two dimensional matrix is stored in C. RGB
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
