Corrected a stupid mistake I made when I changed rcm to use the

* plug-ins/rcm/rcm_misc.c: Corrected a stupid mistake I made when
  I changed rcm to use the gimp_color_space functions (fixes #5967).

* plug-ins/common/decompose.c: Fixed a minor problem Mitch
  introduced lately and removed another occurence of sprintf/gettext.


--Sven
This commit is contained in:
Sven Neumann 2000-02-06 20:04:24 +00:00
parent de5cb7cddb
commit 47e196bb9a
3 changed files with 18 additions and 13 deletions

View file

@ -1,3 +1,11 @@
Sun Feb 6 20:46:36 CET 2000 Sven Neumann <sven@gimp.org>
* plug-ins/rcm/rcm_misc.c: Corrected a stupid mistake I made when
I changed rcm to use the gimp_color_space functions (fixes #5967).
* plug-ins/common/decompose.c: Fixed a minor problem Mitch
introduced lately and removed another occurence of sprintf/gettext.
2000-02-05 Michael Natterer <mitch@gimp.org>
* libgimp/gimpcolorspace.[ch]: use g* types and name the

View file

@ -115,7 +115,7 @@ static EXTRACT extract[] =
{ N_("Red"), FALSE, 1, { N_("red") }, extract_red },
{ N_("Green"), FALSE, 1, { N_("green") }, extract_green },
{ N_("Blue"), FALSE, 1, { N_("blue") }, extract_blue },
{ N_("HSV"), FALSE, 3, { N_("hue"),
{ N_("HSV"), TRUE, 3, { N_("hue"),
N_("saturation"),
N_("value") }, extract_hsv },
{ N_("Hue"), FALSE, 1, { N_("hue") }, extract_hue },
@ -327,7 +327,7 @@ decompose (gint32 image_ID,
gint i, j, extract_idx, scan_lines;
gint height, width, tile_height, num_images;
guchar *src = (guchar *)ident; /* Just to satisfy gcc/lint */
char filename[1024];
gchar *filename;
guchar *dst[MAX_EXTRACT_IMAGES];
gint32 layer_ID_dst[MAX_EXTRACT_IMAGES];
GDrawable *drawable_src, *drawable_dst[MAX_EXTRACT_IMAGES];
@ -375,12 +375,13 @@ decompose (gint32 image_ID,
for (j = 0; j < num_images; j++)
{
sprintf (filename, "%s-%s", gimp_image_get_filename (image_ID),
gettext (extract[extract_idx].channel_name[j]));
filename = g_strdup_printf ("%s-%s", gimp_image_get_filename (image_ID),
gettext (extract[extract_idx].channel_name[j]));
image_ID_dst[j] = create_new_image (filename, width, height, GRAY,
layer_ID_dst+j, drawable_dst+j,
pixel_rgn_dst+j);
g_free (filename);
dst[j] = g_new (guchar, tile_height * width);
}
@ -882,8 +883,9 @@ decompose_dialog (void)
group = NULL;
for (j = 0; j < NUM_EXTRACT_TYPES; j++)
{
if (!extract[j].dialog) continue;
toggle = gtk_radio_button_new_with_label (group, extract[j].type);
if (!extract[j].dialog)
continue;
toggle = gtk_radio_button_new_with_label (group, gettext (extract[j].type));
group = gtk_radio_button_group (GTK_RADIO_BUTTON (toggle));
gtk_box_pack_start (GTK_BOX (vbox), toggle, TRUE, TRUE, 0);
decoint.extract_flag[j] =

View file

@ -459,7 +459,6 @@ rcm_render_circle (GtkWidget *preview,
{
gint i, j;
gdouble h, s, v;
guchar rgb[3];
guchar *a;
a = g_new (guchar, 3*sum);
@ -480,12 +479,8 @@ rcm_render_circle (GtkWidget *preview,
else
{
h = arctg (sum / 2.0 - j, i - sum / 2.0) / (2 * G_PI);
v = 1 - sqrt (s) / 2;
gimp_hsv_to_rgb4 (rgb, h, s, v);
a[i*3+0] = rgb[0] * 255;
a[i*3+1] = rgb[1] * 255;
a[i*3+2] = rgb[2] * 255;
v = 1 - sqrt (s) / 4;
gimp_hsv_to_rgb4 (&a[i*3], h, s, v);
}
}
gtk_preview_draw_row(GTK_PREVIEW(preview), a, 0, j, sum);