Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
otb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Julien Cabieces
otb
Commits
a5e6a982
Commit
a5e6a982
authored
6 years ago
by
Julien Michel
Browse files
Options
Downloads
Patches
Plain Diff
ENH: VNamed -> VariadicNamed
parent
f4d94a68
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Modules/Core/Functor/include/otbVariadicNamedInputsImageFilter.h
+2
-2
2 additions, 2 deletions
.../Core/Functor/include/otbVariadicNamedInputsImageFilter.h
Modules/Core/Functor/test/otbFunctorImageFilter.cxx
+11
-7
11 additions, 7 deletions
Modules/Core/Functor/test/otbFunctorImageFilter.cxx
with
13 additions
and
9 deletions
Modules/Core/Functor/include/otbVariadicNamedInputsImageFilter.h
+
2
−
2
View file @
a5e6a982
...
...
@@ -57,13 +57,13 @@ public:
itkNewMacro
(
Self
);
template
<
typename
Tag
>
void
SetVNamedInput
(
const
InputImageType
<
internal
::
tuple_index
<
Tag
,
TInputNameMap
>::
value
>
*
inputPtr
)
template
<
typename
Tag
>
void
SetV
ariadic
NamedInput
(
const
InputImageType
<
internal
::
tuple_index
<
Tag
,
TInputNameMap
>::
value
>
*
inputPtr
)
{
constexpr
size_t
idx
=
internal
::
tuple_index
<
Tag
,
TInputNameMap
>::
value
;
this
->
SetNthInput
(
idx
,
const_cast
<
InputImageType
<
idx
>
*>
(
inputPtr
));
}
template
<
typename
Tag
>
const
InputImageType
<
internal
::
tuple_index
<
Tag
,
TInputNameMap
>::
value
>
*
GetVNamedInput
()
template
<
typename
Tag
>
const
InputImageType
<
internal
::
tuple_index
<
Tag
,
TInputNameMap
>::
value
>
*
GetV
ariadic
NamedInput
()
{
constexpr
size_t
idx
=
internal
::
tuple_index
<
Tag
,
TInputNameMap
>::
value
;
return
dynamic_cast
<
const
InputImageType
<
idx
>
*>
(
this
->
GetInput
(
idx
));
...
...
This diff is collapsed.
Click to expand it.
Modules/Core/Functor/test/otbFunctorImageFilter.cxx
+
11
−
7
View file @
a5e6a982
...
...
@@ -117,14 +117,18 @@ template <typename T> struct TypesCheck
filter
->
SetVariadicInputs
(
in
);
filter
->
SetInput1
(
in
);
filter
->
template
SetVariadicInput
<
0
>(
in
);
// template keyword to avoid C++ parse ambiguity
filter
->
template
SetVariadicInput
<
0
>(
in
);
// template keyword to
// avoid C++ parse
// ambiguity
auto
res
=
filter
->
template
GetVariadicInput
<
0
>();
filter
->
Update
();
// Test named input version
struct
tag
{};
using
inputNames
=
std
::
tuple
<
tag
>
;
auto
filter1
=
NewFunctorFilter
<
decltype
(
functor
),
inputNames
>
(
functor
);
filter1
->
template
SetVNamedInput
<
tag
>(
in
);
filter1
->
template
SetVariadicNamedInput
<
tag
>(
in
);
res
=
filter1
->
template
GetVariadicNamedInput
<
tag
>();
filter1
->
Update
();
// Test with simple lambda
...
...
@@ -308,10 +312,10 @@ int otbFunctorImageFilter(int itkNotUsed(argc), char * itkNotUsed(argv) [])
struct
pan
{};
using
Names
=
std
::
tuple
<
xs
,
pan
>
;
auto
filterWithNames
=
otb
::
VariadicNamedInputsImageFilter
<
VectorImageType
,
Names
,
VectorImageType
,
ImageType
>::
New
();
filterWithNames
->
SetVNamedInput
<
xs
>
(
vimage
);
filterWithNames
->
SetVNamedInput
<
pan
>
(
image
);
filterWithNames
->
SetV
ariadic
NamedInput
<
xs
>
(
vimage
);
filterWithNames
->
SetV
ariadic
NamedInput
<
pan
>
(
image
);
std
::
cout
<<
filterWithNames
->
GetVNamedInput
<
xs
>
()
<<
filterWithNames
->
GetVNamedInput
<
pan
>
()
<<
std
::
endl
;
std
::
cout
<<
filterWithNames
->
GetV
ariadic
NamedInput
<
xs
>
()
<<
filterWithNames
->
GetV
ariadic
NamedInput
<
pan
>
()
<<
std
::
endl
;
...
...
@@ -354,8 +358,8 @@ int otbFunctorImageFilter(int itkNotUsed(argc), char * itkNotUsed(argv) [])
// Test FunctorImageFilter With VariadicAdd functor
using
AddFunctorType
=
Functor
::
VariadicAdd
<
double
,
double
,
double
>
;
auto
add
=
NewFunctorFilter
(
AddFunctorType
{});
add
->
SetVInput
<
0
>
(
image
);
add
->
SetVInput
<
1
>
(
image
);
add
->
SetV
ariadic
Input
<
0
>
(
image
);
add
->
SetV
ariadic
Input
<
1
>
(
image
);
add
->
Update
();
// Test FunctorImageFilter with BandExtraction functor
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment