summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2013-09-14 21:41:10 +0200
committerStanislaw Halik <sthalik@misaki.pl>2013-09-14 21:41:10 +0200
commitc34777d460d41a485f2e2900bd2954490b82ac1b (patch)
treed1e8ba9f111cb3c3cf40256466b0861c3bb9d61e
parenteb3fac6ac66f85db0778cd47f01ba6a2854c9ab8 (diff)
filter API: Remove implementation detail. Sprinkle const
-rw-r--r--facetracknoir/tracker.cpp3
-rw-r--r--ftnoir_filter_accela/ftnoir_filter_accela.cpp5
-rw-r--r--ftnoir_filter_accela/ftnoir_filter_accela.h3
-rw-r--r--ftnoir_filter_base/ftnoir_filter_base.h2
-rw-r--r--ftnoir_filter_ewma2/ftnoir_filter_ewma2.cpp5
-rw-r--r--ftnoir_filter_ewma2/ftnoir_filter_ewma2.h7
6 files changed, 11 insertions, 14 deletions
diff --git a/facetracknoir/tracker.cpp b/facetracknoir/tracker.cpp
index cdf28d40..5acf7dea 100644
--- a/facetracknoir/tracker.cpp
+++ b/facetracknoir/tracker.cpp
@@ -56,7 +56,6 @@ static void get_curve(double pos, double& out, THeadPoseDOF& axis) {
/** QThread run method @override **/
void Tracker::run() {
- T6DOF current_camera; // Used for filtering
T6DOF target_camera;
T6DOF new_camera;
@@ -135,7 +134,7 @@ void Tracker::run() {
if (Libraries->pFilter) {
for (int i = 0; i < 6; i++)
last_post_filter[i] = gameoutput_camera.axes[i];
- Libraries->pFilter->FilterHeadPoseData(current_camera.axes, target_camera.axes, new_camera.axes, last_post_filter);
+ Libraries->pFilter->FilterHeadPoseData(target_camera.axes, new_camera.axes, last_post_filter);
}
else {
new_camera = target_camera;
diff --git a/ftnoir_filter_accela/ftnoir_filter_accela.cpp b/ftnoir_filter_accela/ftnoir_filter_accela.cpp
index ee7289a4..e0b80034 100644
--- a/ftnoir_filter_accela/ftnoir_filter_accela.cpp
+++ b/ftnoir_filter_accela/ftnoir_filter_accela.cpp
@@ -51,10 +51,9 @@ static double parabola(const double a, const double x)
return a1 * x * x;
}
-void FTNoIR_Filter::FilterHeadPoseData(double *current_camera_position,
- double *target_camera_position,
+void FTNoIR_Filter::FilterHeadPoseData(const double *target_camera_position,
double *new_camera_position,
- double *last_post_filter_values)
+ const double *last_post_filter_values)
{
if (first_run)
{
diff --git a/ftnoir_filter_accela/ftnoir_filter_accela.h b/ftnoir_filter_accela/ftnoir_filter_accela.h
index 333ab08d..55e413aa 100644
--- a/ftnoir_filter_accela/ftnoir_filter_accela.h
+++ b/ftnoir_filter_accela/ftnoir_filter_accela.h
@@ -46,7 +46,7 @@ class FTNOIR_FILTER_BASE_EXPORT FTNoIR_Filter : public IFilter
public:
FTNoIR_Filter();
~FTNoIR_Filter();
- void FilterHeadPoseData(double *current_camera_position, double *target_camera_position, double *new_camera_position, double *last_post_filter_values);
+ void FilterHeadPoseData(const double *target_camera_position, double *new_camera_position, const double *last_post_filter_values);
void Initialize() {
first_run = true;
}
@@ -56,6 +56,7 @@ private:
void loadSettings();
bool first_run;
double rotation_alpha, translation_alpha, zoom_factor;
+ double current_camera_position[6];
};
//*******************************************************************************************************
diff --git a/ftnoir_filter_base/ftnoir_filter_base.h b/ftnoir_filter_base/ftnoir_filter_base.h
index 49454a7e..b8b5017d 100644
--- a/ftnoir_filter_base/ftnoir_filter_base.h
+++ b/ftnoir_filter_base/ftnoir_filter_base.h
@@ -26,7 +26,7 @@
struct IFilter
{
virtual ~IFilter() {}
- virtual void FilterHeadPoseData(double *current_camera_position, double *target_camera_position, double *new_camera_position, double *last_post_filter) = 0;
+ virtual void FilterHeadPoseData(const double *target_camera_position, double *new_camera_position, const double *last_post_filter) = 0;
virtual void Initialize() = 0;
};
diff --git a/ftnoir_filter_ewma2/ftnoir_filter_ewma2.cpp b/ftnoir_filter_ewma2/ftnoir_filter_ewma2.cpp
index bb9fd4c9..6904dd92 100644
--- a/ftnoir_filter_ewma2/ftnoir_filter_ewma2.cpp
+++ b/ftnoir_filter_ewma2/ftnoir_filter_ewma2.cpp
@@ -79,10 +79,9 @@ void FTNoIR_Filter::loadSettings() {
iniFile.endGroup ();
}
-void FTNoIR_Filter::FilterHeadPoseData(double *current_camera_position,
- double *target_camera_position,
+void FTNoIR_Filter::FilterHeadPoseData(const double *target_camera_position,
double *new_camera_position,
- double *last_post_filter)
+ const double *last_post_filter)
{
double delta;
double new_alpha;
diff --git a/ftnoir_filter_ewma2/ftnoir_filter_ewma2.h b/ftnoir_filter_ewma2/ftnoir_filter_ewma2.h
index 91f32816..4f9cdba3 100644
--- a/ftnoir_filter_ewma2/ftnoir_filter_ewma2.h
+++ b/ftnoir_filter_ewma2/ftnoir_filter_ewma2.h
@@ -44,10 +44,9 @@ public:
~FTNoIR_Filter();
void Initialize() {}
- void FilterHeadPoseData(double *current_camera_position,
- double *target_camera_position,
+ void FilterHeadPoseData(const double *target_camera_position,
double *new_camera_position,
- double *last_post_filter);
+ const double *last_post_filter);
void receiveSettings(double smin, double smax, double sexpt);
private:
@@ -61,7 +60,7 @@ private:
double kMinSmoothing;
double kMaxSmoothing;
double kSmoothingScaleCurve;
-
+ double current_camera_position[6];
QMutex mutex;
};