From de3f6c75dbd8a17f436df546ff38bd5a23a54e75 Mon Sep 17 00:00:00 2001 From: Manuel Grizonnet <manuel.grizonnet@cnes.fr> Date: Fri, 30 Nov 2018 14:02:37 +0100 Subject: [PATCH] WIP: start to refactor SinclairImageFilters using FunctorImageFilter --- .../Polarimetry/include/otbPolarimetryTags.h | 35 ++++++++++++++++ .../include/otbSinclairImageFilters.h | 42 +++++++++++++++++++ .../Filtering/Polarimetry/otb-module.cmake | 1 + 3 files changed, 78 insertions(+) create mode 100644 Modules/Filtering/Polarimetry/include/otbPolarimetryTags.h create mode 100644 Modules/Filtering/Polarimetry/include/otbSinclairImageFilters.h diff --git a/Modules/Filtering/Polarimetry/include/otbPolarimetryTags.h b/Modules/Filtering/Polarimetry/include/otbPolarimetryTags.h new file mode 100644 index 0000000000..d38ca71ffa --- /dev/null +++ b/Modules/Filtering/Polarimetry/include/otbPolarimetryTags.h @@ -0,0 +1,35 @@ +/* + * 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. + */ + +#ifndef otbPolarimetryTags_h +#define otbPolarimetryTags_h + +namespace otb +{ + namespace polarimetry_tags + { + struct hh {}; + struct hv {}; + struct vh {}; + struct vv {}; + } // end namespace polarimetry_tags +} // end namespace otb + +#endif diff --git a/Modules/Filtering/Polarimetry/include/otbSinclairImageFilters.h b/Modules/Filtering/Polarimetry/include/otbSinclairImageFilters.h new file mode 100644 index 0000000000..3ea2f8b620 --- /dev/null +++ b/Modules/Filtering/Polarimetry/include/otbSinclairImageFilters.h @@ -0,0 +1,42 @@ +/* + * 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. + */ + +#ifndef otbSinclairImageFilters_h +#define otbSinclairImageFilters_h + +#include "otbPolarimetryTags.h" +#include "otbFunctorImageFilter.h" +#include "otbSinclairToCovarianceMatrixFunctor.h" + +namespace otb +{ + // This is the entire declaration of SinclairToCovarianceMatrixFilter +template <typename TInputImage, typename TOutputImage> +using SinclairToCovarianceMatrixFilter = FunctorImageFilter< Functor::SinclairToCovarianceMatrixFunctor <typename TInputImage::PixelType,typename TInputImage::PixelType,typename TInputImage::PixelType,typename TInputImage::PixelType, + typename TOutputImage::PixelType> , + std::tuple<polarimetry_tags::hh, + polarimetry_tags::hv, + polarimetry_tags::vh, + polarimetry_tags::vv> >; + + +} // end namespace otb + +#endif diff --git a/Modules/Filtering/Polarimetry/otb-module.cmake b/Modules/Filtering/Polarimetry/otb-module.cmake index 819bb964cf..5d44ff3ada 100644 --- a/Modules/Filtering/Polarimetry/otb-module.cmake +++ b/Modules/Filtering/Polarimetry/otb-module.cmake @@ -29,6 +29,7 @@ otb_module(OTBPolarimetry DEPENDS OTBCommon OTBITK + OTBFunctor TEST_DEPENDS OTBImageBase -- GitLab