Esempio n. 1
0
void CApp::FrameMove()
{
#ifdef WIN32
	if( pGetInput()->bKeyDown( DIK_ESCAPE ) )
		PostQuitMessage( 0 );
#endif

	if( iGetFrameIdent() % 12 == 0 )
	{
		#ifdef __amigaos4__
		static
		#endif
		char szCaption[256];
		sprintf( szCaption, "Antialiased procedural checkerboard, FPS: %3.1f", fGetFPS() );
		#ifdef WIN32
		SetWindowText( hGetWindowHandle(), szCaption );
		#endif
		#ifdef LINUX_X11
		SDL_SetWindowTitle( pWindow(), szCaption );
		#endif
		#ifdef __amigaos4__
		IIntuition->SetWindowTitles( hGetWindowHandle(), szCaption, szCaption );
		#endif
	}
}
Esempio n. 2
0
  /** Create an instance of a SliceViewerWindow:
   * a separate window containing a SliceViewer widget, to do 2D
   * views of multidimensional workspace, as well as a
   * LineViewer widget, to do 1D lines through the 2D slices.
   *
   * @param wsName :: name of the workspace to show
   * @param label :: label for the window title
   * @return the created SliceViewerWindow *
   */
  MantidQt::SliceViewer::SliceViewerWindow* WidgetFactory::createSliceViewerWindow(const QString& wsName,  const QString& label)
  {
    SliceViewerWindow * window = new SliceViewerWindow(wsName, label);
    QPointer<MantidQt::SliceViewer::SliceViewerWindow> pWindow(window);

    //Save in a list for later use
    m_windows.push_back(pWindow);

    return window;
  }
Esempio n. 3
0
 const WindowPtr_t CreateEglWindow(const boost::int64_t nSurfaceProperties)
 {
     // Create window
     WindowPtr_t pWindow(new TWindow());
     return this->InitChildWindow(pWindow, 
         nSurfaceProperties, "", 
         CWindow::DEFAULT_X,
         CWindow::DEFAULT_Y,
         CWindow::DEFAULT_WIDTH,
         CWindow::DEFAULT_HEIGHT);
 }
Esempio n. 4
0
 const WindowPtr_t CreateEglWindow(const boost::int64_t nSurfaceProperties, 
                                int nX, int nY, int nWidth, int nHeight)
 {
     // Create window
     WindowPtr_t pWindow(new TWindow());
     return this->InitChildWindow(pWindow, 
         nSurfaceProperties, "", 
         nX,
         nY,
         nWidth,
         nHeight);
 }
Esempio n. 5
0
 const WindowPtr_t CreateEglWindow(const boost::int64_t nSurfaceProperties, 
                                const std::string & strTitle)
 {
     // Create window
     WindowPtr pWindow(new TWindow());
     return this->InitChildWindow(pWindow, 
         nSurfaceProperties, strTitle, 
         CWindow::DEFAULT_X,
         CWindow::DEFAULT_Y,
         CWindow::DEFAULT_WIDTH,
         CWindow::DEFAULT_HEIGHT);
 }
Esempio n. 6
0
/*
 *	MakeGrab
 */
