Here's take two. The white balancing has been removed from
dcraw_finalize_interpolate(), together with the hack to compensate
for that again. This consolidates the path for WB because
dcraw_finalize_shrink() doesn't do that either.
A developer_init() call has been removed. It was no longer necessary
after adding a ufraw_developer_prepare() to create_base_image(). That
call was missing anyway but you wouldn't notice it unless ufraw started
up at 100% zoom (=>kaboom).
diff --git a/dcraw_api.cc b/dcraw_api.cc
index 5b9e8b4..0e4407a 100644
--- a/dcraw_api.cc
+++ b/dcraw_api.cc
@@ -538,7 +538,7 @@ int dcraw_wavelet_denoise_shrinked(dcraw_image_data *f,
}
int dcraw_finalize_interpolate(dcraw_image_data *f, dcraw_data *h,
- dcraw_data *dark, int interpolation, int smoothing, int rgbWB[4])
+ dcraw_data *dark, int interpolation, int smoothing)
{
DCRaw *d = (DCRaw *)h->dcraw;
int fujiWidth, i, r, c, cl, pixels;
@@ -577,13 +577,12 @@ int dcraw_finalize_interpolate(dcraw_image_data *f,
dcraw_data *h,
if ( interpolation==dcraw_ppg_interpolation && h->colors > 3 )
interpolation = dcraw_vng_interpolation;
f4 = h->fourColorFilters;
- if (h->colors==3) rgbWB[3] = rgbWB[1];
for(r=0; r<h->height; r++)
for(c=0; c<h->width; c++) {
int cc = fc_INDI(f4,r,c);
f->image[r*f->width+c][fc_INDI(ff,r,c)] = MIN( MAX( (gint64)
- (get_pixel(h, dark, r/2, c/2, cc, pixels) - black) *
- rgbWB[cc]/0x10000, 0), 0xFFFF);
+ (get_pixel(h, dark, r/2, c/2, cc, pixels) - black), 0),
+ 0xFFFF);
}
int smoothPasses = 1;
if (interpolation==dcraw_bilinear_interpolation)
diff --git a/dcraw_api.h b/dcraw_api.h
index 6e6d35c..0a5b08a 100644
--- a/dcraw_api.h
+++ b/dcraw_api.h
@@ -74,7 +74,7 @@ int dcraw_wavelet_denoise(dcraw_data *h, float threshold);
int dcraw_wavelet_denoise_shrinked(dcraw_image_data *f,
dcraw_data *h, float threshold);
int dcraw_finalize_interpolate(dcraw_image_data *f, dcraw_data *h,
- dcraw_data *dark, int interpolation, int smoothing, int rgbWB[4]);
+ dcraw_data *dark, int interpolation, int smoothing);
void dcraw_close(dcraw_data *h);
int dcraw_image_dimensions(dcraw_data *raw, int flip, int *height, int *width);
diff --git a/ufraw_preview.c b/ufraw_preview.c
index 34b0697..4971c3c 100644
--- a/ufraw_preview.c
+++ b/ufraw_preview.c
@@ -873,9 +873,6 @@ static gboolean render_prepare(preview_data *data)
CFG->curve[CFG->curveIndex].m_anchors[0].x);
gtk_label_set_text(GTK_LABEL(data->BlackLabel), text);
- if ( Developer==NULL )
- Developer = developer_init();
-
if ( CFG->profileIndex[display_profile]==0 ) {
guint8 *displayProfile;
gint profileSize;
@@ -1879,6 +1876,7 @@ static void create_base_image(preview_data *data)
CFG->shrink = CFG->Scale;
}
preview_invalidate_layer (data, ufraw_denoise_phase);
+ ufraw_developer_prepare(data->UF, display_developer);
ufraw_convert_image_init(data->UF);
ufraw_convert_image_first_phase(data->UF, FALSE);
ufraw_rotate_image_buffer(&data->UF->Images[ufraw_first_phase],
data->UF->conf->rotationAngle);
@@ -4260,7 +4258,7 @@ static void whitebalance_fill_interface(preview_data
*data,
// Zoom percentage spin button:
data->ZoomAdjustment = GTK_ADJUSTMENT(gtk_adjustment_new(
- CFG->Zoom, 5, 50, 1, 1, 0));
+ CFG->Zoom, 5, 100, 1, 1, 0));
g_object_set_data(G_OBJECT(data->ZoomAdjustment),
"Adjustment-Accuracy", (gpointer)0);
button = gtk_spin_button_new(data->ZoomAdjustment, 1, 0);
@@ -5152,7 +5150,7 @@ int ufraw_preview(ufraw_data *uf, conf_data *rc, int
plugin,
max_preview_height = MIN(def_preview_height, screen.height-152);
CFG->Scale = MAX((uf->rotatedWidth-1)/max_preview_width,
(uf->rotatedHeight-1)/max_preview_height)+1;
- CFG->Scale = MAX(2, CFG->Scale);
+ CFG->Scale = MAX(min_scale, CFG->Scale);
CFG->Zoom = 100.0 / CFG->Scale;
// Make preview size a tiny bit larger to prevent rounding errors
// that will cause the scrollbars to appear.
@@ -5370,7 +5368,7 @@ int ufraw_preview(ufraw_data *uf, conf_data *rc, int
plugin,
// Zoom percentage spin button:
data->ZoomAdjustment = GTK_ADJUSTMENT(gtk_adjustment_new(
- CFG->Zoom, 5, 50, 1, 1, 0));
+ CFG->Zoom, 5, 100, 1, 1, 0));
g_object_set_data(G_OBJECT(data->ZoomAdjustment),
"Adjustment-Accuracy", (gpointer)0);
button = gtk_spin_button_new(data->ZoomAdjustment, 1, 0);
diff --git a/ufraw_ufraw.c b/ufraw_ufraw.c
index 91b74f5..d14198d 100644
--- a/ufraw_ufraw.c
+++ b/ufraw_ufraw.c
@@ -936,7 +936,7 @@ no_distortion:
* ufraw_convert_image_area() */
int ufraw_convert_image_first_phase(ufraw_data *uf, gboolean lensfix)
{
- int status, c;
+ int status;
dcraw_data *raw = uf->raw;
// final->image memory will be realloc'd as needed
dcraw_image_data final;
@@ -952,10 +952,7 @@ int ufraw_convert_image_first_phase(ufraw_data *uf,
gboolean lensfix)
uf->conf->threshold))!=DCRAW_SUCCESS )
return status;
dcraw_finalize_interpolate(&final, raw, dark, uf->conf->interpolation,
- uf->conf->smoothing, uf->developer->rgbWB);
- uf->developer->rgbMax = uf->developer->max;
- for (c=0; c<4; c++)
- uf->developer->rgbWB[c] = 0x10000;
+ uf->conf->smoothing);
}
dcraw_image_stretch(&final, raw->pixel_aspect);
diff --git a/ufraw_ui.h b/ufraw_ui.h
index 2c67ba4..3b6016b 100644
--- a/ufraw_ui.h
+++ b/ufraw_ui.h
@@ -15,7 +15,7 @@
#define raw_his_size 320
#define live_his_size 256
-#define min_scale 2
+#define min_scale 1
#define max_scale 20
typedef struct {
--
Frank
------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
ufraw-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ufraw-devel