#include main() { int done = 0,i; char ch; int harray[256]; ungetc(0,stdin); do { VIS$LINEARIZE_LUT(i,0); VIS$FREEZE(); HISTOGRAM(0,0,640,480,1,harray,2); VIS$VIEW(); delay(); /* set_raw_mode(); scanf("%s",&ch); set_normal_mode(); if (ch==0) ungetc(done,stdin); else done = 1; */ }while (done == 0); } HISTOGRAM(x1,y1,x2,y2,equalize,harray, color) int x1,y1,x2,y2, equalize, *harray, color; { int i,x; int offset,base,largest,grpfact,barwidth,area,X1,X2; int values[641]; float scale,eos; /* CONSTANTS */ grpfact=4; barwidth=8; base= 455 /* was 475 RWW */ ; area=(y2-y1)*(x2-x1); eos=256/grpfact-1; /* End Of Scale */ /* INITIALIZE ARRAYS */ for (i=0;i<=255;i++) { harray[i] = 0; } /* FILL HARRAY WITH READ_HORIZONTAL_LINE this is the histogram */ for (i=y1;i<=y2;i++) { rhline(x1,i,x2-x1,values); for (x=0;x