static void  MakeGrab(
    XtServerGrabPtr	grab,
    XtServerGrabPtr	*passiveListPtr,
    Boolean		isKeyboard,
    XtPerDisplayInput	pdi,
    XtPerWidgetInput	pwi)
{
    if (!isKeyboard && !pwi->active_handler_added) {
	XtAddEventHandler(grab->widget, ButtonReleaseMask, FALSE,
			  ActiveHandler, (XtPointer)pdi);
	pwi->active_handler_added = TRUE;
    }

    if (isKeyboard) {
	XGrabKey(pDisplay(grab),
		 grab->keybut, grab->modifiers,
		 pWindow(grab), grab->ownerEvents,
		 grab->pointerMode, grab->keyboardMode);
    } else {
	Window confineTo = None;
	Cursor cursor = None;

	if (grab->hasExt) {
	    if (grab->confineToIsWidgetWin)
		confineTo = XtWindow (grab->widget);
	    else
		confineTo = GRABEXT(grab)->confineTo;
	    cursor = GRABEXT(grab)->cursor;
	}
	XGrabButton(pDisplay(grab),
		    grab->keybut, grab->modifiers,
		    pWindow(grab), grab->ownerEvents, grab->eventMask,
		    grab->pointerMode, grab->keyboardMode,
		    confineTo, cursor);
    }

    /* Add the new grab entry to the passive key grab list */
    grab->next = *passiveListPtr;
    *passiveListPtr = grab;
}
Esempio n. 7
0
int main(int argc, char** argv)
{
    uint8_t GameID = INipaFile::CHAOSHEAD;

    if (argc == 2)
    {
        GameID = INipaFile::GameStringToID(argv[1]);
        if (GameID == 0xFF)
        {
            std::cout << "Invalid game specified." << std::endl;
            return 1;
        }
    }

    unique_ptr<CHWindow> pWindow(new CHWindow(GameID));
    pWindow->Run();
}
Esempio n. 8
0
void CApp::FrameMove()
{
#ifdef WIN32
	if( pGetInput()->bKeyDown( DIK_ESCAPE ) )
		PostQuitMessage( 0 );
#endif

	if( iGetFrameIdent() % 12 == 0 )
	{
		#ifdef __amigaos4__
		static
		#endif
		char szCaption[256];
		sprintf( szCaption, "Bubble, FPS: %3.1f", fGetFPS() );
		#ifdef WIN32
		SetWindowText( hGetWindowHandle(), szCaption );
		#endif
		#ifdef LINUX_X11
		SDL_SetWindowTitle( pWindow(), szCaption );
		#endif
		#ifdef __amigaos4__
		IIntuition->SetWindowTitles( hGetWindowHandle(), szCaption, szCaption );
		#endif
	}

	if( pGetInput()->bButtonDown( 0 ) )
	{
		// rotate camera around the bubble
		static float32 fRotX = 0.0f, fRotY = 0.0f;

		int32 iDeltaX, iDeltaY;

		pGetInput()->GetMovement( &iDeltaX, &iDeltaY );
		fRotX += -0.1f * iDeltaX * fGetInvFPS();
		fRotY += 0.1f * iDeltaY * fGetInvFPS();

		const float32 fCamPosX = -100.0f * sinf( fRotX );
		const float32 fCamPosY = -50.0f * sinf( fRotY );
		const float32 fCamPosZ = -100.0f * cosf( fRotX );
		m_pCamera->SetPosition( vector3( fCamPosX, fCamPosY, fCamPosZ ) );
		m_pCamera->SetLookAt( vector3( 0, 0, 0 ), vector3( 0, 1, 0 ) );
		m_pCamera->CalculateView();
	}
}
Esempio n. 9
0
void createViewportHost( std::unique_ptr< IViewportHost >& pViewportHost, IViewport* pViewport )
{
  std::unique_ptr< Window > pWindow( new Window( pViewport, "MeshViewer" ) );
  pWindow->show();
  pViewportHost = std::move( pWindow );
}
Esempio n. 10
0
// Main Program
int main( int nArgs, char **args ) {

  // Read command line parameters
  if ( nArgs < 3 ) {
    std::cout << "Please specify output filename and run time (seconds)." << std::endl;
    return 1;
  }
  std::string outFileName(args[1]);
  int runTime(30);
  { std::stringstream tmp; tmp << std::string(args[2]); tmp >> runTime; }
  std::cout << "LED triggered run for " << runTime << " seconds: " << outFileName << std::endl;

  // Create the ROOT Application (to draw canvases)
  TApplication *theApp = new TApplication("LEDRun",&nArgs,args);
  //gStyle->SetPalette(1);

  // Configure the Argonne Board
  int err(0);
  uint nSamples = 600; //1024; // max = 2046
  uint preTrigSamples = 50;
  err = ConfigArgoBoard_ExtTrig( nSamples, preTrigSamples );
  if ( err != 0 ) {
    std::cout << "Failed to configure ANL Digitizer." << std::endl;
    return err;
  }

  // Get ANL Digitizer configuration info
  uint ANL_nSamples(0); DeviceRead(lbneReg.readout_window[0],&ANL_nSamples);
  uint ANL_preTrigSize(0); DeviceRead(lbneReg.readout_pretrigger[0],&ANL_preTrigSize);
  uint ANL_eventSize = sizeof(Event_Header) + 2*nSamples; // in bytes
  uint m1Size(0); DeviceRead(lbneReg.m1_window[0],&m1Size);
  uint m2Size(0); DeviceRead(lbneReg.m2_window[0],&m2Size);
  uint pWindow(0); DeviceRead(lbneReg.p_window[0],&pWindow);
  uint kWindow(0); DeviceRead(lbneReg.k_window[0],&kWindow);
  uint iWindow(0); DeviceRead(lbneReg.i_window[0],&iWindow);
  uint dWindow(0); DeviceRead(lbneReg.d_window[0],&dWindow);

  // Output File
  TFile *outFile = new TFile(outFileName.c_str(),"RECREATE");
  TDirectory *waveDir = outFile->mkdir("waveforms");
  std::vector<TH1D*> waveformExamples;

  // Set up output ROOT tree for ANL Digitizer
  TTree *ANLTree = new TTree("ANLTree","ANLTree");
  Event_Packet ArPacket; Event ArEvent;
  ANLTree->Branch("channelID",&(ArEvent.channelID),"channelID/s");
  ANLTree->Branch("syncDelay",&(ArEvent.syncDelay),"syncDelay/i");
  ANLTree->Branch("syncCount",&(ArEvent.syncCount),"syncCount/i");
  ANLTree->Branch("timestamp",&(ArEvent.intTimestamp),"timestamp/l");
  ANLTree->Branch("peakSum",&(ArEvent.peakSum),"peakSum/I");
  ANLTree->Branch("peakTime",&(ArEvent.peakTime),"peakTime/C");
  ANLTree->Branch("prerise",&(ArEvent.prerise),"prerise/i");
  ANLTree->Branch("integratedSum",&(ArEvent.integratedSum),"integratedSum/i");
  ANLTree->Branch("baseline",&(ArEvent.baseline),"baseline/s");
  ANLTree->Branch("cfdPoint",&(ArEvent.cfdPoint),"cfdPoint[4]/S");
  ANLTree->Branch("nSamples",&(ArEvent.waveformWords),"nSamples/s");
  std::stringstream waveformDescr; waveformDescr << "waveform[" << nSamples << "]/s";
  ANLTree->Branch("waveform",&(ArEvent.waveform),waveformDescr.str().c_str());

  // Set up configuration ROOT tree
  TTree *configTree = new TTree("configTree","configTree");
  configTree->Branch("runTime",&runTime,"runTime/I");
  configTree->Branch("ANL_nSamples",&ANL_nSamples,"ANL_nSamples/i");
  configTree->Branch("ANL_preTrigSize",&ANL_preTrigSize,"ANL_preTrigSize/i");
  configTree->Branch("m1Size",&m1Size,"m1Size/i");
  configTree->Branch("m2Size",&m2Size,"m2Size/i");
  configTree->Branch("pWindow",&pWindow,"pWindow/i");
  configTree->Branch("kWindow",&kWindow,"kWindow/i");
  configTree->Branch("iWindow",&iWindow,"iWindow/i");
  configTree->Branch("dWindow",&dWindow,"dWindow/i");
  configTree->Fill();
  configTree->Write();

  // Monitoring histograms
  TH1D *ANL_pulseAmp[32];
  for ( int chan = 0; chan < 12; ++chan ) {
    std::stringstream histName; histName << "ANL_pulseAmp_CH" << chan;
    std::stringstream histTitle; histTitle << "Pulse Amplitudes, ANL Channel " << chan << ";ADC Counts";
    ANL_pulseAmp[chan] = new TH1D(histName.str().c_str(),histTitle.str().c_str(),3000,0,3000);
  }    

  std::cout << "Starting acquisition." << std::endl;
  // Enable boards
  err = DeviceTimeout(500);
  err = DeviceStart();

  // Loop for specified time
  int totArEvts(0);
  time_t tStart(0), tEnd(0);
  time(&tStart); time(&tEnd);
  while ( tEnd - tStart < runTime ) {

    /*** ANL Digitizer Readout ***/
    uint dataSize; err = DeviceQueueStatus(&dataSize); // How many full events have been collected?
    if ( err != 0 ) { std::cout << "Failed device queue status check." << std::endl; break; }
    uint ANL_nEvts = uint(dataSize) / ANL_eventSize;
    //if ( ANL_nEvts > 0 ) std::cout << "Received " << ANL_nEvts << " events on the Argonne Digitizer (" << dataSize << " bytes)." << std::endl;
    for ( uint evt = 0; evt < ANL_nEvts; ++evt ) {
      totArEvts++;
      uint dataReceived = 0;
      err = DeviceReceive(&ArPacket,&dataReceived);
      if ( err != 0 ) { std::cout << "Failed device receive." << std::endl; break; }
      err = LBNE_EventUnpack(&ArPacket,&ArEvent);
      if ( err != 0 ) {	std::cout << "Failed to unpack data." << std::endl; break; }
      ANLTree->Fill();
      ANL_pulseAmp[ArEvent.channelID]->Fill(ArEvent.prerise/double(kWindow)-ArEvent.peakSum/double(m1Size));
      /*
      std::stringstream waveHistName; waveHistName << "waveform_" << totArEvts;
      TH1D *hist = new TH1D(waveHistName.str().c_str(),waveHistName.str().c_str(),nSamples,0,nSamples);
      for ( uint samp = 0; samp < nSamples; ++samp ) {
	hist->SetBinContent(samp+1,ArEvent.waveform[samp] & 0x3FFF); // 0x3FFF drops time marks on waveform, not necessary in next firmware upgrade
      }
      waveformExamples.push_back(hist);
      */
    }

    //std::cout << tEnd-tStart << std::endl;
    time(&tEnd);
  }

  //// Finalize

  // Finalize Argonne Digitizer
  err = DeviceStopReset();
  if ( err != 0 ) {
    std::cout << "Failed to stop and reset board 0. ErrorCode " << err << std::endl;
    return 1;
  }
  err = DeviceDisconnect(commUSB);

  // Write and close output file
  ANLTree->Write();

  for ( int chan = 0; chan < 12; ++chan ) ANL_pulseAmp[chan]->Write();

  waveDir->cd();
  for ( uint i = 0; i < waveformExamples.size(); ++i ) {
    waveformExamples[i]->Write();
  }
  outFile->cd();

  outFile->Close();

  // Done!
  std::cout << "Done!  Collected " << totArEvts/12 << " events" << std::endl;

  return 0;
}
Esempio n. 11
0
File: main.cpp Progetto: caomw/litiv
void AnalyzeSet_GLSL(std::shared_ptr<DatasetUtils::Segm::Image::Set> pCurrSet) {
    srand(0); // for now, assures that two consecutive runs on the same data return the same results
    //srand((unsigned int)time(NULL));
    size_t nCurrImageIdx = 0;
    size_t nNextImageIdx = nCurrImageIdx+1;
    bool bGPUContextInitialized = false;
    try {
        glfwSetErrorCallback(GLFWErrorCallback);
        CV_Assert(pCurrSet.get() && pCurrSet->GetTotalImageCount()>0);
        if(pCurrSet->m_pEvaluator==nullptr && EVALUATE_OUTPUT)
            throw std::runtime_error(cv::format("Missing evaluation impl for image segmentation dataset '%s'",g_pDatasetInfo->m_sDatasetName.c_str()));
        const std::string sCurrSetName = pCurrSet->m_sName.size()>12?pCurrSet->m_sName.substr(0,12):pCurrSet->m_sName;
        const size_t nImageCount = pCurrSet->GetTotalImageCount();
        cv::Mat oCurrInputImage = pCurrSet->GetInputFromIndex(nCurrImageIdx).clone();
        CV_Assert(!oCurrInputImage.empty());
        CV_Assert(oCurrInputImage.isContinuous());
#if NEED_GT_MASK
        cv::Mat oCurrGTMask = pCurrSet->GetGTFromIndex(nCurrImageIdx).clone();
        CV_Assert(!oCurrGTMask.empty() && oCurrGTMask.isContinuous());
#endif //NEED_GT_MASK
#if DISPLAY_OUTPUT
        cv::Mat oLastInputImage = oCurrInputImage.clone();
#endif //DISPLAY_OUTPUT
        cv::Mat oNextInputImage = pCurrSet->GetInputFromIndex(nNextImageIdx);
#if NEED_GT_MASK
#if NEED_LAST_GT_MASK
        cv::Mat oLastGTMask = oCurrGTMask.clone();
#endif // NEED_LAST_GT_MASK
        cv::Mat oNextGTMask = pCurrSet->GetGTFromIndex(nNextImageIdx);
#endif //NEED_GT_MASK
#if NEED_EDGES_MASK
        cv::Mat oLastEdgeMask(oCurrInputImage.size(),CV_8UC1,cv::Scalar_<uchar>(0));
#endif //NEED_EDGES_MASK
        glAssert(oCurrInputImage.channels()==1 || oCurrInputImage.channels()==4);
        cv::Size oWindowSize = pCurrSet->GetMaxImageSize();
        // note: never construct GL classes before context initialization
        if(glfwInit()==GL_FALSE)
            glError("Failed to init GLFW");
        bGPUContextInitialized = true;
        glfwWindowHint(GLFW_OPENGL_PROFILE,GLFW_OPENGL_CORE_PROFILE);
        glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR,TARGET_GL_VER_MAJOR);
        glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR,TARGET_GL_VER_MINOR);
        glfwWindowHint(GLFW_RESIZABLE,GL_FALSE);
