# HG changeset patch
# User Edouard Gomez <[EMAIL PROTECTED]>
# Date 1186441887 -7200
# Node ID 0eb4ff319f1120bbebf645211c4c994df0e73da6
# Parent d45778f740d7a587087ebabd42c1256146619034
wb: fix white balance for 8bit photos and fix setting savings for auto white
balance
Auto white balance is applied on 8bpp pics resulting in mostly all the time
wrong
white balance because the image has been processed by the in camera DSP anyway.
- Force color multipliers to 1.0.
- Fix the autowb application, settings vars were the wrong ones (IMHO)
Still to track:
- Seems like image settings for 8bpp images aren't saved.
diff -r d45778f740d7 -r 0eb4ff319f11 src/gtk-interface.c
--- a/src/gtk-interface.c Wed Aug 01 11:58:04 2007 +0000
+++ b/src/gtk-interface.c Tue Aug 07 01:11:27 2007 +0200
@@ -360,20 +360,20 @@ icon_activated(gpointer instance, const
{
if (rs->photo->metadata->cam_mul[R] == -1.0)
{
- rs->photo->current_setting = 2;
+ rs->current_setting = 2;
rs_set_wb_auto(rs);
- rs->photo->current_setting = 1;
+ rs->current_setting = 1;
rs_set_wb_auto(rs);
- rs->photo->current_setting = 0;
+ rs->current_setting = 0;
rs_set_wb_auto(rs);
}
else
{
- rs->photo->current_setting = 2;
+ rs->current_setting = 2;
rs_set_wb_from_mul(rs,
rs->photo->metadata->cam_mul);
- rs->photo->current_setting = 1;
+ rs->current_setting = 1;
rs_set_wb_from_mul(rs,
rs->photo->metadata->cam_mul);
- rs->photo->current_setting = 0;
+ rs->current_setting = 0;
rs_set_wb_from_mul(rs,
rs->photo->metadata->cam_mul);
}
if (rs->photo->metadata->contrast != -1.0)
diff -r d45778f740d7 -r 0eb4ff319f11 src/rawstudio.c
--- a/src/rawstudio.c Wed Aug 01 11:58:04 2007 +0000
+++ b/src/rawstudio.c Tue Aug 07 01:11:27 2007 +0200
@@ -999,7 +999,7 @@ rs_photo_open_dcraw(const gchar *filenam
if (!dcraw_open(raw, (char *) filename))
{
dcraw_load_raw(raw);
- photo = rs_photo_new(NULL);
+ photo = rs_photo_new();
photo->input = rs_image16_new(raw->raw.width, raw->raw.height,
4, 4);
rs_photo_open_dcraw_apply_black_and_shift(raw, photo);
@@ -1193,6 +1193,13 @@ rs_photo_open_gdk(const gchar *filename)
}
g_object_unref(pixbuf);
photo->filename = g_strdup(filename);
+
+ /* Force white balance to neutral one, 8bit pics have been
+ * white balanced by the camera digital picture processor */
+ photo->metadata->cam_mul[R] = 1.0f;
+ photo->metadata->cam_mul[G] = 1.0f;
+ photo->metadata->cam_mul[B] = 1.0f;
+ photo->metadata->cam_mul[G2] = 1.0f;
}
return(photo);
}
@@ -1318,6 +1325,7 @@ skip_block:
skip_block:
continue;
}
+ memset(pre_mul, 0, sizeof(pre_mul));
for(c=0;c<4;c++)
if (dsum[c])
pre_mul[c] = dsum[c+4] / dsum[c];
_______________________________________________
Rawstudio-dev mailing list
[email protected]
http://rawstudio.org/cgi-bin/mailman/listinfo/rawstudio-dev