// CSE 373 // University of Washington // Skeleton program for Homework 5 // May 2000 #include #include #include "bmp.h" // declarations for disjoint set structure const int djsize = 256; signed int dj[djsize]; // useful function for some sorting routines void swap(int *a, int *b) { int temp = *a; *a = *b; *b = temp; } void main(int argc, char **argv) { int neighbors = 4; if (argc > 1 && argv[1][0] == '8') { printf("Using 8-neighbors instead of default.\n"); neighbors = 8; } // read in bitmap data FILE *f; f = fopen("out.bmp", "wb"); if (!f) { printf("Couldn't open output file!\n"); exit(1); } RGBQUAD palette[palsize]; unsigned char pix[rows][cols]; readbmp(f, palette, pix); // TODO: scan the pixels here // Your code should only modify the data in the pix array writebmp(f, pix); fflush(f); fclose(f); // TODO: print out sorted class info }