TransparentOp.h
1 /*
2 
3 MIT License
4 
5 Copyright (c) 2017 FMI Open Development / Markus Peura, first.last@fmi.fi
6 
7 Permission is hereby granted, free of charge, to any person obtaining a copy
8 of this software and associated documentation files (the "Software"), to deal
9 in the Software without restriction, including without limitation the rights
10 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 copies of the Software, and to permit persons to whom the Software is
12 furnished to do so, subject to the following conditions:
13 
14 The above copyright notice and this permission notice shall be included in all
15 copies or substantial portions of the Software.
16 
17 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 SOFTWARE.
24 
25 */
26 /*
27 Part of Rack development has been done in the BALTRAD projects part-financed
28 by the European Union (European Regional Development Fund and European
29 Neighbourhood Partnership Instrument, Baltic Sea Region Programme 2007-2013)
30 */
31 
32 #ifndef TRANSPARENT2_OP_H_
33 #define TRANSPARENT2_OP_H_
34 
35 #include "drain/util/Fuzzy.h"
36 #include "FunctorOp.h"
37 
38 namespace drain
39 {
40 
41 namespace image
42 {
43 // he
44 
45 
46 class TransparentOp : public UnaryFunctorOp<drain::FuzzyStep<double> > {
47 //class TransparentOp : public ImageOp {
48 
49  //drain::Range<double> range;
50 
52 
56  //TransparentOp(): UnaryFunctorOp<drain::FuzzyStep<double> >(__FUNCTION__, "Adds transparency."){
58  //TransparentOp(): ImageOp(__FUNCTION__, "Adds transparency."){
59  //this->parameters.link("threshold", this->range, "range");
60  //range.set(0.5);
61  };
62 
63 
64  //virtual void make Compatible(const ImageFrame &src,Image &dst) const ;
65  virtual
66  void getDstConf(const ImageConf & src, ImageConf & dst) const;
67 
68  virtual
69  void traverseChannels(const ImageTray<const Channel> & src, ImageTray<Channel> & dst) const;
71 
74  //void traverseChannel(const Channel &src, Channel & dst) const
75 
77  void traverseChannel(const Channel &src, const Channel &srcAlpha, Channel &dst, Channel &dstAlpha) const;
78 
79 
80 };
81 
82 } // image::
83 
84 } // drain::
85 
86 #endif
Image with static geometry.
Definition: ImageChannel.h:60
Struct for image (excluding data)
Definition: ImageConf.h:333
virtual int srcAlpha() const
Tell if alpha channel(s) is required in input.
Definition: ImageMod.h:66
Container applicable for Channels and Images, with alpha support.
Definition: ImageTray.h:267
Definition: TransparentOp.h:46
Class for using simple function objects (like std::functor) for sequential pixel iteration.
Definition: FunctorOp.h:135
Definition: DataSelector.cpp:1277