Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
otb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
273
Issues
273
List
Boards
Labels
Service Desk
Milestones
Merge Requests
8
Merge Requests
8
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Main Repositories
otb
Commits
ab11c7e1
Commit
ab11c7e1
authored
Feb 14, 2018
by
Antoine Regimbeau
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
REFAC: cleaning code
parent
7d9ca32f
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
54 additions
and
317 deletions
+54
-317
Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameterDouble.cxx
...icationEngine/src/otbWrapperInputImageParameterDouble.cxx
+0
-35
Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameterFloat.cxx
...licationEngine/src/otbWrapperInputImageParameterFloat.cxx
+0
-35
Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameterInt16.cxx
...licationEngine/src/otbWrapperInputImageParameterInt16.cxx
+0
-35
Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameterInt32.cxx
...licationEngine/src/otbWrapperInputImageParameterInt32.cxx
+0
-35
Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameterMacros.h
...plicationEngine/src/otbWrapperInputImageParameterMacros.h
+0
-18
Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameterUInt16.cxx
...icationEngine/src/otbWrapperInputImageParameterUInt16.cxx
+0
-35
Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameterUInt32.cxx
...icationEngine/src/otbWrapperInputImageParameterUInt32.cxx
+0
-35
Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameterUInt8.cxx
...licationEngine/src/otbWrapperInputImageParameterUInt8.cxx
+0
-35
Modules/Wrappers/ApplicationEngine/test/otbWrapperOutputImageParameterTest.cxx
...icationEngine/test/otbWrapperOutputImageParameterTest.cxx
+54
-54
No files found.
Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameterDouble.cxx
deleted
100644 → 0
View file @
7d9ca32f
/*
* Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES)
*
* This file is part of Orfeo Toolbox
*
* https://www.orfeo-toolbox.org/
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <vcl_deprecated_header.h>
#include "otbWrapperInputImageParameter.h"
#include "itksys/SystemTools.hxx"
#include "otbWrapperTypes.h"
#include "otbWrapperInputImageParameterMacros.h"
#include "otb_boost_string_header.h"
namespace
otb
{
namespace
Wrapper
{
otbGetImageMacro
(
DoubleImage
);
otbGetImageMacro
(
DoubleVectorImage
)
}
}
Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameterFloat.cxx
deleted
100644 → 0
View file @
7d9ca32f
/*
* Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES)
*
* This file is part of Orfeo Toolbox
*
* https://www.orfeo-toolbox.org/
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <vcl_deprecated_header.h>
#include "otbWrapperInputImageParameter.h"
#include "otbWrapperInputImageParameterMacros.h"
#include "itksys/SystemTools.hxx"
#include "otbWrapperTypes.h"
#include "otb_boost_string_header.h"
namespace
otb
{
namespace
Wrapper
{
otbGetImageMacro
(
FloatImage
);
otbGetImageMacro
(
FloatVectorImage
)
}
}
Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameterInt16.cxx
deleted
100644 → 0
View file @
7d9ca32f
/*
* Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES)
*
* This file is part of Orfeo Toolbox
*
* https://www.orfeo-toolbox.org/
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <vcl_deprecated_header.h>
#include "otbWrapperInputImageParameter.h"
#include "itksys/SystemTools.hxx"
#include "otbWrapperTypes.h"
#include "otbWrapperInputImageParameterMacros.h"
#include "otb_boost_string_header.h"
namespace
otb
{
namespace
Wrapper
{
otbGetImageMacro
(
Int16Image
);
otbGetImageMacro
(
Int16VectorImage
)
}
}
Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameterInt32.cxx
deleted
100644 → 0
View file @
7d9ca32f
/*
* Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES)
*
* This file is part of Orfeo Toolbox
*
* https://www.orfeo-toolbox.org/
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <vcl_deprecated_header.h>
#include "otbWrapperInputImageParameter.h"
#include "itksys/SystemTools.hxx"
#include "otbWrapperTypes.h"
#include "otbWrapperInputImageParameterMacros.h"
#include "otb_boost_string_header.h"
namespace
otb
{
namespace
Wrapper
{
otbGetImageMacro
(
Int32Image
);
otbGetImageMacro
(
Int32VectorImage
)
}
}
Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameterMacros.h
View file @
ab11c7e1
...
...
@@ -33,22 +33,4 @@
otbGetImageMacro(type##VectorImage);
/*
#define otbCastImageMacro(InputImageType, OutputImageType, theMethod) \
template<> OutputImageType * \
InputImageParameter::CastImage<InputImageType , OutputImageType>() \
{ \
return this->theMethod<InputImageType , OutputImageType>(); \
}
#define otbGenericCastImageMacro(InputImageType, theMethod, prefix) \
otbCastImageMacro(InputImageType, UInt8##prefix##ImageType, theMethod) \
otbCastImageMacro(InputImageType, UInt16##prefix##ImageType, theMethod) \
otbCastImageMacro(InputImageType, Int16##prefix##ImageType, theMethod) \
otbCastImageMacro(InputImageType, UInt32##prefix##ImageType, theMethod) \
otbCastImageMacro(InputImageType, Int32##prefix##ImageType, theMethod) \
otbCastImageMacro(InputImageType, Float##prefix##ImageType, theMethod) \
otbCastImageMacro(InputImageType, Double##prefix##ImageType, theMethod)
*/
#endif
Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameterUInt16.cxx
deleted
100644 → 0
View file @
7d9ca32f
/*
* Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES)
*
* This file is part of Orfeo Toolbox
*
* https://www.orfeo-toolbox.org/
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <vcl_deprecated_header.h>
#include "otbWrapperInputImageParameter.h"
#include "itksys/SystemTools.hxx"
#include "otbWrapperTypes.h"
#include "otbWrapperInputImageParameterMacros.h"
#include "otb_boost_string_header.h"
namespace
otb
{
namespace
Wrapper
{
otbGetImageMacro
(
UInt16Image
);
otbGetImageMacro
(
UInt16VectorImage
)
}
}
Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameterUInt32.cxx
deleted
100644 → 0
View file @
7d9ca32f
/*
* Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES)
*
* This file is part of Orfeo Toolbox
*
* https://www.orfeo-toolbox.org/
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <vcl_deprecated_header.h>
#include "otbWrapperInputImageParameter.h"
#include "itksys/SystemTools.hxx"
#include "otbWrapperTypes.h"
#include "otbWrapperInputImageParameterMacros.h"
#include "otb_boost_string_header.h"
namespace
otb
{
namespace
Wrapper
{
otbGetImageMacro
(
UInt32Image
);
otbGetImageMacro
(
UInt32VectorImage
)
}
}
Modules/Wrappers/ApplicationEngine/src/otbWrapperInputImageParameterUInt8.cxx
deleted
100644 → 0
View file @
7d9ca32f
/*
* Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES)
*
* This file is part of Orfeo Toolbox
*
* https://www.orfeo-toolbox.org/
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <vcl_deprecated_header.h>
#include "otbWrapperInputImageParameter.h"
#include "itksys/SystemTools.hxx"
#include "otbWrapperTypes.h"
#include "otbWrapperInputImageParameterMacros.h"
#include "otb_boost_string_header.h"
namespace
otb
{
namespace
Wrapper
{
otbGetImageMacro
(
UInt8Image
);
otbGetImageMacro
(
UInt8VectorImage
)
}
}
Modules/Wrappers/ApplicationEngine/test/otbWrapperOutputImageParameterTest.cxx
View file @
ab11c7e1
...
...
@@ -62,57 +62,57 @@ int otbWrapperOutputImageParameterTest1(int itkNotUsed(argc), char* argv[])
}
template
<
typename
ImageType
>
void
Cross
(
int
p
,
std
::
string
inputfilename
,
std
::
string
outputfilename
)
{
otb
::
Wrapper
::
InputImageParameter
::
Pointer
paramIn
(
otb
::
Wrapper
::
InputImageParameter
::
New
()
);
paramIn
->
SetFromFileName
(
inputfilename
);
otb
::
Wrapper
::
OutputImageParameter
::
Pointer
paramOut
(
otb
::
Wrapper
::
OutputImageParameter
::
New
()
);
paramOut
->
SetFileName
(
outputfilename
);
paramOut
->
SetImage
(
paramIn
->
GetImage
<
ImageType
>
());
paramOut
->
InitializeWriters
();
paramOut
->
SetPixelType
(
static_cast
<
otb
::
Wrapper
::
ImagePixelType
>
(
p
));
paramOut
->
Write
();
}
int
otbWrapperOutputImageParameterConversionTest
(
int
,
char
*
argv
[])
{
std
::
string
filenamein
=
argv
[
1
];
std
::
string
filenameout
=
argv
[
2
]
;
std
::
string
extension
=
filenameout
.
substr
(
filenameout
.
find_last_of
(
'.'
)
);
filenameout
=
filenameout
.
substr
(
0
,
filenameout
.
find_last_of
(
'.'
)
);
for
(
int
i
=
otb
::
Wrapper
::
ImagePixelType_uint8
;
i
<
11
;
i
++
)
{
std
::
string
type
=
otb
::
Wrapper
::
OutputImageParameter
::
ConvertPixelTypeToString
(
static_cast
<
otb
::
Wrapper
::
ImagePixelType
>
(
i
)
);
Cross
<
otb
::
Wrapper
::
UInt8ImageType
>
(
i
,
filenamein
,
filenameout
+
"_UInt8_"
+
type
+
extension
)
;
Cross
<
otb
::
Wrapper
::
Int16ImageType
>
(
i
,
filenamein
,
filenameout
+
"_Int16_"
+
type
+
extension
)
;
Cross
<
otb
::
Wrapper
::
UInt16ImageType
>
(
i
,
filenamein
,
filenameout
+
"_UInt16_"
+
type
+
extension
)
;
Cross
<
otb
::
Wrapper
::
Int32ImageType
>
(
i
,
filenamein
,
filenameout
+
"_Int21_"
+
type
+
extension
)
;
Cross
<
otb
::
Wrapper
::
UInt32ImageType
>
(
i
,
filenamein
,
filenameout
+
"_UInt32_"
+
type
+
extension
)
;
Cross
<
otb
::
Wrapper
::
FloatImageType
>
(
i
,
filenamein
,
filenameout
+
"_float_"
+
type
+
extension
)
;
Cross
<
otb
::
Wrapper
::
DoubleImageType
>
(
i
,
filenamein
,
filenameout
+
"_double_"
+
type
+
extension
)
;
Cross
<
otb
::
Wrapper
::
UInt8VectorImageType
>
(
i
,
filenamein
,
filenameout
+
"_UInt8Vect_"
+
type
+
extension
)
;
Cross
<
otb
::
Wrapper
::
Int16VectorImageType
>
(
i
,
filenamein
,
filenameout
+
"_Int16Vect_"
+
type
+
extension
)
;
Cross
<
otb
::
Wrapper
::
UInt16VectorImageType
>
(
i
,
filenamein
,
filenameout
+
"_UInt16Vect_"
+
type
+
extension
)
;
Cross
<
otb
::
Wrapper
::
Int32VectorImageType
>
(
i
,
filenamein
,
filenameout
+
"_Int21Vect_"
+
type
+
extension
)
;
Cross
<
otb
::
Wrapper
::
UInt32VectorImageType
>
(
i
,
filenamein
,
filenameout
+
"_UInt32Vect_"
+
type
+
extension
)
;
Cross
<
otb
::
Wrapper
::
FloatVectorImageType
>
(
i
,
filenamein
,
filenameout
+
"_floatVect_"
+
type
+
extension
)
;
Cross
<
otb
::
Wrapper
::
DoubleVectorImageType
>
(
i
,
filenamein
,
filenameout
+
"_doubleVect_"
+
type
+
extension
)
;
Cross
<
otb
::
Wrapper
::
ComplexInt16ImageType
>
(
i
,
filenamein
,
filenameout
+
"_CInt16_"
+
type
+
extension
)
;
Cross
<
otb
::
Wrapper
::
ComplexInt32ImageType
>
(
i
,
filenamein
,
filenameout
+
"_CInt32_"
+
type
+
extension
)
;
Cross
<
otb
::
Wrapper
::
ComplexFloatImageType
>
(
i
,
filenamein
,
filenameout
+
"_Cfloat_"
+
type
+
extension
)
;
Cross
<
otb
::
Wrapper
::
ComplexDoubleImageType
>
(
i
,
filenamein
,
filenameout
+
"_Cdouble_"
+
type
+
extension
)
;
Cross
<
otb
::
Wrapper
::
ComplexInt16VectorImageType
>
(
i
,
filenamein
,
filenameout
+
"_CInt16Vect_"
+
type
+
extension
)
;
Cross
<
otb
::
Wrapper
::
ComplexInt32VectorImageType
>
(
i
,
filenamein
,
filenameout
+
"_CInt32Vect_"
+
type
+
extension
)
;
Cross
<
otb
::
Wrapper
::
ComplexFloatVectorImageType
>
(
i
,
filenamein
,
filenameout
+
"_CfloatVect_"
+
type
+
extension
)
;
Cross
<
otb
::
Wrapper
::
ComplexDoubleVectorImageType
>
(
i
,
filenamein
,
filenameout
+
"_CdoubleVect_"
+
type
+
extension
)
;
}
return
0
;
}
//
template < typename ImageType >
//
void Cross( int p , std::string inputfilename, std::string outputfilename)
//
{
//
otb::Wrapper::InputImageParameter::Pointer paramIn (
//
otb::Wrapper::InputImageParameter::New() );
//
paramIn->SetFromFileName( inputfilename );
//
otb::Wrapper::OutputImageParameter::Pointer paramOut(
//
otb::Wrapper::OutputImageParameter::New() );
//
paramOut->SetFileName( outputfilename );
//
paramOut->SetImage(paramIn->GetImage<ImageType>());
//
paramOut->InitializeWriters();
//
paramOut->SetPixelType(static_cast<otb::Wrapper::ImagePixelType>(p));
//
paramOut->Write();
//
}
//
int otbWrapperOutputImageParameterConversionTest(int , char* argv[])
//
{
//
std::string filenamein = argv[1];
//
std::string filenameout = argv[2] ;
//
std::string extension = filenameout.substr( filenameout.find_last_of('.') );
//
filenameout = filenameout.substr( 0 , filenameout.find_last_of('.') );
//
for ( int i = otb::Wrapper::ImagePixelType_uint8 ; i < 11 ; i++ )
//
{
//
std::string type =
//
otb::Wrapper::OutputImageParameter::ConvertPixelTypeToString(
//
static_cast<otb::Wrapper::ImagePixelType>(i) );
//
Cross< otb::Wrapper::UInt8ImageType > (i , filenamein , filenameout+"_UInt8_"+ type + extension ) ;
//
Cross< otb::Wrapper::Int16ImageType > ( i , filenamein , filenameout+"_Int16_"+ type + extension ) ;
//
Cross< otb::Wrapper::UInt16ImageType > ( i , filenamein , filenameout+"_UInt16_"+ type + extension ) ;
//
Cross< otb::Wrapper::Int32ImageType > ( i , filenamein , filenameout+"_Int21_"+ type + extension ) ;
//
Cross< otb::Wrapper::UInt32ImageType > ( i , filenamein , filenameout+"_UInt32_"+ type + extension ) ;
//
Cross< otb::Wrapper::FloatImageType > ( i , filenamein , filenameout+"_float_"+ type + extension ) ;
//
Cross< otb::Wrapper::DoubleImageType > ( i , filenamein , filenameout+"_double_"+ type + extension ) ;
//
Cross< otb::Wrapper::UInt8VectorImageType > ( i , filenamein , filenameout+"_UInt8Vect_"+ type + extension ) ;
//
Cross< otb::Wrapper::Int16VectorImageType > ( i , filenamein , filenameout+"_Int16Vect_"+ type + extension ) ;
//
Cross< otb::Wrapper::UInt16VectorImageType > ( i , filenamein , filenameout+"_UInt16Vect_"+ type + extension ) ;
//
Cross< otb::Wrapper::Int32VectorImageType > ( i , filenamein , filenameout+"_Int21Vect_"+ type + extension ) ;
//
Cross< otb::Wrapper::UInt32VectorImageType > ( i , filenamein , filenameout+"_UInt32Vect_"+ type + extension ) ;
//
Cross< otb::Wrapper::FloatVectorImageType > ( i , filenamein , filenameout+"_floatVect_"+ type + extension ) ;
//
Cross< otb::Wrapper::DoubleVectorImageType > ( i , filenamein , filenameout+"_doubleVect_"+ type + extension ) ;
//
Cross< otb::Wrapper::ComplexInt16ImageType > ( i , filenamein , filenameout+"_CInt16_"+ type + extension ) ;
//
Cross< otb::Wrapper::ComplexInt32ImageType > ( i , filenamein , filenameout+"_CInt32_"+ type + extension ) ;
//
Cross< otb::Wrapper::ComplexFloatImageType > ( i , filenamein , filenameout+"_Cfloat_"+ type + extension ) ;
//
Cross< otb::Wrapper::ComplexDoubleImageType > ( i , filenamein , filenameout+"_Cdouble_"+ type + extension ) ;
//
Cross< otb::Wrapper::ComplexInt16VectorImageType > ( i , filenamein , filenameout+"_CInt16Vect_"+ type + extension ) ;
//
Cross< otb::Wrapper::ComplexInt32VectorImageType > ( i , filenamein , filenameout+"_CInt32Vect_"+ type + extension ) ;
//
Cross< otb::Wrapper::ComplexFloatVectorImageType > ( i , filenamein , filenameout+"_CfloatVect_"+ type + extension ) ;
//
Cross< otb::Wrapper::ComplexDoubleVectorImageType > ( i , filenamein , filenameout+"_CdoubleVect_"+ type + extension ) ;
//
}
//
return 0;
//
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment