Image Component Library (ICL)
AffineOp.h
Go to the documentation of this file.
1 /********************************************************************
2 ** Image Component Library (ICL) **
3 ** **
4 ** Copyright (C) 2006-2013 CITEC, University of Bielefeld **
5 ** Neuroinformatics Group **
6 ** Website: www.iclcv.org and **
7 ** http://opensource.cit-ec.de/projects/icl **
8 ** **
9 ** File : ICLFilter/src/ICLFilter/AffineOp.h **
10 ** Module : ICLFilter **
11 ** Authors: Christof Elbrechter **
12 ** **
13 ** **
14 ** GNU LESSER GENERAL PUBLIC LICENSE **
15 ** This file may be used under the terms of the GNU Lesser General **
16 ** Public License version 3.0 as published by the **
17 ** **
18 ** Free Software Foundation and appearing in the file LICENSE.LGPL **
19 ** included in the packaging of this file. Please review the **
20 ** following information to ensure the license requirements will **
21 ** be met: http://www.gnu.org/licenses/lgpl-3.0.txt **
22 ** **
23 ** The development of this software was supported by the **
24 ** Excellence Cluster EXC 277 Cognitive Interaction Technology. **
25 ** The Excellence Cluster EXC 277 is a grant of the Deutsche **
26 ** Forschungsgemeinschaft (DFG) in the context of the German **
27 ** Excellence Initiative. **
28 ** **
29 ********************************************************************/
30 
31 #pragma once
32 
33 #include <ICLUtils/CompatMacros.h>
34 #include <ICLUtils/Uncopyable.h>
35 #include <ICLFilter/BaseAffineOp.h>
36 
37 namespace icl{
38  namespace filter{
40 
86  public:
90 
97  void reset ();
99 
101  void rotate (double dAngle);
102 
104 
107  void translate (double x, double y) {
108  m_aadT[0][2] += x; m_aadT[1][2] += y;
109  }
111 
115  void scale (double x, double y) {
116  m_aadT[0][0] *= x; m_aadT[1][0] *= x;
117  m_aadT[0][1] *= y; m_aadT[1][1] *= y;
118  }
119 
121  virtual void apply (const core::ImgBase *poSrc, core::ImgBase **ppoDst);
122 
124  using BaseAffineOp::apply;
125 
127 
128  inline void setAdaptResultImage(bool on){
129  m_adaptResultImage = on;
130  }
131 
133 
134  inline bool getAdaptResultImage() const{
135  return m_adaptResultImage;
136  }
137 
138  private:
140  void (AffineOp::*m_aMethods[core::depthLast+1])(const core::ImgBase *poSrc, core::ImgBase *poDst);
141 
142  template<typename T>
143  void affine (const core::ImgBase *poSrc, core::ImgBase *poDst);
144 
145  void applyT (const double p[2], double aResult[2]);
146  static void useMinMax (const double aCur[2],
147  double aMin[2], double aMax[2]);
148  void getShiftAndSize (const utils::Rect& roi, utils::Size& size,
149  double& xShift, double& yShift);
150  double m_aadT[2][3];
152 
155  };
156  } // namespace filter
157 }
158 
159 
bool m_adaptResultImage
internal flag
Definition: AffineOp.h:154
undocument this line if you encounter any issues!
Definition: Any.h:37
Class interface for un-copyable classes.
Definition: Uncopyable.h:64
ICLQt_API ImgROI roi(ImgQ &r)
creates a ROI-struct from an image
void translate(double x, double y)
adds a traslation
Definition: AffineOp.h:107
core::scalemode m_eInterpolate
Definition: AffineOp.h:151
Class to apply an arbitrary series of affine transformations .
Definition: AffineOp.h:85
Size class of the ICL.
Definition: Size.h:61
void setAdaptResultImage(bool on)
sets whether the result image is is scaled and translated to contain the whole result image
Definition: AffineOp.h:128
ICLQt_API core::Img< T > filter(const core::Img< T > &image, const std::string &filter)
applies a filter operation on the source image (affinity for float)
Definition: Types.h:66
scalemode
for scaling of Img images theses functions are provided
Definition: Types.h:84
bool getAdaptResultImage() const
returns the Adapt Result image option
Definition: AffineOp.h:134
void scale(double x, double y)
adds a scale
Definition: AffineOp.h:115
#define ICLFilter_API
Definition: CompatMacros.h:175
virtual void apply(const core::ImgBase *operand1, core::ImgBase **dst)=0
pure virtual apply function, that must be implemented in all derived classes
Rectangle class of the ICL used e.g. for the Images ROI-rect.
Definition: Rect.h:95
Definition: Types.h:86
ImgBase is the Image-Interface class that provides save access to underlying Img-template .
Definition: ImgBase.h:131
Abtract base class for arbitrary affine operation classes .
Definition: BaseAffineOp.h:48