#if !DISPLAY_OUTPUT
        glfwWindowHint(GLFW_VISIBLE,GL_FALSE);
#endif //!DISPLAY_OUTPUT
        std::unique_ptr<GLFWwindow,void(*)(GLFWwindow*)> pWindow(glfwCreateWindow(oWindowSize.width,oWindowSize.height,(pCurrSet->m_sRelativePath+" [GPU]").c_str(),nullptr,nullptr),glfwDestroyWindow);
        if(!pWindow)
            glError("Failed to create window via GLFW");
        glfwMakeContextCurrent(pWindow.get());
        glewInitErrorCheck;
#if USE_CANNY
#error "Missing glsl impl." // ... @@@@@
        std::shared_ptr<BackgroundSubtractorLOBSTER_GLSL> pAlgo(new BackgroundSubtractorLOBSTER_GLSL());
#elif USE_LBSP
#error "Missing glsl impl." // ... @@@@@
        std::shared_ptr<BackgroundSubtractorSuBSENSE_GLSL> pAlgo(new BackgroundSubtractorSuBSENSE_GLSL());
#endif //USE_...
#if DISPLAY_OUTPUT
        bool bContinuousUpdates = false;
        std::string sDisplayName = pCurrSet->m_sRelativePath;
        cv::namedWindow(sDisplayName);
