1 /*
2  */
3 
4 /*
5 
6     Copyright (C) 2014 Ferrero Andrea
7 
8     This program is free software: you can redistribute it and/or modify
9     it under the terms of the GNU General Public License as published by
10     the Free Software Foundation, either version 3 of the License, or
11     (at your option) any later version.
12 
13     This program is distributed in the hope that it will be useful,
14     but WITHOUT ANY WARRANTY; without even the implied warranty of
15     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16     GNU General Public License for more details.
17 
18     You should have received a copy of the GNU General Public License
19     along with this program. If not, see <http://www.gnu.org/licenses/>.
20 
21 
22  */
23 
24 /*
25 
26     These files are distributed with PhotoFlow - http://aferrero2707.github.io/PhotoFlow/
27 
28  */
29 
30 #include "../../../operations/gmic/watermark_fourier.hh"
31 #include "watermark_fourier_config.hh"
32 
33 
GmicWatermarkFourierConfigGUI(PF::Layer * layer)34 PF::GmicWatermarkFourierConfigGUI::GmicWatermarkFourierConfigGUI( PF::Layer* layer ):
35   OperationConfigGUI( layer, "Digital Watermark" ),
36   updateButton( "Update" ),
37   textBox( this, "text", "Text: ", "Watermark" ),
38   textsizeSlider( this, "text_size", "Text size: ", 53, 13, 128, 1, 5, 1 )
39 {
40   //add_widget( updateButton );
41   add_widget( textBox );
42   add_widget( textsizeSlider );
43 
44   updateButton.signal_clicked().connect( sigc::mem_fun(this, &GmicWatermarkFourierConfigGUI::on_update) );
45 
46   //fileEntry.signal_activate().
47   //  connect(sigc::mem_fun(*this,
48   //			  &GmicWatermarkFourierConfigGUI::on_filename_changed));
49 }
50 
51 
on_update()52 void PF::GmicWatermarkFourierConfigGUI::on_update()
53 {
54   if( get_layer() && get_layer()->get_image() &&
55       get_layer()->get_processor() &&
56       get_layer()->get_processor()->get_par() ) {
57     GmicWatermarkFourierPar* par = dynamic_cast<GmicWatermarkFourierPar*>( get_layer()->get_processor()->get_par() );
58     if( !par ) return;
59     par->refresh();
60     get_layer()->get_image()->lock();
61     std::cout<<"  updating image"<<std::endl;
62     get_layer()->get_image()->update();
63     get_layer()->get_image()->unlock();
64   }
65 }
66 
67 
68 
69