/*
Jeff Branyon
November 13, 2022
Section 4
Lab 10A
This program reads in the pixels of an image, then prints that same image back
out to a new file. 
This file contains the main function, which calls all of the other functions.
*/

#include "defs.h"

int main (void){

// Function call for getting the header information and storing it inside a variable. 
	header_t headerInfo = getHeader(); 

// Malloc is used to reserve memory in heap to be able to store the image data. 
	pixel_t *image = malloc(headerInfo.width * headerInfo.height * sizeof(pixel_t));

// Function call for filling the new image array with the old values. 
	fillImageArray(image, headerInfo.width, headerInfo.height);

// Function call to write the header elements.
	writeHeader(headerInfo);	

// Function call for writing the pixels to stdout, thus making the image
	writePixels(image, headerInfo.width, headerInfo.height);

	return 0;
}


