Skip to content

Fix MR 797

Julien Osman requested to merge RemoveAllocOnImageCasting into develop

Summary

In ClampImageFilter and ConvertTypeFunctor, replace the two limit setters by only one for both limits.

Implement functions that provide the max or min value for a type, even if it is a vector type. Use them in ConvertTypeFunctor's constructor.

Rationale

Merge request !797 (merged) introduced a bug when ConvertTypeFunctor's are not set and output type is a vector. This MR fixes this.

Implementation Details

Classes and files
  • Add new file Modules/Core/Common/include/otbNumericTraits.h and implement functions common_lowest and common_highest
  • Use those new function in ConvertTypeFunctor's initialization.
  • In ClampImageFilter and ConvertTypeFunctor, replace the two limit setters by only one for both limits.

Additional notes

  • Also a little commit to remove some unused variables in Modules/Core/Metadata/include/otbGeomMetadataSupplier.h and Modules/IO/IOGDAL/include/otbGDALImageIO.h

Copyright

The copyright owner is CNES and has signed the ORFEO ToolBox Contributor License Agreement.


Check before merging:

  • All discussions are resolved
  • At least 2 👍 votes from core developers, no 👎 vote.
  • The feature branch is (reasonably) up-to-date with the base branch
  • Dashboard is green
  • Copyright owner has signed the ORFEO ToolBox Contributor License Agreement
  • Optionally, run git diff develop... -U0 --no-color | clang-format-diff.py -p1 -i on latest changes and commit
Edited by Julien Osman

Merge request reports

Loading