Hello,

please review and push if good.

hal

>From c3a2204bb1c7ed19ce8e06f65a29da9f1d56135e Mon Sep 17 00:00:00 2001
From: hal <hal.from.2...@gmail.com>
Date: Tue, 29 Jan 2013 21:27:01 +0100
Subject: [PATCH] Fixed a bug in channelmixer where gray mix mode was enabled
 only if all 3 channels != 0. Now gray mix mode is enabled
 if one or more channel is != 0.

---
 src/iop/channelmixer.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/iop/channelmixer.c b/src/iop/channelmixer.c
index cecd24a..cb7e6c0 100644
--- a/src/iop/channelmixer.c
+++ b/src/iop/channelmixer.c
@@ -150,7 +150,7 @@ void connect_key_accels(dt_iop_module_t *self)
 void process (struct dt_iop_module_t *self, dt_dev_pixelpipe_iop_t *piece, void *ivoid, void *ovoid, const dt_iop_roi_t *roi_in, const dt_iop_roi_t *roi_out)
 {
   const dt_iop_channelmixer_data_t *data = (dt_iop_channelmixer_data_t *)piece->data;
-  const gboolean gray_mix_mode = ( data->red[CHANNEL_GRAY] !=0.0 &&  data->green[CHANNEL_GRAY] !=0.0 &&  data->blue[CHANNEL_GRAY] !=0.0)?TRUE:FALSE;
+  const gboolean gray_mix_mode = ( data->red[CHANNEL_GRAY] !=0.0 ||  data->green[CHANNEL_GRAY] !=0.0 ||  data->blue[CHANNEL_GRAY] !=0.0)?TRUE:FALSE;
   const int ch = piece->colors;
 
 #ifdef _OPENMP
@@ -243,7 +243,7 @@ process_cl (struct dt_iop_module_t *self, dt_dev_pixelpipe_iop_t *piece, cl_mem
   const int width = roi_in->width;
   const int height = roi_in->height;
 
-  const int gray_mix_mode = (data->red[CHANNEL_GRAY] != 0.0f && data->green[CHANNEL_GRAY] != 0.0f &&  data->blue[CHANNEL_GRAY] != 0.0f) ? TRUE : FALSE;
+  const int gray_mix_mode = (data->red[CHANNEL_GRAY] != 0.0f || data->green[CHANNEL_GRAY] != 0.0f ||  data->blue[CHANNEL_GRAY] != 0.0f) ? TRUE : FALSE;
 
   size_t sizes[] = { ROUNDUPWD(width), ROUNDUPHT(height), 1};
 
-- 
1.7.10.4

------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnnow-d2d
_______________________________________________
darktable-devel mailing list
darktable-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/darktable-devel

Reply via email to