/*
Karinna Thompson
Nov 13, 2022
CpSc 1011
Sec 002
Lab 10
Reading and Writing image files using redirection

*/
#include "defs.h"
#include <stdlib.h>
//a source file for compilation
int main (void){
	header dimensions = getHeader();
	header halfHeader = dimensions;
	halfHeader.width = dimensions.width/2;
	halfHeader.height = dimensions.height/2;

	writeHeader(halfHeader);
	int width = dimensions.width, height = dimensions.height;
	const int arraySize = dimensions.width*dimensions.height;
	pixel *picture = (pixel *) malloc(arraySize * sizeof(int));

	fillImageArray(picture,width,height);
	
	halfSizeWritePixels(picture, width, height);

	return 0;
}

