/*
Sloane McNelly
11/13/22
CPSC 1011
Section 5
Lab 10
Read in an Image & Modify the Image & Write it Back Out
*/

#include "defs.h"

void writePixels(ppmPixel pixArray[], int theWidth, int theHeight) {
     int k;
     for (k=0; k<theWidth*theHeight; k++) {
      fprintf(stdout, "%d %d %d\n", pixArray[k].r, pixArray[k].g, pixArray[k].b);
      }
}

void halfSizeWritePixels(ppmPixel pixArray[], int theWidth, int theHeight) {
    int k, x, y;
    for (x=0; x<2*theWidth; x++) {
     for (y=0; y<2*theHeight; y++) {
      k = (y * theWidth) + x;
      if (k%4 == 0) {
        fprintf(stdout, "%d %d %d\n", pixArray[k].r, pixArray[k].g, pixArray[k].b);
        }
     }
  }
}

