Question: Colour Palette You are tasked with writing a program that will discover and index the colour palette of an image by iterating through image data

 Colour Palette You are tasked with writing a program that will

discover and index the colour palette of an image by iterating through

Colour Palette You are tasked with writing a program that will discover and index the colour palette of an image by iterating through image data and extract the colour value. The colour value is represented by an unsigned integer value. It is recommended you use stdint.h and utilise uin8 t or uint32 t for reading in the data. We also recommend you implement this program using a linked list or use realloc The program will take in a filename from the command line. index image If no argument is specified, the program should respond with No Filename Specified if the file does not exist, your program needs to respond with File Does Not Exist The file format is a type of bitmap image in binary format. The top of the file will specify the width and height of the image as well as a 2 byte magic number to confirm that it is a valid type. Each 4 bytes in the image data corresponds to 1 pixel in the image. 10 Width: 4bytes Image Data height: 4bytes magic: 2 bytes 10 bytes width height 4bytes The magic number in decimal form is 60535 If the magic number does not match with the file specified. The program respond Invalid Image Header and terminate with exit code 1 Colour Palette You are tasked with writing a program that will discover and index the colour palette of an image by iterating through image data and extract the colour value. The colour value is represented by an unsigned integer value. It is recommended you use stdint.h and utilise uin8 t or uint32 t for reading in the data. We also recommend you implement this program using a linked list or use realloc The program will take in a filename from the command line. index image If no argument is specified, the program should respond with No Filename Specified if the file does not exist, your program needs to respond with File Does Not Exist The file format is a type of bitmap image in binary format. The top of the file will specify the width and height of the image as well as a 2 byte magic number to confirm that it is a valid type. Each 4 bytes in the image data corresponds to 1 pixel in the image. 10 Width: 4bytes Image Data height: 4bytes magic: 2 bytes 10 bytes width height 4bytes The magic number in decimal form is 60535 If the magic number does not match with the file specified. The program respond Invalid Image Header and terminate with exit code 1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!