From 3038dde7aeaff5920e35e257d50c191fc1516a42 Mon Sep 17 00:00:00 2001 From: Philippe Blanc
Date: Sat, 30 Aug 2025 10:32:46 +0200 Subject: [PATCH 1/2] missing DIP_EXPORT for Pixel operator != --- include/diplib/library/image_views.h | 1 + src/math/pixel.cpp | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/include/diplib/library/image_views.h b/include/diplib/library/image_views.h index 07e04103..b81c4383 100644 --- a/include/diplib/library/image_views.h +++ b/include/diplib/library/image_views.h @@ -784,6 +784,7 @@ bool operator==( Image::Pixel const& lhs, T const& rhs ) { return operator==( lh /// \brief Comparison operator, equivalent to `!(lhs==rhs)`. /// \relates dip::Image::Pixel +DIP_EXPORT bool operator!=( Image::Pixel const& lhs, Image::Pixel const& rhs ); template< typename T, typename = std::enable_if_t< IsNumericType< T >::value >> bool operator!=( Image::Pixel const& lhs, T const& rhs ) { return !operator==( lhs, rhs ); } diff --git a/src/math/pixel.cpp b/src/math/pixel.cpp index e8ea3e86..970ea7a3 100644 --- a/src/math/pixel.cpp +++ b/src/math/pixel.cpp @@ -354,6 +354,10 @@ bool operator==( Image::Pixel const& lhs, Image::Pixel const& rhs ) { return res.All(); } +bool operator!=( Image::Pixel const& lhs, Image::Pixel const& rhs ) { + return !( lhs == rhs ); +} + namespace { template< typename F > From 4f276a81b72bf1f7a72c70858d2ca8f80270df53 Mon Sep 17 00:00:00 2001 From: Philippe Blanc
Date: Sat, 30 Aug 2025 16:50:40 +0200 Subject: [PATCH 2/2] inline function --- include/diplib/library/image_views.h | 2 +- src/math/pixel.cpp | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/include/diplib/library/image_views.h b/include/diplib/library/image_views.h index b81c4383..cdd0579f 100644 --- a/include/diplib/library/image_views.h +++ b/include/diplib/library/image_views.h @@ -784,7 +784,7 @@ bool operator==( Image::Pixel const& lhs, T const& rhs ) { return operator==( lh /// \brief Comparison operator, equivalent to `!(lhs==rhs)`. /// \relates dip::Image::Pixel -DIP_EXPORT bool operator!=( Image::Pixel const& lhs, Image::Pixel const& rhs ); +DIP_EXPORT inline bool operator!=( Image::Pixel const& lhs, Image::Pixel const& rhs ) { return !( lhs == rhs ); } template< typename T, typename = std::enable_if_t< IsNumericType< T >::value >> bool operator!=( Image::Pixel const& lhs, T const& rhs ) { return !operator==( lhs, rhs ); } diff --git a/src/math/pixel.cpp b/src/math/pixel.cpp index 970ea7a3..e8ea3e86 100644 --- a/src/math/pixel.cpp +++ b/src/math/pixel.cpp @@ -354,10 +354,6 @@ bool operator==( Image::Pixel const& lhs, Image::Pixel const& rhs ) { return res.All(); } -bool operator!=( Image::Pixel const& lhs, Image::Pixel const& rhs ) { - return !( lhs == rhs ); -} - namespace { template< typename F >