Пример #1
0
QIcon IconProvider::icon (const QFileInfo &info) const
{
    // Don't get stuck on large images.
    const qint64 maxSize = 131072;
    if (loadCheck(info) && info.size() < maxSize) {
        const QImage image = loadImage(info.absoluteFilePath());
        if (!image.isNull())
            return QIcon(QPixmap::fromImage(image, Qt::ThresholdDither|Qt::AutoColor));
    }
    return QFileIconProvider::icon(info);
}
Пример #2
0
void MainWindow::facedetect()
{
    if (!loadCheck()) {
        return;
    }

    savePrevStatus();
    
    if (!facedetectDlg) {
        facedetectDlg = new FacedetectDialog(cur_img,this);

        connect(facedetectDlg, SIGNAL(statusChanged()), this, SLOT(disp_image())); 
        connect(facedetectDlg, SIGNAL(dialogClosed()), this, SLOT(clean_facedetect()));
    }
    facedetectDlg->show();
    facedetectDlg->activateWindow();
}
Пример #3
0
void MainWindow::bluropt()
{
    if (!loadCheck()) {
        return;
    }

    savePrevStatus();
    
    if (!blurDlg) {
        blurDlg = new BlurDialog(cur_img, this);

        connect(blurDlg, SIGNAL(statusChanged()), this, SLOT(disp_image()));
        connect(blurDlg, SIGNAL(dialogClosed()), this, SLOT(clean_bluropt()));
    }
    blurDlg->show();
    blurDlg->activateWindow();
}
Пример #4
0
void MainWindow::morphology()
{
    if (!loadCheck()) {
        return;
    }

    savePrevStatus();
    
    if (!morphDlg) {
        morphDlg = new MorphologyDialog(cur_img, this);

        connect(morphDlg, SIGNAL(statusChanged()), this, SLOT(disp_image()));
        connect(morphDlg, SIGNAL(dialogClosed()), this, SLOT(clean_morphology()));
    }
    morphDlg->show();
    morphDlg->activateWindow();
}
Пример #5
0
void MainWindow::houghcheck()
{
    if (!loadCheck()) {
        return;
    }

    savePrevStatus();
    
    if (!houghDlg) {
        houghDlg = new HoughDialog(cur_img, this);

        connect(houghDlg, SIGNAL(statusChanged()), this, SLOT(disp_image()));
        connect(houghDlg, SIGNAL(dialogClosed()), this, SLOT(clean_houghcheck()));
    }
    houghDlg->show();
    houghDlg->activateWindow();
}
Пример #6
0
void MainWindow::powertf()
{
    // img.copyTo(cur_img);
    if (!loadCheck()) {
        return;
    }

    savePrevStatus();
    
    if (!powertfDlg) {
        powertfDlg = new PowertfDialog(cur_img,this);

        connect(powertfDlg, SIGNAL(statusChanged()), this, SLOT(disp_image())); 
        connect(powertfDlg, SIGNAL(powertfClosed()), this, SLOT(clean_powertf()));
    }
    powertfDlg->show();
    powertfDlg->activateWindow();
}
Пример #7
0
bool MainWindow::save()
{
    if (!loadCheck()) {
        return false;
    }

    QString fileName = QFileDialog::getSaveFileName(this,tr("Save Image"),".", "*.*"); //tr("*.jpg"));

    if (fileName.isEmpty()) {
        return false;
    } else {
        string fn = fileName.toStdString();
        if (!fileName.contains(".")) {
           fn += ".jpg"; 
        }
        imwrite(fn,cur_img);
        return true;
    }
}