#endif //DISPLAY_OUTPUT
        std::shared_ptr<GLImageProcAlgo> pGLSLAlgo = std::dynamic_pointer_cast<GLImageProcAlgo>(pAlgo);
        if(pGLSLAlgo==nullptr)
            glError("Segmentation algorithm has no GLImageProcAlgo interface");
        pGLSLAlgo->setOutputFetching(NEED_EDGES_MASK);
        if(!pGLSLAlgo->getIsUsingDisplay() && DISPLAY_OUTPUT) // @@@@ determine in advance to hint window to hide? or just always hide, and show when needed?
            glfwHideWindow(pWindow.get());
#if USE_GLSL_EVALUATION
        std::shared_ptr<DatasetUtils::EvaluatorBase::GLEvaluatorBase> pGLSLAlgoEvaluator;
        if(pCurrSet->m_pEvaluator!=nullptr)
            pGLSLAlgoEvaluator = std::dynamic_pointer_cast<DatasetUtils::EvaluatorBase::GLEvaluatorBase>(pCurrSet->m_pEvaluator->CreateGLEvaluator(pGLSLAlgo,nImageCount));
        if(pGLSLAlgoEvaluator==nullptr)
            glError("Segmentation evaluation algorithm has no GLSegmEvaluator interface");
        pGLSLAlgoEvaluator->initialize(oCurrGTMask,cv::Mat(oCurrInputImage.size(),CV_8UC1,cv::Scalar_<uchar>(255)));
        oWindowSize.width *= pGLSLAlgoEvaluator->m_nSxSDisplayCount;
