This is my rough patch, if anyone wants to try or review it:
diff -r 1541ceae5790 ufraw_preview.c
--- a/ufraw_preview.c Wed May 01 17:25:51 2013 +0300
+++ b/ufraw_preview.c Fri Dec 06 19:21:12 2013 +0200
@@ -1388,6 +1388,7 @@
guint16 rawChannels[4], linearChannels[3];
for (c = 0; c < data->UF->colors; c++)
rawChannels[c] = rawSum[c] / spot.Size;
+
develop_linear(rawChannels, linearChannels, Developer);
double yValue = 0.5;
extern const double xyz_rgb[3][3];
@@ -1398,6 +1399,12 @@
yValue *= (double)Developer->exposure / 0x10000;
rgb[3] = yValue;
rgb[4] = value2zone(yValue);
+
+ /* show raw spotmeter instead of RGB */
+ rgb[0] = rawChannels[0];
+ rgb[1] = rawChannels[1];
+ rgb[2] = rawChannels[2];
+
color_labels_set(data->SpotLabels, rgb);
char tmp[max_name];
g_snprintf(tmp, max_name, "<span background='#%02X%02X%02X'>"
@@ -1644,10 +1651,20 @@
for (c = 0; c < data->UF->colors; c++)
rgb[c] += pixie[c];
}
+
+ double ref[4] = {data->UF->rgbMax, data->UF->rgbMax, data->UF->rgbMax, data->UF->rgbMax};
+
+ if (user_data)
+ {
+ ref[0] *= 4686.0 / 6069 * 1.979;
+ ref[2] *= 2817.0 / 6069 * 1.678;
+ }
+
for (c = 0; c < 4; c++) rgb[c] = MAX(rgb[c], 1);
double chanMulArray[4];
for (c = 0; c < data->UF->colors; c++)
- chanMulArray[c] = (double)spot.Size * data->UF->rgbMax / rgb[c];
+ chanMulArray[c] = (double)spot.Size * ref[c] / rgb[c];
+
if (data->UF->colors < 4) chanMulArray[3] = chanMulArray[1];
UFObject *chanMul = ufgroup_element(CFG->ufobject,
ufChannelMultipliers);
@@ -4377,9 +4394,13 @@
0, 1, _("Green"), _("Green component"));
// Spot WB button:
button = stock_icon_button(GTK_STOCK_COLOR_PICKER,
- _("Select a spot on the preview image to apply spot white balance"),
+ _("Spot white balance"),
G_CALLBACK(spot_wb_event), NULL);
- gtk_table_attach(subTable, button, 7, 8, 0, 2, 0, 0, 0, 0);
+ gtk_table_attach(subTable, button, 7, 8, 0, 1, 0, 0, 0, 0);
+ button = stock_icon_button(GTK_STOCK_COLOR_PICKER,
+ _("Skin white balance"),
+ G_CALLBACK(spot_wb_event), (void*)1);
+ gtk_table_attach(subTable, button, 7, 8, 1, 2, 0, 0, 0, 0);
box = GTK_BOX(gtk_hbox_new(0, 0));
gtk_table_attach(table, GTK_WIDGET(box), 0, 1, 2, 3, 0, 0, 0, 0);
I'm not yet sure how to compile it for Windows (need to dig deep in their instructions). On Linux it was straightforward, probably on Mac too.