#include using namespace std; const int SIDE=500; struct rgbtriple { unsigned char b; unsigned char g; unsigned char r; }; int rgbToInt(rgbtriple t); rgbtriple intToRgb(int v); int readBMPheader(FILE *fp, int *pwidth, int *pheight); void writeBMPheader(FILE *fp, int width, int height); int readrgbtriple(FILE *fp,struct rgbtriple *pt); void writeRgbTriple(FILE *fp,rgbtriple t); void reorderBytes(char * data,int n); int readBMPFile(char fileName[],rgbtriple image[SIDE][SIDE], int *pwidth, int *pht); void writeBMPFile(char fileName[],int width,int height,rgbtriple image[SIDE][SIDE]); void processImage(rgbtriple image[SIDE][SIDE],int width,int height); void printTriple(rgbtriple t); int main () { rgbtriple ourimage[SIDE][SIDE]; int width,ht; char fileName[40]; char outFileName[40]; cout<<"what input file? "; cin>>fileName; cout<<"what output file? "; cin>>outFileName; if (!readBMPFile(fileName, ourimage, &width, &ht)) { cout<<"Read failed for "<SIDE)||(*pheight>SIDE)) { cout<<"Image is too big."<g, g->r, //and r->b // unsigned char tmp_b, tmp_g, //tmp_r; // for (int y=0;y