FLTK logo

Re: Program becomes very slow after some time running

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.opengl  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: Program becomes very slow after some time running yin Jan 15, 2012  
 
//OBPM_UI.h

#ifndef OBPM_UI_h
#define OBPM_UI_h

#include <FL/Fl.H>
#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Group.H>
#include <FL/Fl_Value_Slider.H>
#include <FL/Fl_Box.H>
#include <FL/Fl_Text_Display.H>
#include <FL/Fl_Button.H>
#include <FL/Fl_Light_Button.H>
#include <FL/Fl_Widget.H>
#include <FL/Fl_Ask.H>
#include <FL/Fl_Native_File_Chooser.h>

#include<OpenCV/cv.h>
#include<OpenCV/highgui.h>

#include "VideoGLWin.h"

/**
   The User Interface for OBPM
*/
class OBPMViewUI {
public:
  OBPMViewUI();
  ~OBPMViewUI() { };
  
  // Critical section to protect access to the processed image
  CCriticalSection m_csData;

  
  int SRC_ID;
  Fl_Double_Window *mainWindow;

  Fl_Group *VideoView;
  Fl_Value_Slider *zoom;
  Fl_Value_Slider *ypan;
  Fl_Value_Slider *xpan;
  VideoGlWin *glView;
  
  Fl_Button *zoom_fit;
  Fl_Button *origin_fit;

  Fl_Group *grpCommandBtn;
  Fl_Light_Button *btnFileSrc;

public:
    void VideoFileConnect(CvCapture *);
	CvCapture* m_pVideoFileCapture;
	IplImage* m_rawVideoframe;

public:
	Fl_Thread thread_capture_video_file;
	bool m_continueCaptureThread;
	void* m_heventCaptureThreadDone;
	static void* ThreadCaptureVideoFile(void *pparam);
	unsigned int DoCaptureLoop();

public:
	bool bImageProcessing;
public:
	void start(int argc,char**argv);

private:	
  static void mainWindow_callback(Fl_Widget* widget,void*);

         void cb_FileSrc_i(Fl_Light_Button*, void*);
  static void cb_FileSrc(Fl_Light_Button*, void*);

         void cb_zoom_i(Fl_Value_Slider*, void*);
  static void cb_zoom(Fl_Value_Slider*, void*);

         void cb_xpan_i(Fl_Value_Slider*, void*);
  static void cb_xpan(Fl_Value_Slider*, void*);

  void cb_ypan_i(Fl_Value_Slider*, void*);
  static void cb_ypan(Fl_Value_Slider*, void*);

  void cb_zoom_fit_i(Fl_Button*, void*);
  static void cb_zoom_fit(Fl_Button*, void*);

  void cb_origin_fit_i(Fl_Button*, void*);
  static void cb_origin_fit(Fl_Button*, void*);
  
};


#endif
Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.