[gimp/metadata-browser] change the pow() workaround to be more HDR safe
- From: Roman Joost <romanofski src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/metadata-browser] change the pow() workaround to be more HDR safe
- Date: Thu, 13 Sep 2012 00:12:44 +0000 (UTC)
commit 96223ec916146fdcc5a61369efab22fea78eb3f4
Author: Simon Budig <simon budig de>
Date: Thu May 10 21:26:48 2012 +0200
change the pow() workaround to be more HDR safe
app/operations/gimpoperationlevels.c | 5 +----
1 files changed, 1 insertions(+), 4 deletions(-)
---
diff --git a/app/operations/gimpoperationlevels.c b/app/operations/gimpoperationlevels.c
index 8863d59..9ab9009 100644
--- a/app/operations/gimpoperationlevels.c
+++ b/app/operations/gimpoperationlevels.c
@@ -86,16 +86,13 @@ gimp_operation_levels_map (gdouble value,
gdouble low_output,
gdouble high_output)
{
- /* clamp to guard pow() against negative input */
- value = MAX (value, low_input);
-
/* determine input intensity */
if (high_input != low_input)
value = (value - low_input) / (high_input - low_input);
else
value = (value - low_input);
- if (inv_gamma != 1.0)
+ if (inv_gamma != 1.0 && value > 0)
value = pow (value, inv_gamma);
/* determine the output intensity */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]