#else //!USE_GLSL_EVALUATION
        oWindowSize.width *= pGLSLAlgo->m_nSxSDisplayCount;
#endif //!USE_GLSL_EVALUATION
        glfwSetWindowSize(pWindow.get(),oWindowSize.width,oWindowSize.height);
        glViewport(0,0,oWindowSize.width,oWindowSize.height);
        TIMER_TIC(MainLoop);
        while(nNextImageIdx<=nImageCount) {
            //if(!((nCurrImageIdx+1)%100))
                std::cout << "\t\t" << std::setfill(' ') << std::setw(12) << sCurrSetName << " @ F:" << std::setfill('0') << std::setw(PlatformUtils::decimal_integer_digit_count((int)nImageCount)) << nCurrImageIdx+1 << "/" << nImageCount << "   [GPU]" << std::endl;
            TIMER_INTERNAL_TIC(OverallLoop);
            TIMER_INTERNAL_TIC(PipelineUpdate);
            pAlgo->apply_async(oNextInputImage);
            TIMER_INTERNAL_TOC(PipelineUpdate);
#if USE_GLSL_EVALUATION
            pGLSLAlgoEvaluator->apply_async(oNextGTMask);
#endif //USE_GLSL_EVALUATION
            TIMER_INTERNAL_TIC(ImageQuery);
#if DISPLAY_OUTPUT
            oCurrInputImage.copyTo(oLastInputImage);
            oNextInputImage.copyTo(oCurrInputImage);
#endif //DISPLAY_OUTPUT
            if(++nNextImageIdx<nImageCount)
                oNextInputImage = pCurrSet->GetInputFromIndex(nNextImageIdx);
#if NEED_GT_MASK
#if NEED_LAST_GT_MASK
            oCurrGTMask.copyTo(oLastGTMask);
            oNextGTMask.copyTo(oCurrGTMask);
#endif //NEED_LAST_GT_MASK
            if(nNextImageIdx<nImageCount)
                oNextGTMask = pCurrSet->GetGTFromIndex(nNextImageIdx);
#endif //NEED_GT_MASK
            TIMER_INTERNAL_TOC(ImageQuery);
            glErrorCheck;
            if(glfwWindowShouldClose(pWindow.get()))
                break;
            glfwPollEvents();
#if DISPLAY_OUTPUT
            if(glfwGetKey(pWindow.get(),GLFW_KEY_ESCAPE) || glfwGetKey(pWindow.get(),GLFW_KEY_Q))
                break;
            glfwSwapBuffers(pWindow.get());
            glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
#endif //DISPLAY_OUTPUT
#if NEED_EDGES_MASK
            pAlgo->getLatestEdgeMask(oLastEdgeMask);
#endif //NEED_EDGES_MASK
#if DISPLAY_OUTPUT
            @@@ update via copy of non-parallel impl
            cv::Mat oDisplayImage = DatasetUtils::GetDisplayImage(oLastInputImage,oLastEdgeMask,pCurrSet->m_pEvaluator?pCurrSet->m_pEvaluator->GetColoredSegmMaskFromResult(oLastEdgeMask,oLastGTMask,cv::Mat()):oLastEdgeMask,nCurrImageIdx);
            cv::Mat oDisplayImageResized;
            if(oDisplayImage.cols>1920 || oDisplayImage.rows>1080)
                cv::resize(oDisplayImage,oDisplayImageResized,cv::Size(oDisplayImage.cols/2,oDisplayImage.rows/2));
            else
                oDisplayImageResized = oDisplayImage;
            cv::imshow(sDisplayName,oDisplayImageResized);
            int nKeyPressed;
            if(bContinuousUpdates)
                nKeyPressed = cv::waitKey(1);
            else
                nKeyPressed = cv::waitKey(0);
            if(nKeyPressed!=-1)
                nKeyPressed %= (UCHAR_MAX+1); // fixes return val bug in some opencv versions
            if(nKeyPressed==' ')
                bContinuousUpdates = !bContinuousUpdates;
            else if(nKeyPressed==(int)'q')
                break;
#endif //DISPLAY_OUTPUT
#if WRITE_IMG_OUTPUT
            pCurrSet->WriteResult(nCurrImageIdx,oLastEdgeMask);
#endif //WRITE_IMG_OUTPUT
#if (EVALUATE_OUTPUT && (!USE_GLSL_EVALUATION || VALIDATE_GPU_EVALUATION))
            if(pCurrSet->m_pEvaluator)
                pCurrSet->m_pEvaluator->AccumulateMetricsFromResult(oCurrEdgeMask,oCurrGTMask,cv::Mat());
#endif //(EVALUATE_OUTPUT && (!USE_GLSL_EVALUATION || VALIDATE_GPU_EVALUATION))
            TIMER_INTERNAL_TOC(OverallLoop);
#if DISPLAY_TIMERS
            std::cout << "ImageQuery=" << TIMER_INTERNAL_ELAPSED_MS(ImageQuery) << "ms,  "
            << "PipelineUpdate=" << TIMER_INTERNAL_ELAPSED_MS(PipelineUpdate) << "ms,  "
            << "OverallLoop=" << TIMER_INTERNAL_ELAPSED_MS(OverallLoop) << "ms" << std::endl;
#endif //ENABLE_INTERNAL_TIMERS
            ++nCurrImageIdx;
        }
        TIMER_TOC(MainLoop);
        const double dTimeElapsed = TIMER_ELAPSED_MS(MainLoop)/1000;
        const double dAvgFPS = (double)nCurrImageIdx/dTimeElapsed;
        std::cout << "\t\t" << std::setfill(' ') << std::setw(12) << sCurrSetName << " @ end, " << int(dTimeElapsed) << " sec in-thread (" << (int)floor(dAvgFPS+0.5) << " FPS)" << std::endl;
