ODIN
filter_clip.h
1 /***************************************************************************
2  filter_scale.h - description
3  -------------------
4  begin : Thu Jan 31 2008
5  copyright : (C) 2000-2021 by Thies Jochimsen
6  email : thies@jochimsen.de
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef FILTER_CLIP_H
19 #define FILTER_CLIP_H
20 
21 #include <odindata/filter_step.h>
22 
23 class FilterMin : public FilterStep {
24 
25  LDRfloat thresh;
26 
27  STD_string label() const {return "min";}
28  STD_string description() const {return "Clip all values below minimum value";}
29  bool process(Data<float,4>& data, Protocol& prot) const;
30  FilterStep* allocate() const {return new FilterMin();}
31  void init();
32 };
33 
35 
36 class FilterMax : public FilterStep {
37 
38  LDRfloat thresh;
39 
40  STD_string label() const {return "max";}
41  STD_string description() const {return "Clip all values above maximum value";}
42  bool process(Data<float,4>& data, Protocol& prot) const;
43  FilterStep* allocate() const {return new FilterMax();}
44  void init();
45 };
46 
48 
49 class FilterType : public FilterStep {
50 protected:
51  LDRstring type;
52  float getThresh(bool upper)const;
53  void init();
54 };
55 
56 class FilterTypeMin : public FilterType {
57  STD_string label() const {return "typemin";}
58  STD_string description() const {return "Clip all values below minimum of a specific datatype";}
59  bool process(Data<float,4>& data, Protocol& prot) const;
60  FilterStep* allocate() const {return new FilterTypeMin();}
61 };
62 
63 class FilterTypeMax : public FilterType {
64  STD_string label() const {return "typemax";}
65  STD_string description() const {return "Clip all values above maximum of a specific datatype";}
66  bool process(Data<float,4>& data, Protocol& prot) const;
67  FilterStep* allocate() const {return new FilterTypeMax();}
68 };
69 
70 #endif
virtual bool process(FileIO::ProtocolDataMap &pdmap) const
virtual bool process(Data< float, 4 > &data, Protocol &prot) const
Protocol proxy.
Definition: protocol.h:33
virtual FilterStep * allocate() const=0
virtual STD_string description() const=0
virtual void init()=0
virtual STD_string label() const=0