Orfeo Toolbox  3.16
otbBlendingImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ORFEO Toolbox
4  Language: C++
5  Date: $Date$
6  Version: $Revision$
7 
8 
9  Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
10  See OTBCopyright.txt for details.
11 
12 
13  This software is distributed WITHOUT ANY WARRANTY; without even
14  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15  PURPOSE. See the above copyright notices for more information.
16 
17 =========================================================================*/
18 #ifndef __otbBlendingImageFilter_h
19 #define __otbBlendingImageFilter_h
20 
23 #include "otbImage.h"
24 #include "itkRGBAPixel.h"
25 
26 namespace otb
27 {
28 namespace Functor
29 {
38 template <class TInputPixel1, class TInputPixel2, class TOutputPixel>
40 {
41 public:
43  typedef otb::Function::BlendingFunction<TInputPixel1,
44  TInputPixel2, TOutputPixel> BlendingFunctionType;
49  TInputPixel2, TOutputPixel> DefaultBlendingFunctionType;
50 
52  inline TOutputPixel operator ()(const TInputPixel1& input1, const TInputPixel2& input2)
53  {
54  return m_Function->Evaluate(input1, input2);
55  }
56 
59  {
60  // Default rendering function
62  }
63 
65  virtual ~BlendingFunctor(){}
66 
71  {
72  m_Function = function;
73  }
74 
79  {
80  return m_Function;
81  }
82 
83 private:
86 };
87 } // end namespace Functor
88 
98 template <class TInputImage1, class TInputImage2 = TInputImage1, class TOutputImage = TInputImage1>
100  : public itk::BinaryFunctorImageFilter<TInputImage1, TInputImage2, TOutputImage,
101  Functor::BlendingFunctor
102  <typename TInputImage1::PixelType,
103  typename TInputImage2::PixelType,
104  typename TOutputImage::PixelType> >
105 {
106 public:
110  <TInputImage1, TInputImage2, TOutputImage, Functor::BlendingFunctor
111  <typename TInputImage1::PixelType,
112  typename TInputImage2::PixelType,
113  typename TOutputImage::PixelType> > Superclass;
116 
118  itkNewMacro(Self);
119 
122 
125  <typename TInputImage1::PixelType,
126  typename TInputImage2::PixelType,
127  typename TOutputImage::PixelType> BlendingFunctorType;
129 
135  {
136  if (function != this->GetFunctor().GetFunction())
137  {
138  this->GetFunctor().SetFunction(function);
139  this->Modified();
140  }
141  }
142 
148  {
149  return this->GetFunctor().GetFunction();
150  }
151 
152 protected:
156  virtual ~BlendingImageFilter() {}
157 
158 private:
159  BlendingImageFilter(const Self&); //purposely not implemented
160  void operator =(const Self&); //purposely not implemented
161 };
162 } // end namespace otb
163 
164 #endif

Generated at Sun Feb 3 2013 00:18:02 for Orfeo Toolbox with doxygen 1.8.1.1