-
Notifications
You must be signed in to change notification settings - Fork 0
/
base.cpp
43 lines (37 loc) · 1.41 KB
/
base.cpp
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
#include "base.h"
//==========================================================================================
// BaseApproximator
//==========================================================================================
BaseApproximator::BaseApproximator(BaseSettings *settings):settingsObject(settings){}
void BaseApproximator::stopProcessing(){
printf("Trying to stop approximator\n");
keepGoing = false;
}
void BaseApproximator::processImage(QImage orig){
printf("Approximator did not define a method to process an image\n");
emit doneProcessing(orig);
}
//==========================================================================================
// BaseSettings
//==========================================================================================
BaseSettings::BaseSettings(){
localApproximator = NULL;
}
BaseApproximator* BaseSettings::getApproximator(){
if(localApproximator == NULL)
printf("ERROR - Settings Widget did not set the approximator variable\n");
return localApproximator;
}
int BaseSettings::startApproximator(QImage original){
return
QMetaObject::invokeMethod(localApproximator,"processImage",
Q_ARG(QImage,original)
);
}
int BaseSettings::stopApproximator(){
return QMetaObject::invokeMethod(localApproximator,"stopProcessing");
}
QString BaseSettings::getApproximatorName(){
printf("Setting object did not define a name for the approximator\n");
return "UNDEFINED";
}