#if EVALUATE_OUTPUT
        if(pCurrSet->m_pEvaluator) {
#if USE_GLSL_EVALUATION
#if VALIDATE_GPU_EVALUATION
            printf("cpu eval:\n\tnTP=%" PRIu64 ", nTN=%" PRIu64 ", nFP=%" PRIu64 ", nFN=%" PRIu64 ", nSE=%" PRIu64 ", tot=%" PRIu64 "\n",pCurrSet->m_pEvaluator->m_oBasicMetrics.nTP,pCurrSet->m_pEvaluator->m_oBasicMetrics.nTN,pCurrSet->m_pEvaluator->m_oBasicMetrics.nFP,pCurrSet->m_pEvaluator->m_oBasicMetrics.nFN,pCurrSet->m_pEvaluator->m_oBasicMetrics.nSE,pCurrSet->m_pEvaluator->m_oBasicMetrics.nTP+pCurrSet->m_pEvaluator->m_oBasicMetrics.nTN+pCurrSet->m_pEvaluator->m_oBasicMetrics.nFP+pCurrSet->m_pEvaluator->m_oBasicMetrics.nFN);
#endif //VALIDATE_USE_GLSL_EVALUATION
            pCurrSet->m_pEvaluator->FetchGLEvaluationResults(pGLSLAlgoEvaluator);
#if VALIDATE_GPU_EVALUATION
            printf("gpu eval:\n\tnTP=%" PRIu64 ", nTN=%" PRIu64 ", nFP=%" PRIu64 ", nFN=%" PRIu64 ", nSE=%" PRIu64 ", tot=%" PRIu64 "\n",pCurrSet->m_pEvaluator->m_oBasicMetrics.nTP,pCurrSet->m_pEvaluator->m_oBasicMetrics.nTN,pCurrSet->m_pEvaluator->m_oBasicMetrics.nFP,pCurrSet->m_pEvaluator->m_oBasicMetrics.nFN,pCurrSet->m_pEvaluator->m_oBasicMetrics.nSE,pCurrSet->m_pEvaluator->m_oBasicMetrics.nTP+pCurrSet->m_pEvaluator->m_oBasicMetrics.nTN+pCurrSet->m_pEvaluator->m_oBasicMetrics.nFP+pCurrSet->m_pEvaluator->m_oBasicMetrics.nFN);
#endif //VALIDATE_USE_GLSL_EVALUATION
#endif //USE_GLSL_EVALUATION
            pCurrSet->m_pEvaluator->dTimeElapsed_sec = dTimeElapsed;
        }
