From: Good Guy Date: Wed, 21 Feb 2024 17:14:40 +0000 (-0700) Subject: Add back 2 patches for histogram and overlayframe that are working correctly and... X-Git-Tag: 2024-02 X-Git-Url: https://cinelerra-gg.org/git/?a=commitdiff_plain;h=01c4fdd86ba39626d0c0c8e60737aea7a2dcb08b;p=goodguy%2Fcinelerra.git Add back 2 patches for histogram and overlayframe that are working correctly and mistakenly reverted --- diff --git a/cinelerra-5.1/cinelerra/overlayframe.h b/cinelerra-5.1/cinelerra/overlayframe.h index 13c2e4bd..4775e8df 100644 --- a/cinelerra-5.1/cinelerra/overlayframe.h +++ b/cinelerra-5.1/cinelerra/overlayframe.h @@ -32,6 +32,7 @@ #include #include #include +#include #define DIRECT_COPY 0 #define BILINEAR 1 @@ -237,7 +238,7 @@ static inline int64_t aclip(int64_t v, int mx) { return v < 0 ? 0 : v > mx ? mx : v; } static inline float aclip(float v, float mx) { - return v < 0 ? 0 : v > mx ? mx : v; + return v < -FLT_MAX+1 ? -FLT_MAX : v > FLT_MAX-1 ? FLT_MAX : v; } static inline float aclip(float v, int mx) { return v < 0 ? 0 : v > mx ? mx : v; diff --git a/cinelerra-5.1/plugins/histogram/histogram.C b/cinelerra-5.1/plugins/histogram/histogram.C index c78c3c7c..4b55f429 100644 --- a/cinelerra-5.1/plugins/histogram/histogram.C +++ b/cinelerra-5.1/plugins/histogram/histogram.C @@ -234,7 +234,7 @@ float HistogramMain::calculate_level(float input, int mode, int use_value) if( !EQUIV(config.gamma[mode], 0) ) { output = pow(output, 1.0 / config.gamma[mode]); - CLAMP(output, 0, 1.0); + CLAMP(output, 0, 100.0); } // Apply value curve