Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a C program that reads in a ppm image using command line arguments and then stores its pixel contents in a linked list of

Write a C program that reads in a ppm image using command line arguments and then stores its pixel contents in a linked list of pixels. A header file, transform.h, is provided below, where you will use the two provided structs for declaring the linked list and the function prototypes parseHeader() to get the width and height of the ppm image, and getImage(), to send the width, height, and image pointer to get the pixel data and create the linked list.

transform.h

#include #include #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 parseHeader( FILE *input, int *cols, int *rows ); void getImage( FILE *input, int rows, int cols, list_t * theImage );

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

Beginning Microsoft SQL Server 2012 Programming

Authors: Paul Atkinson, Robert Vieira

1st Edition

1118102282, 9781118102282

More Books

Students also viewed these Databases questions