Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started