#include "LinePlotWin.h" #include #include #include #include "jed.h" #include LinePlotWin::LinePlotWin() { strcpy(title,"foreach i (COLUMNS) {plot(MAX(i))}"); } LinePlotWin::~LinePlotWin() { } void LinePlotWin::display() { // Make sure a valid dataImage exists if (dataImage.pixels==NULL) return; // Figure step size int step = selectionsize / sqrt(maxPointsToSample); if (step <1 ) step =1; // counting arrays int rhist[4096], ghist[4096], bhist[4096]; for (int i=0;i<4097;++i) { rhist[i]=ghist[i]=bhist[i]=0; } // Sample the image for (int x=xselection-selectionsize; x< xselection+selectionsize; x+=step) { for (int y=yselection-selectionsize; y< yselection+selectionsize; y+=step) { Vector3 rgb; //int rval = rgb.x=dataImage.r(x,y); // rgb.y=dataImage.g(x,y); // rgb.z=dataImage.b(x,y); //cout << "histrgb " << rgb << "\n"; // printf ("rval [%d %d %d] ",x,y,rval); rhist[x] =MAX(rhist[x],dataImage.r(x,y)); ghist[x] =MAX(ghist[x],dataImage.g(x,y)); bhist[x] =MAX(bhist[x],dataImage.b(x,y)); } // Fill in skipped columns for (int xf=0;xf