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_CLAHE_H 31 #define PF_CLAHE_H 32 33 #include <string> 34 35 #include "../base/property.hh" 36 #include "../base/operation.hh" 37 #include "../base/processor.hh" 38 39 namespace PF 40 { 41 42 class CLAHEPar: public OpParBase 43 { 44 Property<int> width; 45 Property<int> slope; 46 47 public: 48 CLAHEPar(); 49 has_opacity()50 bool has_opacity() { return false; } has_intensity()51 bool has_intensity() { return false; } 52 53 /* Function to derive the output area from the input area 54 */ transform(const VipsRect * rin,VipsRect * rout,int)55 virtual void transform(const VipsRect* rin, VipsRect* rout, int /*id*/) 56 { 57 rout->left = rin->left; 58 rout->top = rin->top; 59 rout->width = rin->width; 60 rout->height = rin->height; 61 } 62 63 /* Function to derive the area to be read from input images, 64 based on the requested output area 65 */ transform_inv(const VipsRect * rout,VipsRect * rin,int)66 virtual void transform_inv(const VipsRect* rout, VipsRect* rin, int /*id*/) 67 { 68 rin->left = rout->left; 69 rin->top = rout->top; 70 rin->width = rout->width; 71 rin->height = rout->height; 72 } 73 74 75 VipsImage* build(std::vector<VipsImage*>& in, int first, 76 VipsImage* imap, VipsImage* omap, 77 unsigned int& level); 78 }; 79 80 81 82 template < OP_TEMPLATE_DEF > 83 class CLAHEProc 84 { 85 public: render(VipsRegion ** ireg,int n,int in_first,VipsRegion * imap,VipsRegion * omap,VipsRegion * oreg,OpParBase * par)86 void render(VipsRegion** ireg, int n, int in_first, 87 VipsRegion* imap, VipsRegion* omap, 88 VipsRegion* oreg, OpParBase* par) 89 { 90 } 91 }; 92 93 ProcessorBase* new_clahe(); 94 } 95 96 #endif 97 98 99