OTB  10.0.0
Orfeo Toolbox
otbSpot5ForwardTransform.hxx
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2024 Centre National d'Etudes Spatiales (CNES)
3  *
4  * This file is part of Orfeo Toolbox
5  *
6  * https://www.orfeo-toolbox.org/
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  */
20 
21 #ifndef otbSpot5ForwardTransform_hxx
22 #define otbSpot5ForwardTransform_hxx
23 
25 
26 namespace otb
27 {
28 template <class TScalarType, unsigned int NInputDimensions, unsigned int NOutputDimensions>
30 {}
31 
32 template <class TScalarType, unsigned int NInputDimensions, unsigned int NOutputDimensions>
35 {
38  // from upper left corner to centered pixel convention
39  sensorPoint[0] = static_cast<double>(point[0]) - 0.5;
40  sensorPoint[1] = static_cast<double>(point[1]) - 0.5;
41  if (NInputDimensions > 2)
42  worldPoint = this->m_Transformer->LineSampleHeightToWorld(sensorPoint, static_cast<double>(point[2]));
43  else
44  worldPoint = this->m_Transformer->LineSampleToWorld(sensorPoint);
45 
46  OutputPointType pOut;
47  pOut[0] = static_cast<TScalarType>(worldPoint[0]);
48  pOut[1] = static_cast<TScalarType>(worldPoint[1]);
49 
50  if (NOutputDimensions > 2)
51  pOut[2] = static_cast<TScalarType>(worldPoint[2]);
52 
53  return pOut;
54 }
55 
59 template <class TScalarType, unsigned int NInputDimensions, unsigned int NOutputDimensions>
61 {
62  Superclass::PrintSelf(os, indent);
63  os << indent << "Transformation direction: Forward\n";
64 }
66 
67 }
68 
69 #endif
itk::Point< TScalarType, NInputDimensions > InputPointType
itk::Point< TScalarType, NOutputDimensions > OutputPointType
OutputPointType TransformPoint(const InputPointType &point) const override
void PrintSelf(std::ostream &os, itk::Indent indent) const override
itk::Point< TScalarType, NOutputDimensions > OutputPointType
itk::Point< double, 2 > Point2DType
SPOT5 sensor class, based on OSSIM Spot5SensorModel with ITK/GDAL implementation.
itk::Point< double, 3 > Point3DType
Class to overload method passed to virtual pure in ITK V4.
Definition: otbTransform.h:42
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.