Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
FilterNTo2N.hh
1 /*
2 This file is part of the BIAS library (Basic ImageAlgorithmS).
3 
4 Copyright (C) 2003-2009 (see file CONTACT for details)
5  Multimediale Systeme der Informationsverarbeitung
6  Institut fuer Informatik
7  Christian-Albrechts-Universitaet Kiel
8 
9 
10 BIAS is free software; you can redistribute it and/or modify
11 it under the terms of the GNU Lesser General Public License as published by
12 the Free Software Foundation; either version 2.1 of the License, or
13 (at your option) any later version.
14 
15 BIAS is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU Lesser General Public License for more details.
19 
20 You should have received a copy of the GNU Lesser General Public License
21 along with BIAS; if not, write to the Free Software
22 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 */
24 
25 
26 #ifndef __FilterNTo2N_hh__
27 #define __FilterNTo2N_hh__
28 
29 #include "FilterBase.hh"
30 
31 
32 namespace BIAS
33 {
34  /** @class FilterNTo2N
35  @ingroup g_filter
36  @brief base class for simple n->2n filter implementations
37 
38  This is the base class for n->2n filters, i.e. for every input channel
39  two output channels are generated by filters derived from this class.
40 
41  @author skoglund, koeser, woelk 11/2004 */
42 
43  template <class InputStorageType, class OutputStorageType>
44  class BIASFilter_EXPORT FilterNTo2N :
45  public FilterBase<InputStorageType, OutputStorageType>
46  {
47  public:
48  /** algorithm used to calculate the absolute length of the 2D vector
49  - VLT_L1: | fabs(gx) + fabs(gy) |
50  - VLT_L2: sqrt(gx*gx+gy*gy)
51  - VLT_max: max(fabs(gx), fabs(gy)) */
52  enum EVecLengthType { VLT_L1, VLT_L2, VLT_max };
53  public:
54  FilterNTo2N();
56  virtual ~FilterNTo2N();
57 
58  /** dst.GetChannelCount()==2*src.GetCHannelCount() */
59  virtual int Filter(const Image<InputStorageType>& src,
61  virtual int FilterInt(const Image<InputStorageType>& src,
63  virtual int FilterFloat(const Image<InputStorageType>& src,
65 
66  /** dstX.GetChannelCount()==src.GetCHannelCount() */
67  virtual int Filter(const Image<InputStorageType>& src,
70  virtual int FilterInt(const Image<InputStorageType>& src,
73  virtual int FilterFloat(const Image<InputStorageType>& src,
76  virtual FilterNTo2N<InputStorageType, OutputStorageType>* Clone() const = 0;
77 
78  /** decides which vector length to use from *_VecLenthType
79  @author woelk 12/2004 */
80  int VecLen(const Image<OutputStorageType>& gx,
81  const Image<OutputStorageType>& gy,
82  Image<OutputStorageType>& length);
83 
84  /** length = | fabs(gx) + fabs(gy) |
85  destination absg must be initialized
86  @author woelk 09/2004 */
87  int VecLenL1(const Image<OutputStorageType>& gx,
88  const Image<OutputStorageType>& gy,
89  Image<OutputStorageType>& length);
90 
91  /** length = sqrt(gx*gx+gy*gy)
92  destination absg must be initialized
93  @author woelk 09/2004 */
94  int VecLenL2(const Image<OutputStorageType>& gx,
95  const Image<OutputStorageType>& gy,
96  Image<OutputStorageType>& length);
97 
98  /** length = max(fabs(gx),fabs(gy))
99  destination absg must be initialized
100  @author woelk 09/2004 */
101  int VecLenMax(const Image<OutputStorageType>& gx,
102  const Image<OutputStorageType>& gy,
103  Image<OutputStorageType>& length);
104 
105  protected:
106  /// of type Gradient<InputStorageType, OutputStorageType>::EVecLengthType
108  }; // class
109 } // namespace
110 
111 #endif // __FilterNTo2N_hh__
base class for simple n-&gt;2n filter implementations
Definition: FilterNTo2N.hh:44
virtual parent class for API definition of all (future) filters
Definition: FilterBase.hh:77
EVecLengthType
algorithm used to calculate the absolute length of the 2D vector
Definition: FilterNTo2N.hh:52
int _VecLengthType
of type Gradient&lt;InputStorageType, OutputStorageType&gt;::EVecLengthType
Definition: FilterNTo2N.hh:107