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 #ifndef CIMG_BLUR_BILATERAL_H
31 #define CIMG_BLUR_BILATERAL_H
32 
33 #include <assert.h>
34 #include <string>
35 
36 #include <sstream>
37 //#define SSTR( x ) dynamic_cast< std::ostringstream & >( \
38 //        ( std::ostringstream() << std::dec << x ) ).str()
39 
40 
41 #include "../base/processor.hh"
42 
43 
44 namespace PF
45 {
46 
47   class GMicPar: public OpParBase
48   {
49     ProcessorBase* convert_format;
50     ProcessorBase* convert_format2;
51 
52     Property<int> iterations;
53     Property<std::string> command;
54     Property<std::string> post_command;
55     Property<int> padding;
56     Property<float> x_scale;
57     Property<float> y_scale;
58 
59     bool cache_tiles;
60 
61   public:
62     GMicPar();
~GMicPar()63     ~GMicPar() {
64       delete convert_format;
65       delete convert_format2;
66     }
67 
has_intensity()68     bool has_intensity() { return false; }
has_opacity()69     bool has_opacity() { return true; }
70 
set_command(std::string cmd)71     void set_command( std::string cmd ) { command.set( cmd ); }
set_post_command(std::string cmd)72     void set_post_command( std::string cmd ) { post_command.set( cmd ); }
set_iterations(int it)73     void set_iterations( int it ) { iterations.set( it ); };
set_gmic_padding(int p)74     void set_gmic_padding( int p ) { padding.set( p ); };
get_gmic_padding()75     int get_gmic_padding() { return padding.get(); };
set_x_scale(float xs)76     void set_x_scale(float xs ) { x_scale.set( xs ); }
set_y_scale(float ys)77     void set_y_scale(float ys ) { x_scale.set( ys ); }
78 
set_cache_tiles(bool flag)79     void set_cache_tiles( bool flag ) { cache_tiles = flag; }
80 
81 
82     VipsImage* build(std::vector<VipsImage*>& in, int first,
83 		     VipsImage* imap, VipsImage* omap,
84 		     unsigned int& level);
85   };
86 
87 
88 
89   template < OP_TEMPLATE_DEF >
90   class GMicProc
91   {
92   public:
render(VipsRegion ** ireg,int n,int in_first,VipsRegion * imap,VipsRegion * omap,VipsRegion * oreg,OpParBase * par)93     void render(VipsRegion** ireg, int n, int in_first,
94 		VipsRegion* imap, VipsRegion* omap,
95 		VipsRegion* oreg, OpParBase* par)
96     {
97 
98     }
99   };
100 
101 
102 
103 
104   ProcessorBase* new_gmic();
105 }
106 
107 #endif
108 
109 
110