Commit f9c81401 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer
Browse files

reverted the behaviour of the "Reset" button back to resetting the current

2001-01-03  Michael Natterer  <mitch@gimp.org>

	* app/levels.c: reverted the behaviour of the "Reset" button back
	to resetting the current channel only. Resetting all channels was
	broken and IMHO cannot work the way it was implemented.
parent 5b210062
2001-01-03 Michael Natterer <mitch@gimp.org>
* app/levels.c: reverted the behaviour of the "Reset" button back
to resetting the current channel only. Resetting all channels was
broken and IMHO cannot work the way it was implemented.
2001-01-03 Michael Natterer <mitch@gimp.org>
* app/plug_in_cmds.c
......
......@@ -710,7 +710,7 @@ levels_calculate_transfers (LevelsDialog *ld)
inten = CLAMP (inten, 0.0, 1.0);
if (ld->gamma[j] != 0.0)
inten = pow (inten, (1.0 / ld->gamma[j]));
ld->input[j][i] = (unsigned char) (inten * 255.0 + 0.5);
ld->input[j][i] = (guchar) (inten * 255.0 + 0.5);
}
}
}
......@@ -722,14 +722,17 @@ levels_update (LevelsDialog *ld,
gint i;
gint sel_channel;
if(ld->color) {
sel_channel = ld->channel;
} else {
if(ld->channel == 2)
sel_channel = GIMP_HISTOGRAM_ALPHA;
else
sel_channel = GIMP_HISTOGRAM_VALUE;
}
if (ld->color)
{
sel_channel = ld->channel;
}
else
{
if (ld->channel == 2)
sel_channel = GIMP_HISTOGRAM_ALPHA;
else
sel_channel = GIMP_HISTOGRAM_VALUE;
}
/* Recalculate the transfer arrays */
levels_calculate_transfers (ld);
......@@ -998,26 +1001,15 @@ levels_reset_callback (GtkWidget *widget,
gpointer data)
{
LevelsDialog *ld;
int channel;
int maxChannels;
ld = (LevelsDialog *) data;
if (ld->color)
maxChannels = 4;
else
maxChannels = 1;
for (channel = 0; channel < maxChannels; channel++)
{
ld->low_input[channel] = 0;
ld->gamma[channel] = 1.0;
ld->high_input[channel] = 255;
ld->low_output[channel] = 0;
ld->high_output[channel] = 255;
levels_adjust_channel (ld, ld->hist, channel + 1);
}
ld->low_input[ld->channel] = 0;
ld->gamma[ld->channel] = 1.0;
ld->high_input[ld->channel] = 255;
ld->low_output[ld->channel] = 0;
ld->high_output[ld->channel] = 255;
levels_update (ld, ALL);
if (ld->preview)
......
......@@ -710,7 +710,7 @@ levels_calculate_transfers (LevelsDialog *ld)
inten = CLAMP (inten, 0.0, 1.0);
if (ld->gamma[j] != 0.0)
inten = pow (inten, (1.0 / ld->gamma[j]));
ld->input[j][i] = (unsigned char) (inten * 255.0 + 0.5);
ld->input[j][i] = (guchar) (inten * 255.0 + 0.5);
}
}
}
......@@ -722,14 +722,17 @@ levels_update (LevelsDialog *ld,
gint i;
gint sel_channel;
if(ld->color) {
sel_channel = ld->channel;
} else {
if(ld->channel == 2)
sel_channel = GIMP_HISTOGRAM_ALPHA;
else
sel_channel = GIMP_HISTOGRAM_VALUE;
}
if (ld->color)
{
sel_channel = ld->channel;
}
else
{
if (ld->channel == 2)
sel_channel = GIMP_HISTOGRAM_ALPHA;
else
sel_channel = GIMP_HISTOGRAM_VALUE;
}
/* Recalculate the transfer arrays */
levels_calculate_transfers (ld);
......@@ -998,26 +1001,15 @@ levels_reset_callback (GtkWidget *widget,
gpointer data)
{
LevelsDialog *ld;
int channel;
int maxChannels;
ld = (LevelsDialog *) data;
if (ld->color)
maxChannels = 4;
else
maxChannels = 1;
for (channel = 0; channel < maxChannels; channel++)
{
ld->low_input[channel] = 0;
ld->gamma[channel] = 1.0;
ld->high_input[channel] = 255;
ld->low_output[channel] = 0;
ld->high_output[channel] = 255;
levels_adjust_channel (ld, ld->hist, channel + 1);
}
ld->low_input[ld->channel] = 0;
ld->gamma[ld->channel] = 1.0;
ld->high_input[ld->channel] = 255;
ld->low_output[ld->channel] = 0;
ld->high_output[ld->channel] = 255;
levels_update (ld, ALL);
if (ld->preview)
......
......@@ -710,7 +710,7 @@ levels_calculate_transfers (LevelsDialog *ld)
inten = CLAMP (inten, 0.0, 1.0);
if (ld->gamma[j] != 0.0)
inten = pow (inten, (1.0 / ld->gamma[j]));
ld->input[j][i] = (unsigned char) (inten * 255.0 + 0.5);
ld->input[j][i] = (guchar) (inten * 255.0 + 0.5);
}
}
}
......@@ -722,14 +722,17 @@ levels_update (LevelsDialog *ld,
gint i;
gint sel_channel;
if(ld->color) {
sel_channel = ld->channel;
} else {
if(ld->channel == 2)
sel_channel = GIMP_HISTOGRAM_ALPHA;
else
sel_channel = GIMP_HISTOGRAM_VALUE;
}
if (ld->color)
{
sel_channel = ld->channel;
}
else
{
if (ld->channel == 2)
sel_channel = GIMP_HISTOGRAM_ALPHA;
else
sel_channel = GIMP_HISTOGRAM_VALUE;
}
/* Recalculate the transfer arrays */
levels_calculate_transfers (ld);
......@@ -998,26 +1001,15 @@ levels_reset_callback (GtkWidget *widget,
gpointer data)
{
LevelsDialog *ld;
int channel;
int maxChannels;
ld = (LevelsDialog *) data;
if (ld->color)
maxChannels = 4;
else
maxChannels = 1;
for (channel = 0; channel < maxChannels; channel++)
{
ld->low_input[channel] = 0;
ld->gamma[channel] = 1.0;
ld->high_input[channel] = 255;
ld->low_output[channel] = 0;
ld->high_output[channel] = 255;
levels_adjust_channel (ld, ld->hist, channel + 1);
}
ld->low_input[ld->channel] = 0;
ld->gamma[ld->channel] = 1.0;
ld->high_input[ld->channel] = 255;
ld->low_output[ld->channel] = 0;
ld->high_output[ld->channel] = 255;
levels_update (ld, ALL);
if (ld->preview)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment