-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmainwindow.cpp
More file actions
72 lines (54 loc) · 1.41 KB
/
mainwindow.cpp
File metadata and controls
72 lines (54 loc) · 1.41 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "ocultar.h"
#include <QFileDialog>
#include <QDebug>
#include "acercade.h"
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
}
//EXPLORADOR DE ARCHIVOS
QString ruta;
void MainWindow::on_pushButton_3_clicked()
{
QString fileName = QFileDialog::getOpenFileName(this, tr("Open File"),
"",
tr("Files (*)"));
ruta=fileName;
ui->lineEdit_3->insert(ruta);
}
void MainWindow::on_pushButton_revelar_clicked()
{
unsigned char buffer[1000000];
char frase[1000000];
int filas, columnas;
TipoImagen img;
//imagen a revelar
img = LeerTipoImagen(ruta.toStdString().c_str(),filas,columnas);
const char* rutac= ruta.toStdString().c_str();
qDebug() << img;
if( img == IMG_PGM){
LeerImagenPGM(rutac,filas,columnas,buffer);
Revelar(buffer,frase);
}
else if( img == IMG_PPM){
LeerImagenPPM(rutac,filas,columnas,buffer);
Revelar(buffer,frase);
}
QString fraseq(frase);
ui->textBrowser->setText(fraseq);
}
MainWindow::~MainWindow()
{
delete ui;
}
void MainWindow::on_actionAcerca_de_triggered()
{
AcercaDe *ventanaAcerca = new AcercaDe(this);
ventanaAcerca->setModal(true);
ventanaAcerca->setFixedSize(ventanaAcerca->size());
ventanaAcerca->show();
}