[TASK] Add button to save working copy to original image.
This commit is contained in:
parent
1109fda972
commit
e9a397e57a
@ -109,6 +109,25 @@ void ImageViewer::resetWorkingCopy() {
|
||||
renewLogging();
|
||||
}
|
||||
|
||||
/**
|
||||
* No big performance, but simple.
|
||||
* Save working copy to original image.
|
||||
*
|
||||
* @brief ImageViewer::saveToOriginal
|
||||
*/
|
||||
void ImageViewer::saveToOriginal() {
|
||||
logFile << "Saving working copy to original ...";
|
||||
renewLogging();
|
||||
for(int x=0; x<original->getImage()->width(); x++) {
|
||||
for(int y=0; y<original->getImage()->height(); y++) {
|
||||
original->getImage()->setPixel(x, y, working_copy->getImage()->pixel(x, y));
|
||||
}
|
||||
}
|
||||
updateImageDisplay();
|
||||
logFile << "done." << std::endl;
|
||||
renewLogging();
|
||||
}
|
||||
|
||||
/**
|
||||
* Draws a simple, black line.
|
||||
* @brief ImageViewer::drawBlackLine
|
||||
@ -364,6 +383,10 @@ void ImageViewer::generateControlPanels() {
|
||||
reset_working_copy->setText("Reset working copy");
|
||||
QObject::connect(reset_working_copy, SIGNAL(clicked()), this, SLOT (resetWorkingCopy()));
|
||||
|
||||
save_to_original = new QPushButton();
|
||||
save_to_original->setText("Save working copy to original");
|
||||
QObject::connect(save_to_original, SIGNAL(clicked()), this, SLOT (saveToOriginal()));
|
||||
|
||||
draw_black_line = new QPushButton();
|
||||
draw_black_line->setText("Draw a black line");
|
||||
QObject::connect(draw_black_line, SIGNAL(clicked()), this, SLOT (drawBlackLine()));
|
||||
@ -383,12 +406,12 @@ void ImageViewer::generateControlPanels() {
|
||||
//QObject::connect(lineSlider, SIGNAL(valueChanged(int)), this, SLOT (drawRainbowCross()));
|
||||
|
||||
task_tab1->addWidget(reset_working_copy);
|
||||
task_tab1->addWidget(save_to_original);
|
||||
task_tab1->addWidget(monochrome);
|
||||
task_tab1->addWidget(new QLabel("Let's draw something!"));
|
||||
task_tab1->addWidget(draw_black_line);
|
||||
task_tab1->addWidget(draw_rainbow_cross);
|
||||
task_tab1->addWidget(diagonal_cross);
|
||||
task_tab1->addWidget(new QLabel("This will not stop unless process is killed."));
|
||||
task_tab1->addWidget(line_slider);
|
||||
task_tab1->addWidget(new QLabel("Sets the width of the cross."));
|
||||
|
||||
|
@ -80,7 +80,8 @@ class ImageViewer : public QMainWindow {
|
||||
QPushButton* diagonal_cross;
|
||||
QPushButton* monochrome;
|
||||
QPushButton* reset_working_copy;
|
||||
|
||||
QPushButton* save_to_original;
|
||||
|
||||
QSlider* line_slider;
|
||||
|
||||
// Second task tab
|
||||
@ -121,6 +122,7 @@ class ImageViewer : public QMainWindow {
|
||||
void adjustContrast(int c);
|
||||
void convertToMonochrome();
|
||||
void resetWorkingCopy();
|
||||
void saveToOriginal();
|
||||
void robustAutomaticContrastAdaption(int c_param);
|
||||
void linearHistogrammAdaption();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user