Question: I need to write a C function called getImage() whose prototype is shown in the contents of transform.h below. This function must accept input from
I need to write a C function called getImage() whose prototype is shown in the contents of transform.h below. This function must accept input from a .ppm image file specified at the command line (which I have already written logic for; only need getImage function) and store its pixel data in nodes of a linked list. The rows and cols variables are the dimensions of the .ppm image that are given in the header of such an image. Assume that these are given. The list_t pointer is a struct pointer that points to the image itself. It is required that I used the structs written in transform.h to create this linked list. Please help, I will upvote correct answer!
transform.h
#include
// Linked list node typedef struct pixel { unsigned char r, g, b; struct pixel * next; }pixel_t;
typedef struct list { pixel_t * head; pixel_t * tail; } list_t;
void getImage( FILE *input, int rows, int cols, list_t * theImage );
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
