#include "SubViewWin.h" #include "iflinterface.h" #include "CLO.h" #include "vid.h" #include "VidToImage.h" void main (int argc, char **argv) { CLOchar255 filename("","ffilename","Filename of image to view"); CLOflag video("v","Video stream in"); CLOint maxYIQPoints(30,"ynumPoints","Maximum YIQ points to plot"); CLOint maxHistPoints(3000,"hnumPoints","Maximum Histogram sample points"); CLOint maxLinePoints(3000,"cnumPoints","Maximum ColumnMax sample points"); CLO::parseArgs(argc,argv); SubViewWin mywin; mywin.idle(); GlutWin *foowin=&mywin; foowin->idle(); mywin.yiqwin->maxYIQPointsToPlot=maxYIQPoints; mywin.histwin->maxPointsToSample=maxHistPoints; mywin.linewin->maxPointsToSample=maxLinePoints; if (!(video) && filename[0]=='\0') { // printf ("vals : %s : %d\n",(char *)filename, (int)video); CLO::showusage(argv[0]); puts ("\nYou must either specify -f or -v.\n"); } puts ("\nButton 1 - Changes the selection point"); puts ("Button 2 - Changes the selection size"); if (video) { // Create hidded window to handle idle video updates VidToImageWin *vidwindow=new VidToImageWin; glutHideWindow(); vidwindow->setIdleInterval(50); vidwindow->vidinfo = vidInit(); vidwindow->subviewwin = &mywin; // Get video size long x=640,y=480; vidGetXYSize(vidwindow->vidinfo,&x,&y); // Set up container window for correct size // The pixels will get set elsewhere // These pixels get decontstructed at end of block JDImage tmpImage(x,y); mywin.attachImage(tmpImage); } else // image file { JDImage* myimage= new JDImage; readJDImage(filename,*myimage); mywin.attachImage(*myimage); } glutMainLoop(); }