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 GMIC_BLUR_BILATERAL_H
31 #define GMIC_BLUR_BILATERAL_H
32 
33 #include <assert.h>
34 #include <string>
35 
36 #include "../base/processor.hh"
37 #include "gmic.hh"
38 
39 
40 namespace PF
41 {
42 
43   class GmicBlurBilateralPar: public GMicPar
44   {
45     //Property<int> iterations;
46     Property<float> sigma_s;
47     Property<float> sigma_r;
48     Property<int> bgrid_s;
49     Property<int> bgrid_r;
50 
51     //ProcessorBase* gmic;
52 
53     int cur_padding;
54 
55   public:
56     GmicBlurBilateralPar();
57 
58     //void set_iterations( int i ) { iterations.set( i ); }
set_sigma_s(float s)59     void set_sigma_s( float s ) { sigma_s.set( s ); }
set_sigma_r(float s)60     void set_sigma_r( float s ) { sigma_r.set( s ); }
61 
has_intensity()62     bool has_intensity() { return false; }
has_opacity()63     bool has_opacity() { return true; }
needs_caching()64     bool needs_caching() { return true; }
65 
66     int get_gmic_padding( int level );
67 
compute_padding(VipsImage * full_res,unsigned int id,unsigned int level)68     void compute_padding( VipsImage* full_res, unsigned int id, unsigned int level )
69     {
70       set_padding( get_gmic_padding(level), id);
71     }
72 
73     VipsImage* build(std::vector<VipsImage*>& in, int first,
74 		     VipsImage* imap, VipsImage* omap,
75 		     unsigned int& level);
76   };
77 
78 
79 
80   template < OP_TEMPLATE_DEF >
81   class GmicBlurBilateralProc
82   {
83   public:
render(VipsRegion ** ireg,int n,int in_first,VipsRegion * imap,VipsRegion * omap,VipsRegion * oreg,OpParBase * par)84     void render(VipsRegion** ireg, int n, int in_first,
85 		VipsRegion* imap, VipsRegion* omap,
86 		VipsRegion* oreg, OpParBase* par)
87     {
88 
89     }
90   };
91 
92 
93 
94 
95   ProcessorBase* new_gmic_blur_bilateral();
96 }
97 
98 #endif
99 
100 
101