From d205274a014acabbed88b18d5058682a0ca46f9c Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Wed, 4 Oct 2023 15:13:53 +0300 Subject: Drop MinMax in favor of std::clamp Change-Id: I021f524b232ddbe091981444d859d35dd9cd05ac Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157582 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- include/vcl/bitmap.hxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'include/vcl/bitmap.hxx') diff --git a/include/vcl/bitmap.hxx b/include/vcl/bitmap.hxx index 1c5f7bcc7ec6..b0a26700d6f5 100644 --- a/include/vcl/bitmap.hxx +++ b/include/vcl/bitmap.hxx @@ -21,6 +21,7 @@ #define INCLUDED_VCL_BITMAP_HXX #include +#include #include #include #include @@ -30,9 +31,13 @@ #include +#include #include -#define GAMMA( _def_cVal, _def_InvGamma ) (static_cast(MinMax(FRound(pow( _def_cVal/255.0,_def_InvGamma)*255.0),0,255))) +inline sal_uInt8 GAMMA(double _def_cVal, double _def_InvGamma) +{ + return FRound(std::clamp(pow(_def_cVal / 255.0, _def_InvGamma) * 255.0, 0.0, 255.0)); +} class Color; -- cgit