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 PF_LOCAL_CONTRAST_V2_H
31 #define PF_LOCAL_CONTRAST_V2_H
32 
33 #include "../rt/rtengine/sleef.c"
34 #include "../base/processor.hh"
35 
36 namespace PF
37 {
38 
39   class LocalContrastV2Par: public OpParBase
40   {
41     Property<float> amount;
42     Property<float> radius, threshold, white_level, boost;
43 
44     ProcessorBase* loglumi;
45     ProcessorBase* guided[10];
46 
47     PF::ICCProfile* in_profile;
48     float threshold_scale[10];
49   public:
50     LocalContrastV2Par();
51 
has_intensity()52     bool has_intensity() { return false; }
needs_caching()53     bool needs_caching() {
54       return true;
55     }
56 
57     void compute_padding( VipsImage* full_res, unsigned int id, unsigned int level );
58     void propagate_settings();
59 
get_profile()60     PF::ICCProfile* get_profile() { return in_profile; }
get_amount()61     float get_amount() { return amount.get(); }
get_white_level()62     float get_white_level() { return white_level.get(); }
get_boost()63     float get_boost() { return boost.get(); }
64 
65     VipsImage* build(std::vector<VipsImage*>& in, int first,
66 		     VipsImage* imap, VipsImage* omap,
67 		     unsigned int& level);
68   };
69 
70 
71   ProcessorBase* new_local_contrast_v2();
72 
73 }
74 
75 #endif
76 
77 
78