[gnome-photos/gnome-3-24] operation-insta-curve: Fix brightness & contrast for 8-bit Nashville
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos/gnome-3-24] operation-insta-curve: Fix brightness & contrast for 8-bit Nashville
- Date: Mon, 11 Dec 2017 17:34:15 +0000 (UTC)
commit 4cca21811a855ff80863084c12a25e77fca1c17b
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 16206ed..5a0e123 100644
--- a/src/photos-operation-insta-curve.c
+++ b/src/photos-operation-insta-curve.c
@@ -766,12 +766,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);
@@ -846,12 +846,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]