From 8303597a865400a363ae574ccde819302495f498 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 2 Apr 2013 18:41:01 +0200 Subject: Just put everything new in. Conflict resolution will be later --- ftnoir_filter_ewma2/ftnoir_ewma_filtercontrols.ui | 587 +++++++++++++++++++++ ftnoir_filter_ewma2/ftnoir_filter_ewma2.cpp | 19 +- ftnoir_filter_ewma2/ftnoir_filter_ewma2.h | 18 +- ftnoir_filter_ewma2/ftnoir_filter_ewma2_dialog.cpp | 12 +- ftnoir_filter_ewma2/ftnoir_filter_ewma_dll.cpp | 5 +- 5 files changed, 614 insertions(+), 27 deletions(-) create mode 100644 ftnoir_filter_ewma2/ftnoir_ewma_filtercontrols.ui (limited to 'ftnoir_filter_ewma2') diff --git a/ftnoir_filter_ewma2/ftnoir_ewma_filtercontrols.ui b/ftnoir_filter_ewma2/ftnoir_ewma_filtercontrols.ui new file mode 100644 index 000000000..0f31bcd37 --- /dev/null +++ b/ftnoir_filter_ewma2/ftnoir_ewma_filtercontrols.ui @@ -0,0 +1,587 @@ + + + UICFilterControls + + + + 0 + 0 + 371 + 380 + + + + + 0 + 380 + + + + EWMA2 Filter settings FaceTrackNoIR + + + + images/facetracknoir.png + + + + Qt::LeftToRight + + + false + + + + + + + + + QLayout::SetMinimumSize + + + + + + + + 0 + 0 + + + + + 30 + 16777215 + + + + + + + pow + + + + + + + + 40 + 22 + + + + background:none; + + + 100 + + + 5 + + + 10 + + + + + + + + 45 + 15 + + + + 1 + + + 100 + + + 10 + + + 10 + + + Qt::Horizontal + + + QSlider::NoTicks + + + + + + + + 35 + 0 + + + + + 30 + 16777215 + + + + + + + frames + + + + + + + + 0 + 0 + + + + + 30 + 16777215 + + + + + + + Max. + + + + + + + + 0 + 0 + + + + + 30 + 16777215 + + + + + + + Curve + + + + + + + + 40 + 22 + + + + background:none; + + + 1 + + + 100 + + + 5 + + + 2 + + + + + + + + 35 + 0 + + + + + 30 + 16777215 + + + + + + + frames + + + + + + + + 45 + 15 + + + + 1 + + + 100 + + + 10 + + + 10 + + + Qt::Horizontal + + + QSlider::NoTicks + + + + + + + + 40 + 22 + + + + background:none; + + + 1 + + + 100 + + + 5 + + + 10 + + + + + + + + 0 + 0 + + + + + 30 + 16777215 + + + + + + + Min. + + + + + + + + 45 + 15 + + + + 1 + + + 100 + + + 10 + + + 2 + + + Qt::Horizontal + + + QSlider::NoTicks + + + + + + + + + + 0 + 204 + + + + background-color: rgb(214, 214, 214); +border-color: rgb(0, 0, 0); + + + QFrame::Box + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">Min. frames:</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">Defines the way the filter responds to fast movements;</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">Higher value: slower response;</span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10pt;"></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">Max. frames:</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">Defines the way the filter responds to slow movements;</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">Higher value: slower response;</span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10pt;"></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">Pow:</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">Defines the filters 'readiness' to respond to speed changes;</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">Higher value = </span><span style=" font-size:10pt; font-weight:600;">higher</span><span style=" font-size:10pt;"> response;</span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10pt;"></p></body></html> + + + 5 + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + QLayout::SetDefaultConstraint + + + + + + 0 + 0 + + + + + 52 + 0 + + + + + 100 + 16777215 + + + + OK + + + + + + + + 0 + 0 + + + + + 52 + 0 + + + + + 100 + 16777215 + + + + Cancel + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 10 + 20 + + + + + + + + + + btnOK + btnCancel + + + + + minSmooth + valueChanged(int) + spinMinSmooth + setValue(int) + + + 199 + 22 + + + 337 + 23 + + + + + spinMinSmooth + valueChanged(int) + minSmooth + setValue(int) + + + 330 + 12 + + + 185 + 17 + + + + + maxSmooth + valueChanged(int) + spinMaxSmooth + setValue(int) + + + 181 + 48 + + + 335 + 54 + + + + + spinMaxSmooth + valueChanged(int) + maxSmooth + setValue(int) + + + 324 + 42 + + + 259 + 43 + + + + + powCurve + valueChanged(int) + spinPowCurve + setValue(int) + + + 145 + 74 + + + 339 + 78 + + + + + spinPowCurve + valueChanged(int) + powCurve + setValue(int) + + + 330 + 69 + + + 176 + 76 + + + + + + startEngineClicked() + stopEngineClicked() + cameraSettingsClicked() + + diff --git a/ftnoir_filter_ewma2/ftnoir_filter_ewma2.cpp b/ftnoir_filter_ewma2/ftnoir_filter_ewma2.cpp index fac0e13c0..5f1965333 100644 --- a/ftnoir_filter_ewma2/ftnoir_filter_ewma2.cpp +++ b/ftnoir_filter_ewma2/ftnoir_filter_ewma2.cpp @@ -25,7 +25,9 @@ #include "ftnoir_filter_ewma2.h" #include "math.h" #include - +#include +#include "facetracknoir/global-settings.h" +#include //#define LOG_OUTPUT ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -47,11 +49,6 @@ FTNoIR_Filter::~FTNoIR_Filter() } -void FTNoIR_Filter::Release() -{ - delete this; -} - void FTNoIR_Filter::Initialize() { qDebug() << "FTNoIR_Filter::Initialize says: Starting "; @@ -82,7 +79,7 @@ void FTNoIR_Filter::loadSettings() { } -void FTNoIR_Filter::FilterHeadPoseData(THeadPoseData *current_camera_position, THeadPoseData *target_camera_position, THeadPoseData *new_camera_position, bool newTarget) +void FTNoIR_Filter::FilterHeadPoseData(THeadPoseData *current_camera_position, THeadPoseData *target_camera_position, THeadPoseData *new_camera_position, THeadPoseData *last_post_filter, bool newTarget) { //non-optimised version for clarity float prev_output[6]; @@ -149,7 +146,7 @@ void FTNoIR_Filter::FilterHeadPoseData(THeadPoseData *current_camera_position, T //normalise the deltas for (i=0;i<6;i++) { - norm_output_delta[i]=std::min(std::max(fabs(output_delta[i])/scale[i],0.0f),1.0f); + norm_output_delta[i]=std::min(std::max(fabs(output_delta[i])/scale[i],0.0),1.0); } //calculate the alphas @@ -228,9 +225,9 @@ void FTNoIR_Filter::FilterHeadPoseData(THeadPoseData *current_camera_position, T // GetFilter - Undecorated name, which can be easily used with GetProcAddress // Win32 API function. // _GetFilter@0 - Common name decoration for __stdcall functions in C language. -#pragma comment(linker, "/export:GetFilter=_GetFilter@0") +//#pragma comment(linker, "/export:GetFilter=_GetFilter@0") -FTNOIR_FILTER_BASE_EXPORT IFilterPtr __stdcall GetFilter() +extern "C" FTNOIR_FILTER_BASE_EXPORT void* CALLING_CONVENTION GetConstructor() { - return new FTNoIR_Filter; + return (IFilter*) new FTNoIR_Filter; } diff --git a/ftnoir_filter_ewma2/ftnoir_filter_ewma2.h b/ftnoir_filter_ewma2/ftnoir_filter_ewma2.h index 18afe3bd2..cade740f7 100644 --- a/ftnoir_filter_ewma2/ftnoir_filter_ewma2.h +++ b/ftnoir_filter_ewma2/ftnoir_filter_ewma2.h @@ -26,8 +26,10 @@ #ifndef INCLUDED_FTN_FILTER_H #define INCLUDED_FTN_FILTER_H -#include "..\ftnoir_filter_base\ftnoir_filter_base.h" -#include "ui_FTNoIR_FilterControls.h" +#include "ftnoir_filter_base/ftnoir_filter_base.h" +#include "facetracknoir/global-settings.h" +#include "ui_ftnoir_ewma_filtercontrols.h" +#include ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // @@ -38,12 +40,10 @@ class FTNoIR_Filter : public IFilter { public: FTNoIR_Filter(); - ~FTNoIR_Filter(); + ~FTNoIR_Filter(); - void Release(); void Initialize(); - void StartFilter(); - void FilterHeadPoseData(THeadPoseData *current_camera_position, THeadPoseData *target_camera_position, THeadPoseData *new_camera_position, bool newTarget); + void FilterHeadPoseData(THeadPoseData *current_camera_position, THeadPoseData *target_camera_position, THeadPoseData *new_camera_position, THeadPoseData *last_post_filter, bool newTarget); private: void loadSettings(); // Load the settings from the INI-file @@ -76,7 +76,7 @@ public: void showEvent ( QShowEvent * event ); void Release(); // Member functions which are accessible from outside the DLL - void Initialize(QWidget *parent, IFilterPtr ptr); + void Initialize(QWidget *parent, IFilter* ptr); private: Ui::UICFilterControls ui; @@ -86,7 +86,7 @@ private: /** helper **/ bool settingsDirty; - IFilterPtr pFilter; // If the filter was active when the dialog was opened, this will hold a pointer to the Filter instance + IFilter* pFilter; // If the filter was active when the dialog was opened, this will hold a pointer to the Filter instance private slots: void doOK(); @@ -98,7 +98,7 @@ private slots: //******************************************************************************************************* // FaceTrackNoIR Filter DLL. Functions used to get general info on the Filter //******************************************************************************************************* -class FTNoIR_FilterDll : public IFilterDll +class FTNoIR_FilterDll : public Metadata { public: FTNoIR_FilterDll(); diff --git a/ftnoir_filter_ewma2/ftnoir_filter_ewma2_dialog.cpp b/ftnoir_filter_ewma2/ftnoir_filter_ewma2_dialog.cpp index c7798ac0a..3e0fdb256 100644 --- a/ftnoir_filter_ewma2/ftnoir_filter_ewma2_dialog.cpp +++ b/ftnoir_filter_ewma2/ftnoir_filter_ewma2_dialog.cpp @@ -22,9 +22,11 @@ * with this program; if not, see . * * * ********************************************************************************/ -#include "ftnoir_filter_EWMA2.h" +#include "ftnoir_filter_ewma2.h" #include "math.h" #include +#include "facetracknoir/global-settings.h" +#include "ui_ftnoir_ewma_filtercontrols.h" //******************************************************************************************************* // FaceTrackNoIR Filter Settings-dialog. @@ -72,7 +74,7 @@ void FilterControls::Release() // // Initialize tracker-client-dialog // -void FilterControls::Initialize(QWidget *parent, IFilterPtr ptr) { +void FilterControls::Initialize(QWidget *parent, IFilter* ptr) { // // The dialog can be opened, while the Tracker is running. @@ -189,9 +191,9 @@ void FilterControls::save() { // GetFilterDialog - Undecorated name, which can be easily used with GetProcAddress // Win32 API function. // _GetFilterDialog@0 - Common name decoration for __stdcall functions in C language. -#pragma comment(linker, "/export:GetFilterDialog=_GetFilterDialog@0") +//#pragma comment(linker, "/export:GetFilterDialog=_GetFilterDialog@0") -FTNOIR_FILTER_BASE_EXPORT IFilterDialogPtr __stdcall GetFilterDialog( ) +extern "C" FTNOIR_FILTER_BASE_EXPORT void* CALLING_CONVENTION GetDialog( ) { - return new FilterControls; + return (IFilterDialog*) new FilterControls; } diff --git a/ftnoir_filter_ewma2/ftnoir_filter_ewma_dll.cpp b/ftnoir_filter_ewma2/ftnoir_filter_ewma_dll.cpp index 4e6444461..a01b06616 100644 --- a/ftnoir_filter_ewma2/ftnoir_filter_ewma_dll.cpp +++ b/ftnoir_filter_ewma2/ftnoir_filter_ewma_dll.cpp @@ -32,6 +32,7 @@ */ #include "ftnoir_filter_ewma2.h" #include +#include "facetracknoir/global-settings.h" FTNoIR_FilterDll::FTNoIR_FilterDll() { } @@ -48,9 +49,9 @@ FTNoIR_FilterDll::~FTNoIR_FilterDll() // GetFilterDll - Undecorated name, which can be easily used with GetProcAddress // Win32 API function. // _GetFilterDll@0 - Common name decoration for __stdcall functions in C language. -#pragma comment(linker, "/export:GetFilterDll=_GetFilterDll@0") +//#pragma comment(linker, "/export:GetFilterDll=_GetFilterDll@0") -FTNOIR_FILTER_BASE_EXPORT IFilterDllPtr __stdcall GetFilterDll() +extern "C" FTNOIR_FILTER_BASE_EXPORT Metadata* CALLING_CONVENTION GetMetadata() { return new FTNoIR_FilterDll; } -- cgit v1.2.3