[gnome-photos/gnome-3-26] operation-insta-curve: Fix brightness & contrast for 8-bit Nashville



commit 2cf9a0253eb4ff584158166832e97f6a3b9c7abd
Author: Debarshi Ray <debarshir gnome org>
Date:   Mon Dec 11 12:58:59 2017 +0100

    operation-insta-curve: Fix brightness & contrast for 8-bit Nashville
    
    The brightness and contrast of the green and blue channels were not
    being adjusted for 8 bits per channel inputs.

 src/photos-operation-insta-curve.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/src/photos-operation-insta-curve.c b/src/photos-operation-insta-curve.c
index 10f7212..71c879d 100644
--- a/src/photos-operation-insta-curve.c
+++ b/src/photos-operation-insta-curve.c
@@ -760,12 +760,12 @@ photos_operation_insta_curve_nashville_process_alpha_u8 (GeglOperation *operatio
       out[0] = (guint8) (channel * 255.0f);
 
       channel = in[1] / 255.0f;
-      out[1] = (channel - 0.5f) * contrast + brightness + 0.5f;
+      channel = (channel - 0.5f) * contrast + brightness + 0.5f;
       channel = CLAMP (channel, 0.0f, 1.0f);
       out[1] = (guint8) (channel * 255.0f);
 
       channel = in[2] / 255.0f;
-      out[2] = (channel - 0.5f) * contrast + brightness + 0.5f;
+      channel = (channel - 0.5f) * contrast + brightness + 0.5f;
       channel = CLAMP (channel, 0.0f, 1.0f);
       out[2] = (guint8) (channel * 255.0f);
 
@@ -840,12 +840,12 @@ photos_operation_insta_curve_nashville_process_u8 (GeglOperation *operation,
       out[0] = (guint8) (channel * 255.0f);
 
       channel = in[1] / 255.0f;
-      out[1] = (channel - 0.5f) * contrast + brightness + 0.5f;
+      channel = (channel - 0.5f) * contrast + brightness + 0.5f;
       channel = CLAMP (channel, 0.0f, 1.0f);
       out[1] = (guint8) (channel * 255.0f);
 
       channel = in[2] / 255.0f;
-      out[2] = (channel - 0.5f) * contrast + brightness + 0.5f;
+      channel = (channel - 0.5f) * contrast + brightness + 0.5f;
       channel = CLAMP (channel, 0.0f, 1.0f);
       out[2] = (guint8) (channel * 255.0f);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]