Exemple #1
0
 /* Image filtering on save/load */
 void
 applyCustomFilter(PLBmp & theBitmap, const VectorOfString & theFilterName, const VectorOfVectorOfFloat & theFilterparams) {
     if (theFilterName.size() != theFilterparams.size()) {
         throw ImageLoaderException(std::string("Sorry, filter and params count do not match."), PLUS_FILE_LINE);
     }
     for (VectorOfString::size_type myFilterIndex = 0; myFilterIndex < theFilterName.size(); myFilterIndex++) {
         applyCustomFilter(theBitmap, theFilterName[myFilterIndex], theFilterparams[myFilterIndex]);
     }
 }
Exemple #2
0
 void
 applyCustomFilter(PLBmp & theBitmap, const std::string & theFilterName, const VectorOfFloat & theFilterparams) {
     asl::Ptr<PLFilter> myPaintLibFilter = y60::PaintLibFilterFactory::get().createFilter(theFilterName,
                                                                                          theFilterparams);
     if (myPaintLibFilter) {
         theBitmap.ApplyFilter(*myPaintLibFilter);
     } else {
         ImageFilter myFilter = ImageFilter(getEnumFromString(theFilterName, ImageFilterStrings));
         applyCustomFilter(theBitmap, myFilter, theFilterparams);
     }
 }
void MainWindow::on_actionCustom_triggered()
{
    kernelUI = new customKernel(this);
    connect(kernelUI, SIGNAL(sendKernel(cv::Mat)), this, SLOT(applyCustomFilter(cv::Mat)));
    kernelUI->show();
}