OTB  6.7.0
Orfeo Toolbox
otbShiftScaleVectorImageFilter.hxx
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1999-2011 Insight Software Consortium
3  * Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
4  *
5  * This file is part of Orfeo Toolbox
6  *
7  * https://www.orfeo-toolbox.org/
8  *
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  * http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  */
21 
22 #ifndef otbShiftScaleVectorImageFilter_hxx
23 #define otbShiftScaleVectorImageFilter_hxx
24 
26 
27 namespace otb
28 {
32 template <class TInputImage, class TOutputImage>
33 void
36 {
37  this->Superclass::GenerateOutputInformation();
38  this->GetOutput()->SetNumberOfComponentsPerPixel(
39  this->GetInput()->GetNumberOfComponentsPerPixel()
40  );
41 }
42 
46 template <class TInputImage, class TOutputImage>
47 void
50 {
51  if (this->GetInput())
52  {
53  typename TInputImage::Pointer input = const_cast<TInputImage *>(this->GetInput());
54  typename TInputImage::RegionType inputRegion;
55  this->CallCopyOutputRegionToInputRegion(inputRegion, this->GetOutput()->GetRequestedRegion());
56  input->SetRequestedRegion(inputRegion);
57  }
58 }
59 
63 template <class TInputImage, class TOutputImage>
64 void
67 {
68  // set up the functor values
69  this->GetFunctor().SetScaleValues(m_Scale);
70  this->GetFunctor().SetShiftValues(m_Shift);
71 }
73 
74 } // end namespace otb
75 #endif