/*=========================================================
Owen Dover
C20224779
11/10/2022
CPSC 1011 Section 005
Lab 10B

Function to output initialized pixels to create
scaled image
=========================================================*/

#include"defs.h"

void writePixels(rgb_t *pixels, int max){
	
	for(int b = 0; b < max; b++){
		fprintf(stdout, "%i ", pixels[b].r);
		fprintf(stdout, "%i ", pixels[b].g);
		fprintf(stdout, "%i\n", pixels[b].b);
	}
}

void halfSizeWritePixels(rgb_t *pixels, int height, int width){

	for (int y = 0; y < height; y += 2){
		for (int x = 0; x < width; x += 2){
        	int index = y * width + x;
     		
			fprintf(stdout, "%i ", pixels[index].r);
			fprintf(stdout, "%i ", pixels[index].g);
			fprintf(stdout, "%i\n", pixels[index].b);
   }
}
}