#endif //EVALUATE_OUTPUT
#if DISPLAY_OUTPUT
        cv::destroyWindow(sDisplayName);
#endif //DISPLAY_OUTPUT
    }
    catch(const CxxUtils::Exception& e) {
        std::cout << "\nAnalyzeSequence caught Exception:\n" << e.what();
        if(!g_sLatestGLFWErrorMessage.empty()) {
            std::cout << " (" << g_sLatestGLFWErrorMessage << ")" << "\n" << std::endl;
            g_sLatestGLFWErrorMessage = std::string();
        }
        else
            std::cout << "\n" << std::endl;
    }
    catch(const cv::Exception& e) {std::cout << "\nAnalyzeSequence caught cv::Exception:\n" << e.what() << "\n" << std::endl;}
    catch(const std::exception& e) {std::cout << "\nAnalyzeSequence caught std::exception:\n" << e.what() << "\n" << std::endl;}
    catch(...) {std::cout << "\nAnalyzeSequence caught unhandled exception\n" << std::endl;}
    if(bGPUContextInitialized)
        glfwTerminate();
    if(pCurrSet.get()) {
#if DATASET_PRECACHING
        pCurrSet->StopPrecaching();
#endif //DATASET_PRECACHING
        pCurrSet->m_nImagesProcessed.set_value(nCurrImageIdx);
    }
}