-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathofxARTGenericTracker.h
55 lines (43 loc) · 1.44 KB
/
ofxARTGenericTracker.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//
// ofxARTGenericTracker.h
//
// Created by nausea on 12/23/15.
//
//
#pragma once
#include "ofMain.h"
#include "ofxOpenCv.h"
#include "ofxARTUtils.h"
#include <AR/param.h>
namespace ofxArtool5 {
class GenericTracker{
public:
virtual void nullArtPointers()=0;
virtual void cleanup()=0;
virtual void update(ARUint8 * arPix)=0;
virtual void update(ofPixels & pix){
cvColorFrame.setFromPixels(pix);
ARUint8 * arImg = toAR(cvColorFrame);
update(arImg);
}
template<class T> void update(ofBaseHasPixels_<T> &ofImg){update(ofImg.getPixels());}
virtual void drawDebug()=0;
//GETTERS
virtual bool isFound()=0;
inline float getScaleFactor(){return viewScaleFactor;}
virtual inline float getMinDistance(){return viewDistanceMin;}
virtual inline float getMaxDistance(){return viewDistanceMax;}
//SETTERS
inline void setScaleFactor(float f){viewScaleFactor=f;}
virtual inline void setMinDistance(float f){viewDistanceMin=f;}
virtual inline void setMaxDistance(float f){viewDistanceMax=f;}
protected:
ARParamLT * gCparamLT;
ofxCvColorImage cvColorFrame;
ofVec2f camSize;
ofVec2f viewportSize;
float viewScaleFactor;
float viewDistanceMin;
float viewDistanceMax;
};
}