RefractiveIndex/src/AbstractAnalysis.h

58 lines
1.3 KiB
C
Raw Normal View History

2012-01-24 15:13:07 +01:00
/*
~ author: dviid
~ contact: dviid@labs.ciid.dk
*/
#pragma once
2012-02-11 18:54:46 +01:00
#include "ofMain.h"
#include "ofEvents.h"
2012-01-24 15:13:07 +01:00
#include <string>
#define ANALYSIS_PATH "analysis/"
#define STATE_STOP 0xDEADBEEF
class AbstractAnalysis {
public:
AbstractAnalysis(string name) : _name(name) {;}
virtual ~AbstractAnalysis(){;}
// generic function to set up the camera
2012-02-11 18:54:46 +01:00
virtual void setup(int camWidth, int camHeight){_cam_w = camWidth; _cam_h = camHeight;}
void do_synthesize();
2012-01-24 15:13:07 +01:00
// ofx
virtual void draw() = 0;
2012-02-11 18:54:46 +01:00
protected:
2012-01-24 15:13:07 +01:00
// creates working directory
virtual void create_dir();
// acquire images from camera and display patters on screen
virtual void pattern_acquire() = 0;
2012-01-24 15:13:07 +01:00
// analyses and sythesizes images acquired
virtual void synthesize() = 0;
2012-01-24 15:13:07 +01:00
public:
string _name;
2012-02-11 18:54:46 +01:00
// event notification / callbacks
ofEvent<string> _acquire_cb;
2012-02-11 18:54:46 +01:00
ofEvent<string> _synthesize_cb;
2012-01-24 15:13:07 +01:00
protected:
2012-02-11 18:54:46 +01:00
int _cam_w, _cam_h;
int _state;
string _whole_file_path;
2012-01-24 15:13:07 +01:00
float DELTA_T_SAVE;
int NUM_PHASE;
int NUM_RUN;
int NUM_SAVE_PER_RUN;
2012-01-24 15:13:07 +01:00
friend class AnalysisAdaptor;
};