/*
Karinna Thompson
Nov 13, 2022
CpSc 1010
Sec 002
Lab 10
Reading and Writing image files using readirection

*/

#include "defs.h"
#include <stdlib.h>
//a source file for final compilation
void writePixels(pixel picture[],int width,int height){
	int i;
	for (i = 0; i < width*height; i++) {
		fprintf(stdout, "%i %i %i\n", picture[i].r, picture[i].g, picture[i].b);
	}
}

void halfSizeWritePixels(pixel picture[], int width, int height){
	for (int i = 0; i < width*height; i+=2) {
		fprintf(stdout, "%i %i %i\n", picture[i].r, picture[i].g, picture[i].b);

		if((i / width)% 2 != 0){
			i+=width;
		}
	}
}

