# HG changeset patch # User Sebastien Jodogne # Date 1647852241 -3600 # Node ID 5f6b13202e85fe3a2b744c44b59be7ada16972fc # Parent dfbe764995cf8e97f896af285a16139db981af10 fix for older gcc versions diff -r dfbe764995cf -r 5f6b13202e85 OrthancFramework/Sources/Images/ImageProcessing.cpp --- a/OrthancFramework/Sources/Images/ImageProcessing.cpp Mon Mar 21 08:59:20 2022 +0100 +++ b/OrthancFramework/Sources/Images/ImageProcessing.cpp Mon Mar 21 09:44:01 2022 +0100 @@ -3000,11 +3000,13 @@ } } - - void ImageProcessing::Maximum(ImageAccessor& image, - const ImageAccessor& other) + + namespace { - struct F + // For older version of gcc, templated functors cannot be defined + // as types internal to functions, hence the anonymous namespace + + struct MaximumFunctor { void operator() (uint8_t& a, const uint8_t& b) { @@ -3016,15 +3018,20 @@ a = std::max(a, b); } }; - + } + + + void ImageProcessing::Maximum(ImageAccessor& image, + const ImageAccessor& other) + { switch (image.GetFormat()) { case PixelFormat_Grayscale8: - ApplyImageOntoImage(F(), image, other); + ApplyImageOntoImage(MaximumFunctor(), image, other); return; case PixelFormat_Grayscale16: - ApplyImageOntoImage(F(), image, other); + ApplyImageOntoImage(MaximumFunctor(), image, other); return; default: