diff --git a/app/Operations/DoubleEntropyOp.cpp b/app/Operations/DoubleEntropyOp.cpp index 55caaf96c9c8871076ced03079070fde19c6db22..328b430b5c16f6db7f39c74554ce431f9c126ae7 100644 --- a/app/Operations/DoubleEntropyOp.cpp +++ b/app/Operations/DoubleEntropyOp.cpp @@ -40,6 +40,7 @@ void DoubleEntropyOp::operator()(const Image_t<double>* image, const std::map<co double entropy = image->getEntropy(); outText(qApp->translate("Operations", "Entropy of the image (sum of channels entropy) = %1\n").arg(entropy).toStdString()); + // outText(qApp->translate("Pas d'échantillonnage choisi : 1\n")); outText(qApp->translate("Operations", "Pas d'échantillonnage choisi : 1\n").toStdString()); } diff --git a/app/Operations/FlipOp.cpp b/app/Operations/FlipOp.cpp index d5bb8a7d219c5a614ea51311e682b1255fd8dcda..3694ecb08609fb6b97705e0c55df7ec113cbea7e 100644 --- a/app/Operations/FlipOp.cpp +++ b/app/Operations/FlipOp.cpp @@ -63,4 +63,3 @@ void FlipOp::operator()(const imagein::Image* image, const std::map<const imagei this->outImage(resImg, name.toStdString()); } - diff --git a/core/Operation.h b/core/Operation.h index 161ca17d06d39617bea46d5a7116ea44709aaf8d..46fb89fe5ff519625ebe389f55e05cd6ff003975 100644 --- a/core/Operation.h +++ b/core/Operation.h @@ -96,7 +96,6 @@ virtual bool needCurrentImg() const = 0; virtual bool isValidImgWnd(const genericinterface::ImageWindow* imgWnd) const = 0; - protected: @@ -136,6 +135,7 @@ void outText(std::string); std::string _name; /**< The name of the operation */ genericinterface::WindowService* _ws; /**< A pointer to the window service, only valid inside the function call operator */ genericinterface::ImageWindow* _curImgWnd; /**< A pointer to the current image window, only valid inside the function call operator */ + private: /** * @brief Private method used to output an ImageWindow, this method is called inside outImage and outDoubleImage. diff --git a/lib/detiq-t b/lib/detiq-t index 0de899d155da81ee01b8a5d79da656f616c07d3e..e9d359ddede0e5355bb86db7b870d1580774a260 160000 --- a/lib/detiq-t +++ b/lib/detiq-t @@ -1 +1 @@ -Subproject commit 0de899d155da81ee01b8a5d79da656f616c07d3e +Subproject commit e9d359ddede0e5355bb86db7b870d1580774a260 diff --git a/test/res/test_scaling_result_toinou_x2_y1_bilinear.bmp b/test/res/test_scaling_result_toinou_x2_y1_bilinear.bmp index 4da17d04ae69ccdf54c2f3d21bce88837c6ba22e..6069ae43cceaabd4ff4e69765e2df133ac1cd0fa 100644 Binary files a/test/res/test_scaling_result_toinou_x2_y1_bilinear.bmp and b/test/res/test_scaling_result_toinou_x2_y1_bilinear.bmp differ diff --git a/test/test b/test/test index d33af024e8543e0a7eee0cc40df0d6d213132b02..1ac03903009259315754c42586bb96c7a53f250d 100755 Binary files a/test/test and b/test/test differ diff --git a/test/test.jpg b/test/test.jpg deleted file mode 100644 index 425f28a53933fd447ccfaac9803aab98788e325d..0000000000000000000000000000000000000000 Binary files a/test/test.jpg and /dev/null differ diff --git a/test/testgui.cpp b/test/testgui.cpp index 018433a302c3e45453c414842423131c93915f1c..d6ddb5e2b74e5d1b581d51b64e3766826fb88b91 100644 --- a/test/testgui.cpp +++ b/test/testgui.cpp @@ -56,6 +56,7 @@ #include "../app/Operations/MedianOp.h" #include "../app/Operations/UCharConvertOp.h" +using namespace std; using namespace imagein; using namespace genericinterface; @@ -66,13 +67,54 @@ class TestGui: public QObject private: GenericInterface* gi; StandardImageWindow* _img; + BuiltinOpSet* _image; private slots: void testGenericInterfaceSetup(); void testWindowServiceAddFile(); + void testMenuActions(); void testFileServiceSave(); void testRemoveImage(); - void testThresholdOp(); + + void testThresholdOpOtsu(); + void testThresholdOp127(); + void testThresholdOpDouble(); + + void testQuantifOpLinearCentered2(); + void testQuantifOpLinearCentered3(); + void testQuantifOpLinearCentered5(); + void testQuantifOpLinearCentered16(); + + void testQuantifOpLloydMax2(); + void testQuantifOpLloydMax3(); + void testQuantifOpLloydMax5(); + void testQuantifOpLloydMax16(); + + void testQuantifOpNonLinearCentered2(); + void testQuantifOpNonLinearCentered3(); + void testQuantifOpNonLinearCentered5(); + void testQuantifOpNonLinearCentered16(); + + void testQuantifOpNonLinearMean2(); + void testQuantifOpNonLinearMean3(); + void testQuantifOpNonLinearMean5(); + void testQuantifOpNonLinearMean16(); + + void testTranslateOpPos(); + void testTranslateOpNeg(); + + void testRotateOpCwise(); + void testRotateOpACwise(); + + void testFlipOpHor(); + void testFlipOpVer(); + + void testScalingOpBilinear(); + void testScalingOpNearest(); + + + void testCompQuant(); + void testCompThreshold(); }; @@ -81,25 +123,25 @@ void TestGui::testGenericInterfaceSetup(){ PluginManager* pluginManager = new PluginManager(gi); ImageINSAService* mainService = new ImageINSAService(gi); - BuiltinOpSet* image = new BuiltinOpSet(qApp->translate("", "&Image").toStdString()); - image->addOperation(new PointOp()); - image->addOperation(new TranslateOp()); - image->addOperation(new RotateOp()); - image->addOperation(new CenterOp()); - image->addOperation(new FlipOp(FlipOp::Horizontal)); - image->addOperation(new FlipOp(FlipOp::Vertical)); - image->addOperation(new SeparatorOp()); - image->addOperation(new SplitColorOp()); - image->addOperation(new SplitHsvOp()); - image->addOperation(new CombineColorOp()); - image->addOperation(new CombineHSVOp()); - image->addOperation(new SeparatorOp()); - image->addOperation(new ScalingOp()); - image->addOperation(new QuantificationOp()); - image->addOperation(new ThresholdOp()); - image->addOperation(new HistogramOp()); - image->addOperation(new SeparatorOp()); - image->addOperation(new UCharConvertOp()); + _image = new BuiltinOpSet(qApp->translate("", "&Image").toStdString()); + _image->addOperation(new PointOp()); + _image->addOperation(new TranslateOp()); + _image->addOperation(new RotateOp()); + _image->addOperation(new CenterOp()); + _image->addOperation(new FlipOp(FlipOp::Horizontal)); + _image->addOperation(new FlipOp(FlipOp::Vertical)); + _image->addOperation(new SeparatorOp()); + _image->addOperation(new SplitColorOp()); + _image->addOperation(new SplitHsvOp()); + _image->addOperation(new CombineColorOp()); + _image->addOperation(new CombineHSVOp()); + _image->addOperation(new SeparatorOp()); + _image->addOperation(new ScalingOp()); + _image->addOperation(new QuantificationOp()); + _image->addOperation(new ThresholdOp()); + _image->addOperation(new HistogramOp()); + _image->addOperation(new SeparatorOp()); + _image->addOperation(new UCharConvertOp()); BuiltinOpSet* tools = new BuiltinOpSet(qApp->translate("", "&Tools").toStdString()); @@ -143,7 +185,7 @@ void TestGui::testGenericInterfaceSetup(){ filter->addOperation(new BFlitOp()); filter->addOperation(new MedianOp()); - mainService->addOpSet(image); + mainService->addOpSet(_image); mainService->addOpSet(encode); mainService->addOpSet(morpho); mainService->addOpSet(analyse); @@ -159,45 +201,698 @@ void TestGui::testGenericInterfaceSetup(){ void TestGui::testWindowServiceAddFile() { WindowService* ws = dynamic_cast<WindowService*>(gi->getService(GenericInterface::WINDOW_SERVICE)); - ws->addFile(QString("test.jpg")); + ws->addFile(QString("src/test.png")); _img = dynamic_cast<StandardImageWindow*>(ws->getCurrentImageWindow()); /* I have a doubt on the usefulness of the following test. *Is void casting really relevant when comparing values ? */ QVERIFY((void*)_img != (void*)0); - QCOMPARE(ws->getCurrentImageWindow()->getPath(),QString("test.jpg")); + QCOMPARE(ws->getCurrentImageWindow()->getPath(),QString("src/test.png")); } void TestGui::testFileServiceSave() { FileService* fs = dynamic_cast<FileService*>(gi->getService(GenericInterface::FILE_SERVICE)); fs->save("tata.jpg"); - Image test("test.jpg"), tata("tata.jpg"); + Image test("src/test.png"), tata("tata.jpg"); QCOMPARE(test.getWidth(), tata.getWidth()); QCOMPARE(test.getHeight(), tata.getHeight()); QCOMPARE(test.getNbChannels(), tata.getNbChannels()); + + } void TestGui::testRemoveImage() { QFile("tata.jpg").remove(); QString sbempty = QFINDTESTDATA("tata.jpg"); QCOMPARE(sbempty, QString("")); + +} + +void TestGui::testThresholdOpOtsu(){ + WindowService* ws = dynamic_cast<WindowService*>(gi->getService(GenericInterface::WINDOW_SERVICE)); + ws->addFile(QString("src/test_thresholding_imao5.bmp")); + + _img = dynamic_cast<StandardImageWindow*>(ws->getCurrentImageWindow()); + const imagein::Image* image = _img->getImage(); + map<const Image*, string> imgList; + imgList.insert(pair<const Image*, string>(image, _img->windowTitle().toStdString())); + + std::vector<GenericOperation*> opvect = _image->getOperations(); + std::vector<GenericOperation*>::iterator it; + + for (it = opvect.begin() ; it != opvect.end(); ++it){ + if((*it)->getName()=="Thresholding"){ + (dynamic_cast<ThresholdOp*>(*it))->setTest(true); + (dynamic_cast<ThresholdOp*>(*it))->setTestOtsu(true); + (*it)->operator()(ws); + } + } + + FileService* fs = dynamic_cast<FileService*>(gi->getService(GenericInterface::FILE_SERVICE)); + fs->save("res/test_thresholding_result_imao5_otsu.vff"); +} + +void TestGui::testThresholdOp127(){ + + WindowService* ws = dynamic_cast<WindowService*>(gi->getService(GenericInterface::WINDOW_SERVICE)); + ws->addFile(QString("src/test_thresholding_imao5.bmp")); + + + _img = dynamic_cast<StandardImageWindow*>(ws->getCurrentImageWindow()); + const imagein::Image* image = _img->getImage(); + map<const Image*, string> imgList; + imgList.insert(pair<const Image*, string>(image, _img->windowTitle().toStdString())); + + std::vector<GenericOperation*> opvect = _image->getOperations(); + std::vector<GenericOperation*>::iterator it; + + for (it = opvect.begin() ; it != opvect.end(); ++it){ + if((*it)->getName()=="Thresholding"){ + (dynamic_cast<ThresholdOp*>(*it))->setTestOtsu(false); + (dynamic_cast<ThresholdOp*>(*it))->setTest(true); + (dynamic_cast<ThresholdOp*>(*it))->setTestThreshold1(127); + (*it)->operator()(ws); + } + } + + FileService* fs = dynamic_cast<FileService*>(gi->getService(GenericInterface::FILE_SERVICE)); + fs->save("res/test_thresholding_imao5_127.vff"); +} + +void TestGui::testThresholdOpDouble(){ + + WindowService* ws = dynamic_cast<WindowService*>(gi->getService(GenericInterface::WINDOW_SERVICE)); + ws->addFile(QString("src/test_thresholding_imao5.bmp")); + + + _img = dynamic_cast<StandardImageWindow*>(ws->getCurrentImageWindow()); + const imagein::Image* image = _img->getImage(); + map<const Image*, string> imgList; + imgList.insert(pair<const Image*, string>(image, _img->windowTitle().toStdString())); + + std::vector<GenericOperation*> opvect = _image->getOperations(); + std::vector<GenericOperation*>::iterator it; + + for (it = opvect.begin() ; it != opvect.end(); ++it){ + if((*it)->getName()=="Thresholding"){ + (dynamic_cast<ThresholdOp*>(*it))->setTest(true); + (dynamic_cast<ThresholdOp*>(*it))->setTestThreshold1(30); + (dynamic_cast<ThresholdOp*>(*it))->setTestThreshold2(200); + (*it)->operator()(ws); + } + } + + FileService* fs = dynamic_cast<FileService*>(gi->getService(GenericInterface::FILE_SERVICE)); + fs->save("res/test_thresholding_imao5_30_200.vff"); +} + +void TestGui::testQuantifOpLinearCentered2(){ + WindowService* ws = dynamic_cast<WindowService*>(gi->getService(GenericInterface::WINDOW_SERVICE)); + ws->addFile(QString("src/test_quantization_barba.bmp")); + + std::vector<GenericOperation*> opvect = _image->getOperations(); + std::vector<GenericOperation*>::iterator it; + + for (it = opvect.begin() ; it != opvect.end(); ++it){ + if((*it)->getName()=="Quantification"){ + (dynamic_cast<QuantificationOp*>(*it))->setTest(true); + (dynamic_cast<QuantificationOp*>(*it))->setValues(2); + (*it)->operator()(ws); + } + } + + std::vector<const ImageWindow*> imgvect = ws->getImageWindows(); + std::vector<const ImageWindow*>::iterator it2; + + for(it2 = imgvect.begin() ; it2 != imgvect.end() ; ++it2){ + cout << (*it2)->windowTitle().toStdString() << "\n"; + } + + _img = dynamic_cast<StandardImageWindow*>(ws->getCurrentImageWindow()); + + FileService* fs = dynamic_cast<FileService*>(gi->getService(GenericInterface::FILE_SERVICE)); + fs->save("res/test_quantization_LinearCentered_barba_2.bmp"); +} + +void TestGui::testQuantifOpLinearCentered3(){ + WindowService* ws = dynamic_cast<WindowService*>(gi->getService(GenericInterface::WINDOW_SERVICE)); + ws->addFile(QString("src/test_quantization_berber.bmp")); + + std::vector<GenericOperation*> opvect = _image->getOperations(); + std::vector<GenericOperation*>::iterator it; + + for (it = opvect.begin() ; it != opvect.end(); ++it){ + if((*it)->getName()=="Quantification"){ + (dynamic_cast<QuantificationOp*>(*it))->setTest(true); + (dynamic_cast<QuantificationOp*>(*it))->setValues(3); + (*it)->operator()(ws); + } + } + + _img = dynamic_cast<StandardImageWindow*>(ws->getCurrentImageWindow()); + + FileService* fs = dynamic_cast<FileService*>(gi->getService(GenericInterface::FILE_SERVICE)); + fs->save("res/test_quantization_LinearCentered_berber_3.bmp"); +} + +void TestGui::testQuantifOpLinearCentered5(){ + WindowService* ws = dynamic_cast<WindowService*>(gi->getService(GenericInterface::WINDOW_SERVICE)); + ws->addFile(QString("src/test_quantization_imao5.bmp")); + + std::vector<GenericOperation*> opvect = _image->getOperations(); + std::vector<GenericOperation*>::iterator it; + + for (it = opvect.begin() ; it != opvect.end(); ++it){ + if((*it)->getName()=="Quantification"){ + (dynamic_cast<QuantificationOp*>(*it))->setTest(true); + (dynamic_cast<QuantificationOp*>(*it))->setValues(5); + (*it)->operator()(ws); + } + } + + _img = dynamic_cast<StandardImageWindow*>(ws->getCurrentImageWindow()); + + FileService* fs = dynamic_cast<FileService*>(gi->getService(GenericInterface::FILE_SERVICE)); + fs->save("res/test_quantization_LinearCentered_imao5_5.bmp"); + +} + +void TestGui::testQuantifOpLinearCentered16(){ + WindowService* ws = dynamic_cast<WindowService*>(gi->getService(GenericInterface::WINDOW_SERVICE)); + ws->addFile(QString("src/test_quantization_monarch.bmp")); + + std::vector<GenericOperation*> opvect = _image->getOperations(); + std::vector<GenericOperation*>::iterator it; + + for (it = opvect.begin() ; it != opvect.end(); ++it){ + if((*it)->getName()=="Quantification"){ + (dynamic_cast<QuantificationOp*>(*it))->setTest(true); + (dynamic_cast<QuantificationOp*>(*it))->setValues(16); + (*it)->operator()(ws); + } + } + + _img = dynamic_cast<StandardImageWindow*>(ws->getCurrentImageWindow()); + + FileService* fs = dynamic_cast<FileService*>(gi->getService(GenericInterface::FILE_SERVICE)); + fs->save("res/test_quantization_LinearCentered_monarch_16.bmp"); + +} + +void TestGui::testQuantifOpLloydMax2(){ + WindowService* ws = dynamic_cast<WindowService*>(gi->getService(GenericInterface::WINDOW_SERVICE)); + ws->addFile(QString("src/test_quantization_barba.bmp")); + + std::vector<GenericOperation*> opvect = _image->getOperations(); + std::vector<GenericOperation*>::iterator it; + + for (it = opvect.begin() ; it != opvect.end(); ++it){ + if((*it)->getName()=="Quantification"){ + (dynamic_cast<QuantificationOp*>(*it))->setTest(true); + (dynamic_cast<QuantificationOp*>(*it))->setQuantif(4); + (dynamic_cast<QuantificationOp*>(*it))->setValues(2); + (*it)->operator()(ws); + } + } + _img = dynamic_cast<StandardImageWindow*>(ws->getCurrentImageWindow()); + + FileService* fs = dynamic_cast<FileService*>(gi->getService(GenericInterface::FILE_SERVICE)); + fs->save("res/test_quantization_lloydMax_barba_2.bmp"); +} + +void TestGui::testQuantifOpLloydMax3(){ + WindowService* ws = dynamic_cast<WindowService*>(gi->getService(GenericInterface::WINDOW_SERVICE)); + ws->addFile(QString("src/test_quantization_berber.bmp")); + + std::vector<GenericOperation*> opvect = _image->getOperations(); + std::vector<GenericOperation*>::iterator it; + + for (it = opvect.begin() ; it != opvect.end(); ++it){ + if((*it)->getName()=="Quantification"){ + (dynamic_cast<QuantificationOp*>(*it))->setTest(true); + (dynamic_cast<QuantificationOp*>(*it))->setQuantif(4); + (dynamic_cast<QuantificationOp*>(*it))->setValues(3); + (*it)->operator()(ws); + } + } + + _img = dynamic_cast<StandardImageWindow*>(ws->getCurrentImageWindow()); + + FileService* fs = dynamic_cast<FileService*>(gi->getService(GenericInterface::FILE_SERVICE)); + fs->save("res/test_quantization_lloydMax_berber_3.bmp"); +} + +void TestGui::testQuantifOpLloydMax5(){ + WindowService* ws = dynamic_cast<WindowService*>(gi->getService(GenericInterface::WINDOW_SERVICE)); + ws->addFile(QString("src/test_quantization_imao5.bmp")); + + std::vector<GenericOperation*> opvect = _image->getOperations(); + std::vector<GenericOperation*>::iterator it; + + for (it = opvect.begin() ; it != opvect.end(); ++it){ + if((*it)->getName()=="Quantification"){ + (dynamic_cast<QuantificationOp*>(*it))->setTest(true); + (dynamic_cast<QuantificationOp*>(*it))->setQuantif(4); + (dynamic_cast<QuantificationOp*>(*it))->setValues(5); + (*it)->operator()(ws); + } + } + + _img = dynamic_cast<StandardImageWindow*>(ws->getCurrentImageWindow()); + + FileService* fs = dynamic_cast<FileService*>(gi->getService(GenericInterface::FILE_SERVICE)); + fs->save("res/test_quantization_lloydMax_imao5_5.bmp"); + +} + +void TestGui::testQuantifOpLloydMax16(){ + WindowService* ws = dynamic_cast<WindowService*>(gi->getService(GenericInterface::WINDOW_SERVICE)); + ws->addFile(QString("src/test_quantization_monarch.bmp")); + + std::vector<GenericOperation*> opvect = _image->getOperations(); + std::vector<GenericOperation*>::iterator it; + + for (it = opvect.begin() ; it != opvect.end(); ++it){ + if((*it)->getName()=="Quantification"){ + (dynamic_cast<QuantificationOp*>(*it))->setTest(true); + (dynamic_cast<QuantificationOp*>(*it))->setQuantif(4); + (dynamic_cast<QuantificationOp*>(*it))->setValues(16); + (*it)->operator()(ws); + } + } + + _img = dynamic_cast<StandardImageWindow*>(ws->getCurrentImageWindow()); + + FileService* fs = dynamic_cast<FileService*>(gi->getService(GenericInterface::FILE_SERVICE)); + fs->save("res/test_quantization_lloydMax_monarch_16.bmp"); + +} + +void TestGui::testQuantifOpNonLinearCentered2(){ + WindowService* ws = dynamic_cast<WindowService*>(gi->getService(GenericInterface::WINDOW_SERVICE)); + ws->addFile(QString("src/test_quantization_barba.bmp")); + + std::vector<GenericOperation*> opvect = _image->getOperations(); + std::vector<GenericOperation*>::iterator it; + + for (it = opvect.begin() ; it != opvect.end(); ++it){ + if((*it)->getName()=="Quantification"){ + (dynamic_cast<QuantificationOp*>(*it))->setTest(true); + (dynamic_cast<QuantificationOp*>(*it))->setQuantif(1); + (dynamic_cast<QuantificationOp*>(*it))->setValues(2); + (*it)->operator()(ws); + } + } + _img = dynamic_cast<StandardImageWindow*>(ws->getCurrentImageWindow()); + + FileService* fs = dynamic_cast<FileService*>(gi->getService(GenericInterface::FILE_SERVICE)); + fs->save("res/test_quantization_nonlinearCentered_barba_2.bmp"); +} + +void TestGui::testQuantifOpNonLinearCentered3(){ + WindowService* ws = dynamic_cast<WindowService*>(gi->getService(GenericInterface::WINDOW_SERVICE)); + ws->addFile(QString("src/test_quantization_berber.bmp")); + + std::vector<GenericOperation*> opvect = _image->getOperations(); + std::vector<GenericOperation*>::iterator it; + + for (it = opvect.begin() ; it != opvect.end(); ++it){ + if((*it)->getName()=="Quantification"){ + (dynamic_cast<QuantificationOp*>(*it))->setTest(true); + (dynamic_cast<QuantificationOp*>(*it))->setQuantif(1); + (dynamic_cast<QuantificationOp*>(*it))->setValues(3); + (*it)->operator()(ws); + } + } + + _img = dynamic_cast<StandardImageWindow*>(ws->getCurrentImageWindow()); + + FileService* fs = dynamic_cast<FileService*>(gi->getService(GenericInterface::FILE_SERVICE)); + fs->save("res/test_quantization_nonlinearCentered_berber_3.bmp"); +} + +void TestGui::testQuantifOpNonLinearCentered5(){ + WindowService* ws = dynamic_cast<WindowService*>(gi->getService(GenericInterface::WINDOW_SERVICE)); + ws->addFile(QString("src/test_quantization_imao5.bmp")); + + std::vector<GenericOperation*> opvect = _image->getOperations(); + std::vector<GenericOperation*>::iterator it; + + for (it = opvect.begin() ; it != opvect.end(); ++it){ + if((*it)->getName()=="Quantification"){ + (dynamic_cast<QuantificationOp*>(*it))->setTest(true); + (dynamic_cast<QuantificationOp*>(*it))->setQuantif(1); + (dynamic_cast<QuantificationOp*>(*it))->setValues(5); + (*it)->operator()(ws); + } + } + + _img = dynamic_cast<StandardImageWindow*>(ws->getCurrentImageWindow()); + + FileService* fs = dynamic_cast<FileService*>(gi->getService(GenericInterface::FILE_SERVICE)); + fs->save("res/test_quantization_nonlinearCentered_imao5_5.bmp"); + +} + +void TestGui::testQuantifOpNonLinearCentered16(){ + WindowService* ws = dynamic_cast<WindowService*>(gi->getService(GenericInterface::WINDOW_SERVICE)); + ws->addFile(QString("src/test_quantization_monarch.bmp")); + + std::vector<GenericOperation*> opvect = _image->getOperations(); + std::vector<GenericOperation*>::iterator it; + + for (it = opvect.begin() ; it != opvect.end(); ++it){ + if((*it)->getName()=="Quantification"){ + (dynamic_cast<QuantificationOp*>(*it))->setTest(true); + (dynamic_cast<QuantificationOp*>(*it))->setQuantif(1); + (dynamic_cast<QuantificationOp*>(*it))->setValues(16); + (*it)->operator()(ws); + } + } + + _img = dynamic_cast<StandardImageWindow*>(ws->getCurrentImageWindow()); + + FileService* fs = dynamic_cast<FileService*>(gi->getService(GenericInterface::FILE_SERVICE)); + fs->save("res/test_quantization_nonlinearCentered_monarch_16.bmp"); + +} + +void TestGui::testQuantifOpNonLinearMean2(){ + WindowService* ws = dynamic_cast<WindowService*>(gi->getService(GenericInterface::WINDOW_SERVICE)); + ws->addFile(QString("src/test_quantization_barba.bmp")); + + std::vector<GenericOperation*> opvect = _image->getOperations(); + std::vector<GenericOperation*>::iterator it; + + for (it = opvect.begin() ; it != opvect.end(); ++it){ + if((*it)->getName()=="Quantification"){ + (dynamic_cast<QuantificationOp*>(*it))->setTest(true); + (dynamic_cast<QuantificationOp*>(*it))->setQuantif(2); + (dynamic_cast<QuantificationOp*>(*it))->setValues(2); + (*it)->operator()(ws); + } + } + _img = dynamic_cast<StandardImageWindow*>(ws->getCurrentImageWindow()); + + FileService* fs = dynamic_cast<FileService*>(gi->getService(GenericInterface::FILE_SERVICE)); + fs->save("res/test_quantization_nonLinearMean_Value_barba_2.bmp"); +} + +void TestGui::testQuantifOpNonLinearMean3(){ + WindowService* ws = dynamic_cast<WindowService*>(gi->getService(GenericInterface::WINDOW_SERVICE)); + ws->addFile(QString("src/test_quantization_berber.bmp")); + + std::vector<GenericOperation*> opvect = _image->getOperations(); + std::vector<GenericOperation*>::iterator it; + + for (it = opvect.begin() ; it != opvect.end(); ++it){ + if((*it)->getName()=="Quantification"){ + (dynamic_cast<QuantificationOp*>(*it))->setTest(true); + (dynamic_cast<QuantificationOp*>(*it))->setQuantif(2); + (dynamic_cast<QuantificationOp*>(*it))->setValues(3); + (*it)->operator()(ws); + } + } + + _img = dynamic_cast<StandardImageWindow*>(ws->getCurrentImageWindow()); + + FileService* fs = dynamic_cast<FileService*>(gi->getService(GenericInterface::FILE_SERVICE)); + fs->save("res/test_quantization_nonLinearMean_Value_berber_3.bmp"); +} + +void TestGui::testQuantifOpNonLinearMean5(){ + WindowService* ws = dynamic_cast<WindowService*>(gi->getService(GenericInterface::WINDOW_SERVICE)); + ws->addFile(QString("src/test_quantization_imao5.bmp")); + + std::vector<GenericOperation*> opvect = _image->getOperations(); + std::vector<GenericOperation*>::iterator it; + + for (it = opvect.begin() ; it != opvect.end(); ++it){ + if((*it)->getName()=="Quantification"){ + (dynamic_cast<QuantificationOp*>(*it))->setTest(true); + (dynamic_cast<QuantificationOp*>(*it))->setQuantif(2); + (dynamic_cast<QuantificationOp*>(*it))->setValues(5); + (*it)->operator()(ws); + } + } + + _img = dynamic_cast<StandardImageWindow*>(ws->getCurrentImageWindow()); + + FileService* fs = dynamic_cast<FileService*>(gi->getService(GenericInterface::FILE_SERVICE)); + fs->save("res/test_quantization_nonLinearMean_Value_imao5_5.bmp"); + +} + +void TestGui::testQuantifOpNonLinearMean16(){ + WindowService* ws = dynamic_cast<WindowService*>(gi->getService(GenericInterface::WINDOW_SERVICE)); + ws->addFile(QString("src/test_quantization_monarch.bmp")); + + std::vector<GenericOperation*> opvect = _image->getOperations(); + std::vector<GenericOperation*>::iterator it; + + for (it = opvect.begin() ; it != opvect.end(); ++it){ + if((*it)->getName()=="Quantification"){ + (dynamic_cast<QuantificationOp*>(*it))->setTest(true); + (dynamic_cast<QuantificationOp*>(*it))->setQuantif(2); + (dynamic_cast<QuantificationOp*>(*it))->setValues(16); + (*it)->operator()(ws); + } + } + + _img = dynamic_cast<StandardImageWindow*>(ws->getCurrentImageWindow()); + + FileService* fs = dynamic_cast<FileService*>(gi->getService(GenericInterface::FILE_SERVICE)); + fs->save("res/test_quantization_nonLinearMean_Value_monarch_16.bmp"); +} + +void TestGui::testTranslateOpPos(){ + WindowService* ws = dynamic_cast<WindowService*>(gi->getService(GenericInterface::WINDOW_SERVICE)); + ws->addFile(QString("src/test_imageop_cdm.bmp")); + + std::vector<GenericOperation*> opvect = _image->getOperations(); + std::vector<GenericOperation*>::iterator it; + + for (it = opvect.begin() ; it != opvect.end(); ++it){ + if((*it)->getName()=="Translation"){ + (dynamic_cast<TranslateOp*>(*it))->setTest(true); + (dynamic_cast<TranslateOp*>(*it))->setXVal(100); + (dynamic_cast<TranslateOp*>(*it))->setYVal(50); + (*it)->operator()(ws); + } + } + _img = dynamic_cast<StandardImageWindow*>(ws->getCurrentImageWindow()); + + FileService* fs = dynamic_cast<FileService*>(gi->getService(GenericInterface::FILE_SERVICE)); + fs->save("res/test_translation_result_cdm_100_50.bmp"); +} + +void TestGui::testTranslateOpNeg(){ + WindowService* ws = dynamic_cast<WindowService*>(gi->getService(GenericInterface::WINDOW_SERVICE)); + ws->addFile(QString("src/test_imageop_cdm.bmp")); + + std::vector<GenericOperation*> opvect = _image->getOperations(); + std::vector<GenericOperation*>::iterator it; + + for (it = opvect.begin() ; it != opvect.end(); ++it){ + if((*it)->getName()=="Translation"){ + (dynamic_cast<TranslateOp*>(*it))->setTest(true); + (dynamic_cast<TranslateOp*>(*it))->setXVal(-100); + (dynamic_cast<TranslateOp*>(*it))->setYVal(-50); + (*it)->operator()(ws); + } + } + + _img = dynamic_cast<StandardImageWindow*>(ws->getCurrentImageWindow()); + + FileService* fs = dynamic_cast<FileService*>(gi->getService(GenericInterface::FILE_SERVICE)); + fs->save("res/test_translation_result_cdm_-100_-50.bmp"); +} + +void TestGui::testRotateOpCwise(){ + WindowService* ws = dynamic_cast<WindowService*>(gi->getService(GenericInterface::WINDOW_SERVICE)); + ws->addFile(QString("src/test_imageop_cdm.bmp")); + + std::vector<GenericOperation*> opvect = _image->getOperations(); + std::vector<GenericOperation*>::iterator it; + + for (it = opvect.begin() ; it != opvect.end(); ++it){ + if((*it)->getName()=="Rotation"){ + (dynamic_cast<RotateOp*>(*it))->setTest(true); + (dynamic_cast<RotateOp*>(*it))->setAngle(-30.0); + (*it)->operator()(ws); + } + } + _img = dynamic_cast<StandardImageWindow*>(ws->getCurrentImageWindow()); + + FileService* fs = dynamic_cast<FileService*>(gi->getService(GenericInterface::FILE_SERVICE)); + fs->save("res/test_rotation_result_cdm_clkwise_-30.bmp"); } -void TestGui::testThresholdOp(){ +void TestGui::testRotateOpACwise(){ + WindowService* ws = dynamic_cast<WindowService*>(gi->getService(GenericInterface::WINDOW_SERVICE)); + ws->addFile(QString("src/test_imageop_cdm.bmp")); + + std::vector<GenericOperation*> opvect = _image->getOperations(); + std::vector<GenericOperation*>::iterator it; + + for (it = opvect.begin() ; it != opvect.end(); ++it){ + if((*it)->getName()=="Rotation"){ + (dynamic_cast<RotateOp*>(*it))->setTest(true); + (dynamic_cast<RotateOp*>(*it))->setAngle(30.0); + (*it)->operator()(ws); + } + } + + _img = dynamic_cast<StandardImageWindow*>(ws->getCurrentImageWindow()); + + FileService* fs = dynamic_cast<FileService*>(gi->getService(GenericInterface::FILE_SERVICE)); + fs->save("res/test_rotation_result_cdm_anticlkwise_30.bmp"); +} + +void TestGui::testFlipOpHor(){ + WindowService* ws = dynamic_cast<WindowService*>(gi->getService(GenericInterface::WINDOW_SERVICE)); + ws->addFile(QString("src/test_imageop_cdm.bmp")); + + std::vector<GenericOperation*> opvect = _image->getOperations(); + std::vector<GenericOperation*>::iterator it; + + for (it = opvect.begin() ; it != opvect.end(); ++it){ + if((*it)->getName()=="Flip horizontal"){ + (*it)->operator()(ws); + } + } + + _img = dynamic_cast<StandardImageWindow*>(ws->getCurrentImageWindow()); + + FileService* fs = dynamic_cast<FileService*>(gi->getService(GenericInterface::FILE_SERVICE)); + fs->save("res/test_flip_result_cdm_horizontal.bmp"); +} + +void TestGui::testFlipOpVer(){ + WindowService* ws = dynamic_cast<WindowService*>(gi->getService(GenericInterface::WINDOW_SERVICE)); + ws->addFile(QString("src/test_imageop_cdm.bmp")); + + std::vector<GenericOperation*> opvect = _image->getOperations(); + std::vector<GenericOperation*>::iterator it; + + for (it = opvect.begin() ; it != opvect.end(); ++it){ + if((*it)->getName()=="Flip vertical"){ + (*it)->operator()(ws); + } + } + + _img = dynamic_cast<StandardImageWindow*>(ws->getCurrentImageWindow()); + + FileService* fs = dynamic_cast<FileService*>(gi->getService(GenericInterface::FILE_SERVICE)); + fs->save("res/test_flip_result_cdm_vertical.bmp"); +} + +void TestGui::testScalingOpBilinear(){ + WindowService* ws = dynamic_cast<WindowService*>(gi->getService(GenericInterface::WINDOW_SERVICE)); + ws->addFile(QString("src/test_scaling_toinou.bmp")); + + std::vector<GenericOperation*> opvect = _image->getOperations(); + std::vector<GenericOperation*>::iterator it; + + for (it = opvect.begin() ; it != opvect.end(); ++it){ + if((*it)->getName()=="Scaling"){ + (dynamic_cast<ScalingOp*>(*it))->setTest(true); + (dynamic_cast<ScalingOp*>(*it))->setInterpolation(1); + (dynamic_cast<ScalingOp*>(*it))->setXFactor(2.0); + (dynamic_cast<ScalingOp*>(*it))->setYFactor(1.0); + (*it)->operator()(ws); + } + } + + _img = dynamic_cast<StandardImageWindow*>(ws->getCurrentImageWindow()); + + FileService* fs = dynamic_cast<FileService*>(gi->getService(GenericInterface::FILE_SERVICE)); + fs->save("res/test_scaling_result_toinou_x2_y1_bilinear.bmp"); +} + +void TestGui::testScalingOpNearest(){ + WindowService* ws = dynamic_cast<WindowService*>(gi->getService(GenericInterface::WINDOW_SERVICE)); + ws->addFile(QString("src/test_scaling_toinou.bmp")); + + std::vector<GenericOperation*> opvect = _image->getOperations(); + std::vector<GenericOperation*>::iterator it; + + for (it = opvect.begin() ; it != opvect.end(); ++it){ + if((*it)->getName()=="Scaling"){ + (dynamic_cast<ScalingOp*>(*it))->setTest(true); + (dynamic_cast<ScalingOp*>(*it))->setInterpolation(0); + (dynamic_cast<ScalingOp*>(*it))->setXFactor(0.2); + (dynamic_cast<ScalingOp*>(*it))->setYFactor(0.2); + (*it)->operator()(ws); + } + } + //cout << "ouagzeruvhe _________________________________________##################\n"; + _img = dynamic_cast<StandardImageWindow*>(ws->getCurrentImageWindow()); +// cout << "ouagzeruvhe _________________________________________333333333333333333\n"; + FileService* fs = dynamic_cast<FileService*>(gi->getService(GenericInterface::FILE_SERVICE)); + fs->save("res/test_scaling_result_toinou_x0.2_y0.2_nearest.bmp"); +} + + + +void TestGui::testCompThreshold(){ + WindowService* ws = dynamic_cast<WindowService*>(gi->getService(GenericInterface::WINDOW_SERVICE)); + + const Image* res = new Image("ref/test_thresholding_result_otsuMansion_otsu.jpg"); + const Image* ref = new Image("res/test_thresholding_otsuMansion.vff"); + + for(unsigned int i = 0; i < res->getHeight(); i++) + for(unsigned int j = 0; j < res->getWidth(); j++) + for(unsigned int nb = 0; nb < res->getNbChannels(); nb++) { + QCOMPARE((int)res->getPixel(j, i, nb) , (int) ref->getPixel(j, i, nb)); + } + + res = new Image("ref/test_thresholding_result_imao5_127.jpg"); + ref = new Image("res/test_thresholding_imao5.vff"); + + for(unsigned int i = 0; i < res->getHeight(); i++) + for(unsigned int j = 0; j < res->getWidth(); j++) + for(unsigned int nb = 0; nb < res->getNbChannels(); nb++) { + QCOMPARE((int)res->getPixel(j, i, nb) , (int) ref->getPixel(j, i, nb)); + } +} + + + +/* L'idée serait de split les tests en deux fichiers deux tests; le premier (celui ci) + servirait à créer les images issues des opérations, qui seraient stockées dans le directory + res; issues du directory src. + + La seconde classe comparerait les images créées à l'aide de matlab considérées comme références, + dans le dossier ref à celles du fichier res. Le tout se ferait à la suite mais à l'issu du même + appel à la classe de test. + + On aurait donc un testAlgo et un testComp, qui pour la même opé threshold feraient: + testAlgo -> testThresholdOp + testComp -> testResThresholdOp + +*/ +void TestGui::testCompQuant(){ + +} + +void TestGui::testMenuActions(){ + // dans ce test on peut vérifier que les menus contiennent bien ce qu'ils sont sensés contenir + // En accédant aux actions du menu et en les listant simplement. WindowService* ws = dynamic_cast<WindowService*>(gi->getService(GenericInterface::WINDOW_SERVICE)); - ws->addFile(QString("test.jpg")); + _img = dynamic_cast<StandardImageWindow*>(ws->getCurrentImageWindow()); QMenu* imagemenu = gi->menu("&Image"); - QList<QAction*> list = imagemenu->actions(); - for( int i=0; i<list.count(); ++i ) + std::cout << _img->getPath().toStdString() << "\n"; + imagemenu->menuAction()->trigger(); + for( int i=0; i<imagemenu->actions().count(); ++i ) { - std::cout << list[i]->text().toStdString() << "\n"; - list[i]->trigger(); - std::cout << i << " passed\n"; + std::cout << (imagemenu->actions())[i]->text().toStdString() << "\n"; } + } QTEST_MAIN(TestGui) diff --git a/test/testgui.moc b/test/testgui.moc index 0c96d443baa4fe0b7d8d0ddefa4915a02d0268a0..5b97a64d33db63266007d257a252b068c9b3b53b 100644 --- a/test/testgui.moc +++ b/test/testgui.moc @@ -18,8 +18,8 @@ QT_BEGIN_MOC_NAMESPACE struct qt_meta_stringdata_TestGui_t { - QByteArrayData data[7]; - char stringdata0[112]; + QByteArrayData data[36]; + char stringdata0[803]; }; #define QT_MOC_LITERAL(idx, ofs, len) \ Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ @@ -32,14 +32,64 @@ QT_MOC_LITERAL(0, 0, 7), // "TestGui" QT_MOC_LITERAL(1, 8, 25), // "testGenericInterfaceSetup" QT_MOC_LITERAL(2, 34, 0), // "" QT_MOC_LITERAL(3, 35, 24), // "testWindowServiceAddFile" -QT_MOC_LITERAL(4, 60, 19), // "testFileServiceSave" -QT_MOC_LITERAL(5, 80, 15), // "testRemoveImage" -QT_MOC_LITERAL(6, 96, 15) // "testThresholdOp" +QT_MOC_LITERAL(4, 60, 15), // "testMenuActions" +QT_MOC_LITERAL(5, 76, 19), // "testFileServiceSave" +QT_MOC_LITERAL(6, 96, 15), // "testRemoveImage" +QT_MOC_LITERAL(7, 112, 19), // "testThresholdOpOtsu" +QT_MOC_LITERAL(8, 132, 18), // "testThresholdOp127" +QT_MOC_LITERAL(9, 151, 21), // "testThresholdOpDouble" +QT_MOC_LITERAL(10, 173, 28), // "testQuantifOpLinearCentered2" +QT_MOC_LITERAL(11, 202, 28), // "testQuantifOpLinearCentered3" +QT_MOC_LITERAL(12, 231, 28), // "testQuantifOpLinearCentered5" +QT_MOC_LITERAL(13, 260, 29), // "testQuantifOpLinearCentered16" +QT_MOC_LITERAL(14, 290, 22), // "testQuantifOpLloydMax2" +QT_MOC_LITERAL(15, 313, 22), // "testQuantifOpLloydMax3" +QT_MOC_LITERAL(16, 336, 22), // "testQuantifOpLloydMax5" +QT_MOC_LITERAL(17, 359, 23), // "testQuantifOpLloydMax16" +QT_MOC_LITERAL(18, 383, 31), // "testQuantifOpNonLinearCentered2" +QT_MOC_LITERAL(19, 415, 31), // "testQuantifOpNonLinearCentered3" +QT_MOC_LITERAL(20, 447, 31), // "testQuantifOpNonLinearCentered5" +QT_MOC_LITERAL(21, 479, 32), // "testQuantifOpNonLinearCentered16" +QT_MOC_LITERAL(22, 512, 27), // "testQuantifOpNonLinearMean2" +QT_MOC_LITERAL(23, 540, 27), // "testQuantifOpNonLinearMean3" +QT_MOC_LITERAL(24, 568, 27), // "testQuantifOpNonLinearMean5" +QT_MOC_LITERAL(25, 596, 28), // "testQuantifOpNonLinearMean16" +QT_MOC_LITERAL(26, 625, 18), // "testTranslateOpPos" +QT_MOC_LITERAL(27, 644, 18), // "testTranslateOpNeg" +QT_MOC_LITERAL(28, 663, 17), // "testRotateOpCwise" +QT_MOC_LITERAL(29, 681, 18), // "testRotateOpACwise" +QT_MOC_LITERAL(30, 700, 13), // "testFlipOpHor" +QT_MOC_LITERAL(31, 714, 13), // "testFlipOpVer" +QT_MOC_LITERAL(32, 728, 21), // "testScalingOpBilinear" +QT_MOC_LITERAL(33, 750, 20), // "testScalingOpNearest" +QT_MOC_LITERAL(34, 771, 13), // "testCompQuant" +QT_MOC_LITERAL(35, 785, 17) // "testCompThreshold" }, "TestGui\0testGenericInterfaceSetup\0\0" - "testWindowServiceAddFile\0testFileServiceSave\0" - "testRemoveImage\0testThresholdOp" + "testWindowServiceAddFile\0testMenuActions\0" + "testFileServiceSave\0testRemoveImage\0" + "testThresholdOpOtsu\0testThresholdOp127\0" + "testThresholdOpDouble\0" + "testQuantifOpLinearCentered2\0" + "testQuantifOpLinearCentered3\0" + "testQuantifOpLinearCentered5\0" + "testQuantifOpLinearCentered16\0" + "testQuantifOpLloydMax2\0testQuantifOpLloydMax3\0" + "testQuantifOpLloydMax5\0testQuantifOpLloydMax16\0" + "testQuantifOpNonLinearCentered2\0" + "testQuantifOpNonLinearCentered3\0" + "testQuantifOpNonLinearCentered5\0" + "testQuantifOpNonLinearCentered16\0" + "testQuantifOpNonLinearMean2\0" + "testQuantifOpNonLinearMean3\0" + "testQuantifOpNonLinearMean5\0" + "testQuantifOpNonLinearMean16\0" + "testTranslateOpPos\0testTranslateOpNeg\0" + "testRotateOpCwise\0testRotateOpACwise\0" + "testFlipOpHor\0testFlipOpVer\0" + "testScalingOpBilinear\0testScalingOpNearest\0" + "testCompQuant\0testCompThreshold" }; #undef QT_MOC_LITERAL @@ -49,7 +99,7 @@ static const uint qt_meta_data_TestGui[] = { 7, // revision 0, // classname 0, 0, // classinfo - 5, 14, // methods + 34, 14, // methods 0, 0, // properties 0, 0, // enums/sets 0, 0, // constructors @@ -57,13 +107,71 @@ static const uint qt_meta_data_TestGui[] = { 0, // signalCount // slots: name, argc, parameters, tag, flags - 1, 0, 39, 2, 0x08 /* Private */, - 3, 0, 40, 2, 0x08 /* Private */, - 4, 0, 41, 2, 0x08 /* Private */, - 5, 0, 42, 2, 0x08 /* Private */, - 6, 0, 43, 2, 0x08 /* Private */, + 1, 0, 184, 2, 0x08 /* Private */, + 3, 0, 185, 2, 0x08 /* Private */, + 4, 0, 186, 2, 0x08 /* Private */, + 5, 0, 187, 2, 0x08 /* Private */, + 6, 0, 188, 2, 0x08 /* Private */, + 7, 0, 189, 2, 0x08 /* Private */, + 8, 0, 190, 2, 0x08 /* Private */, + 9, 0, 191, 2, 0x08 /* Private */, + 10, 0, 192, 2, 0x08 /* Private */, + 11, 0, 193, 2, 0x08 /* Private */, + 12, 0, 194, 2, 0x08 /* Private */, + 13, 0, 195, 2, 0x08 /* Private */, + 14, 0, 196, 2, 0x08 /* Private */, + 15, 0, 197, 2, 0x08 /* Private */, + 16, 0, 198, 2, 0x08 /* Private */, + 17, 0, 199, 2, 0x08 /* Private */, + 18, 0, 200, 2, 0x08 /* Private */, + 19, 0, 201, 2, 0x08 /* Private */, + 20, 0, 202, 2, 0x08 /* Private */, + 21, 0, 203, 2, 0x08 /* Private */, + 22, 0, 204, 2, 0x08 /* Private */, + 23, 0, 205, 2, 0x08 /* Private */, + 24, 0, 206, 2, 0x08 /* Private */, + 25, 0, 207, 2, 0x08 /* Private */, + 26, 0, 208, 2, 0x08 /* Private */, + 27, 0, 209, 2, 0x08 /* Private */, + 28, 0, 210, 2, 0x08 /* Private */, + 29, 0, 211, 2, 0x08 /* Private */, + 30, 0, 212, 2, 0x08 /* Private */, + 31, 0, 213, 2, 0x08 /* Private */, + 32, 0, 214, 2, 0x08 /* Private */, + 33, 0, 215, 2, 0x08 /* Private */, + 34, 0, 216, 2, 0x08 /* Private */, + 35, 0, 217, 2, 0x08 /* Private */, // slots: parameters + QMetaType::Void, + QMetaType::Void, + QMetaType::Void, + QMetaType::Void, + QMetaType::Void, + QMetaType::Void, + QMetaType::Void, + QMetaType::Void, + QMetaType::Void, + QMetaType::Void, + QMetaType::Void, + QMetaType::Void, + QMetaType::Void, + QMetaType::Void, + QMetaType::Void, + QMetaType::Void, + QMetaType::Void, + QMetaType::Void, + QMetaType::Void, + QMetaType::Void, + QMetaType::Void, + QMetaType::Void, + QMetaType::Void, + QMetaType::Void, + QMetaType::Void, + QMetaType::Void, + QMetaType::Void, + QMetaType::Void, + QMetaType::Void, QMetaType::Void, QMetaType::Void, QMetaType::Void, @@ -81,9 +189,38 @@ void TestGui::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, voi switch (_id) { case 0: _t->testGenericInterfaceSetup(); break; case 1: _t->testWindowServiceAddFile(); break; - case 2: _t->testFileServiceSave(); break; - case 3: _t->testRemoveImage(); break; - case 4: _t->testThresholdOp(); break; + case 2: _t->testMenuActions(); break; + case 3: _t->testFileServiceSave(); break; + case 4: _t->testRemoveImage(); break; + case 5: _t->testThresholdOpOtsu(); break; + case 6: _t->testThresholdOp127(); break; + case 7: _t->testThresholdOpDouble(); break; + case 8: _t->testQuantifOpLinearCentered2(); break; + case 9: _t->testQuantifOpLinearCentered3(); break; + case 10: _t->testQuantifOpLinearCentered5(); break; + case 11: _t->testQuantifOpLinearCentered16(); break; + case 12: _t->testQuantifOpLloydMax2(); break; + case 13: _t->testQuantifOpLloydMax3(); break; + case 14: _t->testQuantifOpLloydMax5(); break; + case 15: _t->testQuantifOpLloydMax16(); break; + case 16: _t->testQuantifOpNonLinearCentered2(); break; + case 17: _t->testQuantifOpNonLinearCentered3(); break; + case 18: _t->testQuantifOpNonLinearCentered5(); break; + case 19: _t->testQuantifOpNonLinearCentered16(); break; + case 20: _t->testQuantifOpNonLinearMean2(); break; + case 21: _t->testQuantifOpNonLinearMean3(); break; + case 22: _t->testQuantifOpNonLinearMean5(); break; + case 23: _t->testQuantifOpNonLinearMean16(); break; + case 24: _t->testTranslateOpPos(); break; + case 25: _t->testTranslateOpNeg(); break; + case 26: _t->testRotateOpCwise(); break; + case 27: _t->testRotateOpACwise(); break; + case 28: _t->testFlipOpHor(); break; + case 29: _t->testFlipOpVer(); break; + case 30: _t->testScalingOpBilinear(); break; + case 31: _t->testScalingOpNearest(); break; + case 32: _t->testCompQuant(); break; + case 33: _t->testCompThreshold(); break; default: ; } } @@ -115,13 +252,13 @@ int TestGui::qt_metacall(QMetaObject::Call _c, int _id, void **_a) if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { - if (_id < 5) + if (_id < 34) qt_static_metacall(this, _c, _id, _a); - _id -= 5; + _id -= 34; } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { - if (_id < 5) + if (_id < 34) *reinterpret_cast<int*>(_a[0]) = -1; - _id -= 5; + _id -= 34; } return _id; }