mirror of https://github.com/GNOME/gimp.git
gimprc.in user_install renamed the "gflares" dir to "gflare" in all places
2000-02-05 Michael Natterer <mitch@gimp.org> * gimprc.in * user_install * user_install.bat: renamed the "gflares" dir to "gflare" in all places because this seems to be the naming convention of all the other plug-in dirs. * libgimp/gimpwidgets.[ch]: - gimp_random_seed_new(): return the spinbutton and the time toggle as pointers. - gimp_scale_entry_new(): allow the spinbutton to have a larger range of possible values than the scale. * plugins/[all calls to the above two functions]: changed the calls accordingly. Did some more ui updates in some of these plugins (Frames saying "Parameter Settings", spacing etc.) * plug-ins/gflare/Makefile.am * plug-ins/gflare/gflare.c: hacked it to match the plugin ui standards. Didn't get rid of the gradient menus.
This commit is contained in:
parent
496d7277e4
commit
e20554fb84
24
ChangeLog
24
ChangeLog
|
@ -1,3 +1,27 @@
|
|||
2000-02-05 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* gimprc.in
|
||||
* user_install
|
||||
* user_install.bat: renamed the "gflares" dir to "gflare" in all
|
||||
places because this seems to be the naming convention of all the
|
||||
other plug-in dirs.
|
||||
|
||||
* libgimp/gimpwidgets.[ch]:
|
||||
|
||||
- gimp_random_seed_new(): return the spinbutton and the time
|
||||
toggle as pointers.
|
||||
- gimp_scale_entry_new(): allow the spinbutton to have a larger
|
||||
range of possible values than the scale.
|
||||
|
||||
* plugins/[all calls to the above two functions]: changed the
|
||||
calls accordingly.
|
||||
Did some more ui updates in some of these plugins (Frames saying
|
||||
"Parameter Settings", spacing etc.)
|
||||
|
||||
* plug-ins/gflare/Makefile.am
|
||||
* plug-ins/gflare/gflare.c: hacked it to match the plugin ui
|
||||
standards. Didn't get rid of the gradient menus.
|
||||
|
||||
Sat Feb 5 13:22:47 CET 2000 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* app/global_edit.c: Reverted Stanislavs change. While I think that
|
||||
|
|
|
@ -46,8 +46,8 @@ echo "mkdir $2/curves"
|
|||
mkdir $2/curves
|
||||
echo "mkdir $2/gfig"
|
||||
mkdir $2/gfig
|
||||
echo "mkdir $2/gflares"
|
||||
mkdir $2/gflares
|
||||
echo "mkdir $2/gflare"
|
||||
mkdir $2/gflare
|
||||
echo "mkdir $2/fractalexplorer"
|
||||
mkdir $2/fractalexplorer
|
||||
echo "mkdir $2/gimpressionist"
|
||||
|
|
|
@ -13,7 +13,7 @@ mkdir %2\plug-ins
|
|||
mkdir %2\modules
|
||||
mkdir %2\scripts
|
||||
mkdir %2\gfig
|
||||
mkdir %2\gflares
|
||||
mkdir %2\gflare
|
||||
mkdir %2\fractalexplorer
|
||||
mkdir %2\gimpressionist
|
||||
mkdir %2\gimpressionist\Brushes
|
||||
|
|
|
@ -310,6 +310,6 @@
|
|||
|
||||
# GFlare path
|
||||
# This path will be searched for gflares when you use the GFlare plug-in.
|
||||
(gflare-path "${gimp_dir}/gflares:${gimp_data_dir}/gflares")
|
||||
(gflare-path "${gimp_dir}/gflare:${gimp_data_dir}/gflare")
|
||||
|
||||
# [end of file]
|
||||
|
|
|
@ -310,6 +310,6 @@
|
|||
|
||||
# GFlare path
|
||||
# This path will be searched for gflares when you use the GFlare plug-in.
|
||||
(gflare-path "${gimp_dir}/gflares:${gimp_data_dir}/gflares")
|
||||
(gflare-path "${gimp_dir}/gflare:${gimp_data_dir}/gflare")
|
||||
|
||||
# [end of file]
|
||||
|
|
|
@ -397,6 +397,17 @@ gimp_spin_button_new (GtkObject **adjustment, /* return value */
|
|||
return spinbutton;
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_scale_entry_unconstrained_adjustment_callback (GtkAdjustment *adjustment,
|
||||
GtkAdjustment *other_adj)
|
||||
{
|
||||
gtk_signal_handler_block_by_data (GTK_OBJECT (other_adj), adjustment);
|
||||
|
||||
gtk_adjustment_set_value (other_adj, adjustment->value);
|
||||
|
||||
gtk_signal_handler_unblock_by_data (GTK_OBJECT (other_adj), adjustment);
|
||||
}
|
||||
|
||||
GtkObject *
|
||||
gimp_scale_entry_new (GtkTable *table,
|
||||
gint column,
|
||||
|
@ -410,6 +421,9 @@ gimp_scale_entry_new (GtkTable *table,
|
|||
gfloat step_increment,
|
||||
gfloat page_increment,
|
||||
guint digits,
|
||||
gboolean constrain,
|
||||
gfloat unconstrained_lower,
|
||||
gfloat unconstrained_upper,
|
||||
gchar *tooltip,
|
||||
gchar *private_tip)
|
||||
{
|
||||
|
@ -417,6 +431,7 @@ gimp_scale_entry_new (GtkTable *table,
|
|||
GtkWidget *scale;
|
||||
GtkWidget *spinbutton;
|
||||
GtkObject *adjustment;
|
||||
GtkObject *return_adj;
|
||||
|
||||
label = gtk_label_new (text);
|
||||
gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5);
|
||||
|
@ -425,9 +440,45 @@ gimp_scale_entry_new (GtkTable *table,
|
|||
GTK_FILL, GTK_FILL, 0, 0);
|
||||
gtk_widget_show (label);
|
||||
|
||||
spinbutton = gimp_spin_button_new (&adjustment, value, lower, upper,
|
||||
step_increment, page_increment, 0.0,
|
||||
1.0, digits);
|
||||
if (! constrain &&
|
||||
unconstrained_lower <= lower &&
|
||||
unconstrained_upper >= upper)
|
||||
{
|
||||
GtkObject *constrained_adj;
|
||||
|
||||
constrained_adj = gtk_adjustment_new (value, lower, upper,
|
||||
step_increment, page_increment,
|
||||
0.0);
|
||||
|
||||
spinbutton = gimp_spin_button_new (&adjustment, value,
|
||||
unconstrained_lower,
|
||||
unconstrained_upper,
|
||||
step_increment, page_increment, 0.0,
|
||||
1.0, digits);
|
||||
|
||||
gtk_signal_connect
|
||||
(GTK_OBJECT (constrained_adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_scale_entry_unconstrained_adjustment_callback),
|
||||
adjustment);
|
||||
|
||||
gtk_signal_connect
|
||||
(GTK_OBJECT (adjustment), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_scale_entry_unconstrained_adjustment_callback),
|
||||
constrained_adj);
|
||||
|
||||
return_adj = adjustment;
|
||||
|
||||
adjustment = constrained_adj;
|
||||
}
|
||||
else
|
||||
{
|
||||
spinbutton = gimp_spin_button_new (&adjustment, value, lower, upper,
|
||||
step_increment, page_increment, 0.0,
|
||||
1.0, digits);
|
||||
|
||||
return_adj = adjustment;
|
||||
}
|
||||
|
||||
if (spinbutton_usize > 0)
|
||||
gtk_widget_set_usize (spinbutton, spinbutton_usize, -1);
|
||||
|
||||
|
@ -438,12 +489,12 @@ gimp_scale_entry_new (GtkTable *table,
|
|||
gtk_scale_set_draw_value (GTK_SCALE (scale), FALSE);
|
||||
gtk_table_attach (GTK_TABLE (table), scale,
|
||||
column + 1, column + 2, row, row + 1,
|
||||
GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
|
||||
GTK_FILL | GTK_EXPAND, GTK_FILL, 0, 0);
|
||||
gtk_widget_show (scale);
|
||||
|
||||
gtk_table_attach (GTK_TABLE (table), spinbutton,
|
||||
column + 2, column + 3, row, row + 1,
|
||||
GTK_SHRINK, GTK_FILL, 0, 0);
|
||||
GTK_SHRINK, GTK_SHRINK, 0, 0);
|
||||
gtk_widget_show (spinbutton);
|
||||
|
||||
if (tooltip || private_tip)
|
||||
|
@ -452,7 +503,7 @@ gimp_scale_entry_new (GtkTable *table,
|
|||
gimp_help_set_help_data (spinbutton, tooltip, private_tip);
|
||||
}
|
||||
|
||||
return adjustment;
|
||||
return return_adj;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -474,15 +525,17 @@ gimp_random_seed_toggle_update (GtkWidget *widget,
|
|||
}
|
||||
|
||||
GtkWidget *
|
||||
gimp_random_seed_new (gint *seed,
|
||||
gint *use_time,
|
||||
gint time_true,
|
||||
gint time_false)
|
||||
gimp_random_seed_new (gint *seed,
|
||||
GtkWidget **seed_spinbutton,
|
||||
gint *use_time,
|
||||
GtkWidget **time_button,
|
||||
gint time_true,
|
||||
gint time_false)
|
||||
{
|
||||
GtkWidget *hbox;
|
||||
GtkWidget *spinbutton;
|
||||
GtkObject *adj;
|
||||
GtkWidget *time_button;
|
||||
GtkWidget *button;
|
||||
|
||||
hbox = gtk_hbox_new (FALSE, 4);
|
||||
|
||||
|
@ -494,34 +547,40 @@ gimp_random_seed_new (gint *seed,
|
|||
seed);
|
||||
gtk_widget_show (spinbutton);
|
||||
|
||||
if (seed_spinbutton)
|
||||
*seed_spinbutton = spinbutton;
|
||||
|
||||
gimp_help_set_help_data (spinbutton,
|
||||
_("If the \"Time\" button is not pressed, "
|
||||
"use this value for random number generator "
|
||||
"seed - this allows you to repeat a "
|
||||
"given \"random\" operation"), NULL);
|
||||
|
||||
time_button = gtk_toggle_button_new_with_label (_("Time"));
|
||||
gtk_misc_set_padding (GTK_MISC (GTK_BIN (time_button)->child), 2, 0);
|
||||
gtk_signal_connect (GTK_OBJECT (time_button), "toggled",
|
||||
button = gtk_toggle_button_new_with_label (_("Time"));
|
||||
gtk_misc_set_padding (GTK_MISC (GTK_BIN (button)->child), 2, 0);
|
||||
gtk_signal_connect (GTK_OBJECT (button), "toggled",
|
||||
GTK_SIGNAL_FUNC (gimp_random_seed_toggle_update),
|
||||
use_time);
|
||||
gtk_box_pack_end (GTK_BOX (hbox), time_button, FALSE, FALSE, 0);
|
||||
gtk_widget_show (time_button);
|
||||
gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0);
|
||||
gtk_widget_show (button);
|
||||
|
||||
gimp_help_set_help_data (time_button,
|
||||
if (time_button)
|
||||
*time_button = button;
|
||||
|
||||
gimp_help_set_help_data (button,
|
||||
_("Seed random number generator from the current "
|
||||
"time - this guarantees a reasonable "
|
||||
"randomization"), NULL);
|
||||
|
||||
gtk_object_set_data (GTK_OBJECT (time_button), "time_true",
|
||||
gtk_object_set_data (GTK_OBJECT (button), "time_true",
|
||||
(gpointer) time_true);
|
||||
gtk_object_set_data (GTK_OBJECT (time_button), "time_false",
|
||||
gtk_object_set_data (GTK_OBJECT (button), "time_false",
|
||||
(gpointer) time_false);
|
||||
|
||||
gtk_object_set_data (GTK_OBJECT (time_button), "inverse_sensitive",
|
||||
gtk_object_set_data (GTK_OBJECT (button), "inverse_sensitive",
|
||||
spinbutton);
|
||||
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (time_button),
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
|
||||
*use_time == time_true);
|
||||
|
||||
return hbox;
|
||||
|
@ -852,7 +911,7 @@ gimp_table_attach_aligned (GtkTable *table,
|
|||
gtk_table_attach (table, label,
|
||||
column, column + 1,
|
||||
row, row + 1,
|
||||
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
|
||||
GTK_FILL, GTK_FILL, 0, 0);
|
||||
gtk_widget_show (label);
|
||||
}
|
||||
|
||||
|
@ -861,19 +920,16 @@ gimp_table_attach_aligned (GtkTable *table,
|
|||
GtkWidget *alignment;
|
||||
|
||||
alignment = gtk_alignment_new (0.0, 0.5, 0.0, 0.0);
|
||||
gtk_table_attach (table, alignment,
|
||||
column + 1, column + 1 + colspan,
|
||||
row, row + 1,
|
||||
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
|
||||
gtk_widget_show (alignment);
|
||||
gtk_container_add (GTK_CONTAINER (alignment), widget);
|
||||
gtk_widget_show (widget);
|
||||
|
||||
widget = alignment;
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_table_attach_defaults (table, widget,
|
||||
column + 1, column + 1 + colspan,
|
||||
row, row + 1);
|
||||
}
|
||||
|
||||
gtk_table_attach (table, widget,
|
||||
column + 1, column + 1 + colspan,
|
||||
row, row + 1,
|
||||
GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
|
||||
|
||||
gtk_widget_show (widget);
|
||||
}
|
||||
|
|
|
@ -112,11 +112,16 @@ GtkObject * gimp_scale_entry_new (GtkTable *table,
|
|||
gfloat step_increment,
|
||||
gfloat page_increment,
|
||||
guint digits,
|
||||
gboolean constrain,
|
||||
gfloat unconstrained_lower,
|
||||
gfloat unconstrained_upper,
|
||||
gchar *tooltip,
|
||||
gchar *private_tip);
|
||||
|
||||
GtkWidget * gimp_random_seed_new (gint *seed,
|
||||
GtkWidget **seed_spinbutton,
|
||||
gint *use_time,
|
||||
GtkWidget **time_button,
|
||||
gint time_true,
|
||||
gint time_false);
|
||||
|
||||
|
|
|
@ -397,6 +397,17 @@ gimp_spin_button_new (GtkObject **adjustment, /* return value */
|
|||
return spinbutton;
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_scale_entry_unconstrained_adjustment_callback (GtkAdjustment *adjustment,
|
||||
GtkAdjustment *other_adj)
|
||||
{
|
||||
gtk_signal_handler_block_by_data (GTK_OBJECT (other_adj), adjustment);
|
||||
|
||||
gtk_adjustment_set_value (other_adj, adjustment->value);
|
||||
|
||||
gtk_signal_handler_unblock_by_data (GTK_OBJECT (other_adj), adjustment);
|
||||
}
|
||||
|
||||
GtkObject *
|
||||
gimp_scale_entry_new (GtkTable *table,
|
||||
gint column,
|
||||
|
@ -410,6 +421,9 @@ gimp_scale_entry_new (GtkTable *table,
|
|||
gfloat step_increment,
|
||||
gfloat page_increment,
|
||||
guint digits,
|
||||
gboolean constrain,
|
||||
gfloat unconstrained_lower,
|
||||
gfloat unconstrained_upper,
|
||||
gchar *tooltip,
|
||||
gchar *private_tip)
|
||||
{
|
||||
|
@ -417,6 +431,7 @@ gimp_scale_entry_new (GtkTable *table,
|
|||
GtkWidget *scale;
|
||||
GtkWidget *spinbutton;
|
||||
GtkObject *adjustment;
|
||||
GtkObject *return_adj;
|
||||
|
||||
label = gtk_label_new (text);
|
||||
gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5);
|
||||
|
@ -425,9 +440,45 @@ gimp_scale_entry_new (GtkTable *table,
|
|||
GTK_FILL, GTK_FILL, 0, 0);
|
||||
gtk_widget_show (label);
|
||||
|
||||
spinbutton = gimp_spin_button_new (&adjustment, value, lower, upper,
|
||||
step_increment, page_increment, 0.0,
|
||||
1.0, digits);
|
||||
if (! constrain &&
|
||||
unconstrained_lower <= lower &&
|
||||
unconstrained_upper >= upper)
|
||||
{
|
||||
GtkObject *constrained_adj;
|
||||
|
||||
constrained_adj = gtk_adjustment_new (value, lower, upper,
|
||||
step_increment, page_increment,
|
||||
0.0);
|
||||
|
||||
spinbutton = gimp_spin_button_new (&adjustment, value,
|
||||
unconstrained_lower,
|
||||
unconstrained_upper,
|
||||
step_increment, page_increment, 0.0,
|
||||
1.0, digits);
|
||||
|
||||
gtk_signal_connect
|
||||
(GTK_OBJECT (constrained_adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_scale_entry_unconstrained_adjustment_callback),
|
||||
adjustment);
|
||||
|
||||
gtk_signal_connect
|
||||
(GTK_OBJECT (adjustment), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_scale_entry_unconstrained_adjustment_callback),
|
||||
constrained_adj);
|
||||
|
||||
return_adj = adjustment;
|
||||
|
||||
adjustment = constrained_adj;
|
||||
}
|
||||
else
|
||||
{
|
||||
spinbutton = gimp_spin_button_new (&adjustment, value, lower, upper,
|
||||
step_increment, page_increment, 0.0,
|
||||
1.0, digits);
|
||||
|
||||
return_adj = adjustment;
|
||||
}
|
||||
|
||||
if (spinbutton_usize > 0)
|
||||
gtk_widget_set_usize (spinbutton, spinbutton_usize, -1);
|
||||
|
||||
|
@ -438,12 +489,12 @@ gimp_scale_entry_new (GtkTable *table,
|
|||
gtk_scale_set_draw_value (GTK_SCALE (scale), FALSE);
|
||||
gtk_table_attach (GTK_TABLE (table), scale,
|
||||
column + 1, column + 2, row, row + 1,
|
||||
GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
|
||||
GTK_FILL | GTK_EXPAND, GTK_FILL, 0, 0);
|
||||
gtk_widget_show (scale);
|
||||
|
||||
gtk_table_attach (GTK_TABLE (table), spinbutton,
|
||||
column + 2, column + 3, row, row + 1,
|
||||
GTK_SHRINK, GTK_FILL, 0, 0);
|
||||
GTK_SHRINK, GTK_SHRINK, 0, 0);
|
||||
gtk_widget_show (spinbutton);
|
||||
|
||||
if (tooltip || private_tip)
|
||||
|
@ -452,7 +503,7 @@ gimp_scale_entry_new (GtkTable *table,
|
|||
gimp_help_set_help_data (spinbutton, tooltip, private_tip);
|
||||
}
|
||||
|
||||
return adjustment;
|
||||
return return_adj;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -474,15 +525,17 @@ gimp_random_seed_toggle_update (GtkWidget *widget,
|
|||
}
|
||||
|
||||
GtkWidget *
|
||||
gimp_random_seed_new (gint *seed,
|
||||
gint *use_time,
|
||||
gint time_true,
|
||||
gint time_false)
|
||||
gimp_random_seed_new (gint *seed,
|
||||
GtkWidget **seed_spinbutton,
|
||||
gint *use_time,
|
||||
GtkWidget **time_button,
|
||||
gint time_true,
|
||||
gint time_false)
|
||||
{
|
||||
GtkWidget *hbox;
|
||||
GtkWidget *spinbutton;
|
||||
GtkObject *adj;
|
||||
GtkWidget *time_button;
|
||||
GtkWidget *button;
|
||||
|
||||
hbox = gtk_hbox_new (FALSE, 4);
|
||||
|
||||
|
@ -494,34 +547,40 @@ gimp_random_seed_new (gint *seed,
|
|||
seed);
|
||||
gtk_widget_show (spinbutton);
|
||||
|
||||
if (seed_spinbutton)
|
||||
*seed_spinbutton = spinbutton;
|
||||
|
||||
gimp_help_set_help_data (spinbutton,
|
||||
_("If the \"Time\" button is not pressed, "
|
||||
"use this value for random number generator "
|
||||
"seed - this allows you to repeat a "
|
||||
"given \"random\" operation"), NULL);
|
||||
|
||||
time_button = gtk_toggle_button_new_with_label (_("Time"));
|
||||
gtk_misc_set_padding (GTK_MISC (GTK_BIN (time_button)->child), 2, 0);
|
||||
gtk_signal_connect (GTK_OBJECT (time_button), "toggled",
|
||||
button = gtk_toggle_button_new_with_label (_("Time"));
|
||||
gtk_misc_set_padding (GTK_MISC (GTK_BIN (button)->child), 2, 0);
|
||||
gtk_signal_connect (GTK_OBJECT (button), "toggled",
|
||||
GTK_SIGNAL_FUNC (gimp_random_seed_toggle_update),
|
||||
use_time);
|
||||
gtk_box_pack_end (GTK_BOX (hbox), time_button, FALSE, FALSE, 0);
|
||||
gtk_widget_show (time_button);
|
||||
gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0);
|
||||
gtk_widget_show (button);
|
||||
|
||||
gimp_help_set_help_data (time_button,
|
||||
if (time_button)
|
||||
*time_button = button;
|
||||
|
||||
gimp_help_set_help_data (button,
|
||||
_("Seed random number generator from the current "
|
||||
"time - this guarantees a reasonable "
|
||||
"randomization"), NULL);
|
||||
|
||||
gtk_object_set_data (GTK_OBJECT (time_button), "time_true",
|
||||
gtk_object_set_data (GTK_OBJECT (button), "time_true",
|
||||
(gpointer) time_true);
|
||||
gtk_object_set_data (GTK_OBJECT (time_button), "time_false",
|
||||
gtk_object_set_data (GTK_OBJECT (button), "time_false",
|
||||
(gpointer) time_false);
|
||||
|
||||
gtk_object_set_data (GTK_OBJECT (time_button), "inverse_sensitive",
|
||||
gtk_object_set_data (GTK_OBJECT (button), "inverse_sensitive",
|
||||
spinbutton);
|
||||
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (time_button),
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
|
||||
*use_time == time_true);
|
||||
|
||||
return hbox;
|
||||
|
@ -852,7 +911,7 @@ gimp_table_attach_aligned (GtkTable *table,
|
|||
gtk_table_attach (table, label,
|
||||
column, column + 1,
|
||||
row, row + 1,
|
||||
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
|
||||
GTK_FILL, GTK_FILL, 0, 0);
|
||||
gtk_widget_show (label);
|
||||
}
|
||||
|
||||
|
@ -861,19 +920,16 @@ gimp_table_attach_aligned (GtkTable *table,
|
|||
GtkWidget *alignment;
|
||||
|
||||
alignment = gtk_alignment_new (0.0, 0.5, 0.0, 0.0);
|
||||
gtk_table_attach (table, alignment,
|
||||
column + 1, column + 1 + colspan,
|
||||
row, row + 1,
|
||||
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
|
||||
gtk_widget_show (alignment);
|
||||
gtk_container_add (GTK_CONTAINER (alignment), widget);
|
||||
gtk_widget_show (widget);
|
||||
|
||||
widget = alignment;
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_table_attach_defaults (table, widget,
|
||||
column + 1, column + 1 + colspan,
|
||||
row, row + 1);
|
||||
}
|
||||
|
||||
gtk_table_attach (table, widget,
|
||||
column + 1, column + 1 + colspan,
|
||||
row, row + 1,
|
||||
GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
|
||||
|
||||
gtk_widget_show (widget);
|
||||
}
|
||||
|
|
|
@ -112,11 +112,16 @@ GtkObject * gimp_scale_entry_new (GtkTable *table,
|
|||
gfloat step_increment,
|
||||
gfloat page_increment,
|
||||
guint digits,
|
||||
gboolean constrain,
|
||||
gfloat unconstrained_lower,
|
||||
gfloat unconstrained_upper,
|
||||
gchar *tooltip,
|
||||
gchar *private_tip);
|
||||
|
||||
GtkWidget * gimp_random_seed_new (gint *seed,
|
||||
GtkWidget **seed_spinbutton,
|
||||
gint *use_time,
|
||||
GtkWidget **time_button,
|
||||
gint time_true,
|
||||
gint time_false);
|
||||
|
||||
|
|
|
@ -674,6 +674,7 @@ alienmap_dialog (void)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
|
||||
_("Red:"), SCALE_WIDTH, 0,
|
||||
wvals.redstretch, 0, 128, 1, 8, 2,
|
||||
TRUE, 0, 0,
|
||||
_("Change intensity of the red channel"), NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (dialog_scale_update),
|
||||
|
@ -682,6 +683,7 @@ alienmap_dialog (void)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
|
||||
_("Green:"), SCALE_WIDTH, 0,
|
||||
wvals.greenstretch, 0, 128, 1, 8, 2,
|
||||
TRUE, 0, 0,
|
||||
_("Change intensity of the green channel"), NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (dialog_scale_update),
|
||||
|
@ -690,6 +692,7 @@ alienmap_dialog (void)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 2,
|
||||
_("Blue:"), SCALE_WIDTH, 0,
|
||||
wvals.bluestretch, 0, 128, 1, 8, 2,
|
||||
TRUE, 0, 0,
|
||||
_("Change intensity of the blue channel"), NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (dialog_scale_update),
|
||||
|
|
|
@ -667,6 +667,7 @@ alienmap2_dialog (void)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
|
||||
_("R/H-Frequency:"), SCALE_WIDTH, 0,
|
||||
wvals.redfrequency, 0, 5.0, 0.1, 1, 2,
|
||||
TRUE, 0, 0,
|
||||
_("Change frequency of the red/hue channel"),
|
||||
NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
|
@ -676,6 +677,7 @@ alienmap2_dialog (void)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
|
||||
_("R/H-Phaseshift:"), SCALE_WIDTH, 0,
|
||||
wvals.redangle, 0, 360.0, 1, 15, 2,
|
||||
TRUE, 0, 0,
|
||||
_("Change angle of the red/hue channel"),
|
||||
NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
|
@ -685,6 +687,7 @@ alienmap2_dialog (void)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 2,
|
||||
_("G/S-Frequency:"), SCALE_WIDTH, 0,
|
||||
wvals.greenfrequency, 0, 5.0, 0.1, 1, 2,
|
||||
TRUE, 0, 0,
|
||||
_("Change frequency of the green/saturation "
|
||||
"channel"), NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
|
@ -694,6 +697,7 @@ alienmap2_dialog (void)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 3,
|
||||
_("G/S-Phaseshift:"), SCALE_WIDTH, 0,
|
||||
wvals.redangle, 0, 360.0, 1, 15, 2,
|
||||
TRUE, 0, 0,
|
||||
_("Change angle of the green/saturation channel"),
|
||||
NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
|
@ -703,6 +707,7 @@ alienmap2_dialog (void)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 4,
|
||||
_("B/L-Frequency:"), SCALE_WIDTH, 0,
|
||||
wvals.bluefrequency, 0, 5.0, 0.1, 1, 2,
|
||||
TRUE, 0, 0,
|
||||
_("Change frequency of the blue/luminance "
|
||||
"channel"), NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
|
@ -712,6 +717,7 @@ alienmap2_dialog (void)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 5,
|
||||
_("B/L-Phaseshift:"), SCALE_WIDTH, 0,
|
||||
wvals.blueangle, 0, 360.0, 1, 15, 2,
|
||||
TRUE, 0, 0,
|
||||
_("Change angle of the blue/luminance channel"),
|
||||
NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
|
|
|
@ -453,6 +453,7 @@ explorer_dialog (void)
|
|||
gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
|
||||
_("XMIN:"), SCALE_WIDTH, 100,
|
||||
wvals.xmin, -3, 3, 0.001, 0.01, 5,
|
||||
TRUE, 0, 0,
|
||||
_("Change the first (minimal) x-coordinate "
|
||||
"delimitation"), NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (elements->xmin), "value_changed",
|
||||
|
@ -463,6 +464,7 @@ explorer_dialog (void)
|
|||
gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
|
||||
_("XMAX:"), SCALE_WIDTH, 100,
|
||||
wvals.xmax, -3, 3, 0.001, 0.01, 5,
|
||||
TRUE, 0, 0,
|
||||
_("Change the second (maximal) x-coordinate "
|
||||
"delimitation"), NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (elements->xmax), "value_changed",
|
||||
|
@ -473,6 +475,7 @@ explorer_dialog (void)
|
|||
gimp_scale_entry_new (GTK_TABLE (table), 0, 2,
|
||||
_("YMIN:"), SCALE_WIDTH, 100,
|
||||
wvals.ymin, -3, 3, 0.001, 0.01, 5,
|
||||
TRUE, 0, 0,
|
||||
_("Change the first (minimal) y-coordinate "
|
||||
"delimitation"), NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (elements->ymin), "value_changed",
|
||||
|
@ -483,6 +486,7 @@ explorer_dialog (void)
|
|||
gimp_scale_entry_new (GTK_TABLE (table), 0, 3,
|
||||
_("YMAX:"), SCALE_WIDTH, 100,
|
||||
wvals.ymax, -3, 3, 0.001, 0.01, 5,
|
||||
TRUE, 0, 0,
|
||||
_("Change the second (maximal) y-coordinate "
|
||||
"delimitation"), NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (elements->ymax), "value_changed",
|
||||
|
@ -493,6 +497,7 @@ explorer_dialog (void)
|
|||
gimp_scale_entry_new (GTK_TABLE (table), 0, 4,
|
||||
_("ITER:"), SCALE_WIDTH, 100,
|
||||
wvals.iter, 0, 1000, 1, 10, 5,
|
||||
TRUE, 0, 0,
|
||||
_("Change the iteration value. The higher it "
|
||||
"is, the more details will be calculated, "
|
||||
"which will take more time"), NULL);
|
||||
|
@ -504,6 +509,7 @@ explorer_dialog (void)
|
|||
gimp_scale_entry_new (GTK_TABLE (table), 0, 5,
|
||||
_("CX:"), SCALE_WIDTH, 100,
|
||||
wvals.cx, -2.5, 2.5, 0.001, 0.01, 5,
|
||||
TRUE, 0, 0,
|
||||
_("Change the CX value (changes aspect of "
|
||||
"fractal, active with every fractal but "
|
||||
"Mandelbrot and Sierpinski)"), NULL);
|
||||
|
@ -515,6 +521,7 @@ explorer_dialog (void)
|
|||
gimp_scale_entry_new (GTK_TABLE (table), 0, 6,
|
||||
_("CY:"), SCALE_WIDTH, 100,
|
||||
wvals.cy, -2.5, 2.5, 0.001, 0.01, 5,
|
||||
TRUE, 0, 0,
|
||||
_("Change the CY value (changes aspect of "
|
||||
"fractal, active with every fractal but "
|
||||
"Mandelbrot and Sierpinski)"), NULL);
|
||||
|
@ -646,6 +653,7 @@ explorer_dialog (void)
|
|||
gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
|
||||
_("Number of Colors:"), SCALE_WIDTH, 0,
|
||||
wvals.ncolors, 2, MAXNCOLORS, 1, 10, 0,
|
||||
TRUE, 0, 0,
|
||||
_("Change the number of colors in the mapping"),
|
||||
NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (elements->ncol), "value_changed",
|
||||
|
@ -680,6 +688,7 @@ explorer_dialog (void)
|
|||
gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
|
||||
_("Red:"), SCALE_WIDTH, 0,
|
||||
wvals.redstretch, 0, 1, 0.01, 0.1, 2,
|
||||
TRUE, 0, 0,
|
||||
_("Change the intensity of the red channel"), NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (elements->red), "value_changed",
|
||||
GTK_SIGNAL_FUNC (explorer_double_adjustment_update),
|
||||
|
@ -689,6 +698,7 @@ explorer_dialog (void)
|
|||
gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
|
||||
_("Green:"), SCALE_WIDTH, 0,
|
||||
wvals.greenstretch, 0, 1, 0.01, 0.1, 2,
|
||||
TRUE, 0, 0,
|
||||
_("Change the intensity of the green channel"), NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (elements->green), "value_changed",
|
||||
GTK_SIGNAL_FUNC (explorer_double_adjustment_update),
|
||||
|
@ -698,6 +708,7 @@ explorer_dialog (void)
|
|||
gimp_scale_entry_new (GTK_TABLE (table), 0, 2,
|
||||
_("Blue:"), SCALE_WIDTH, 0,
|
||||
wvals.bluestretch, 0, 1, 0.01, 0.1, 2,
|
||||
TRUE, 0, 0,
|
||||
_("Change the intensity of the blue channel"), NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (elements->blue), "value_changed",
|
||||
GTK_SIGNAL_FUNC (explorer_double_adjustment_update),
|
||||
|
|
|
@ -1383,6 +1383,7 @@ CML_explorer_dialog (void)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
|
||||
_("Zoom Scale:"), SCALE_WIDTH, 0,
|
||||
VALS.scale, 1, 10, 1, 2, 0,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
CML_explorer_int_entry_init (&widget_pointers[3][1],
|
||||
adj, &VALS.scale);
|
||||
|
@ -1390,6 +1391,7 @@ CML_explorer_dialog (void)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 2,
|
||||
_("Start Offset:"), SCALE_WIDTH, 0,
|
||||
VALS.start_offset, 0, 100, 1, 10, 0,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
CML_explorer_int_entry_init (&widget_pointers[3][2],
|
||||
adj, &VALS.start_offset);
|
||||
|
@ -1409,6 +1411,7 @@ CML_explorer_dialog (void)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
|
||||
_("Seed:"), SCALE_WIDTH, 0,
|
||||
VALS.seed, 0, G_MAXRAND, 1, 10, 0,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
CML_explorer_int_entry_init (&widget_pointers[3][3],
|
||||
adj, &VALS.seed);
|
||||
|
@ -1762,6 +1765,7 @@ CML_dialog_channel_panel_new (gchar *name,
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, index,
|
||||
_("Mod. Rate:"), SCALE_WIDTH, 0,
|
||||
param->mod_rate, 0.0, 1.0, 0.01, 0.1, 2,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
CML_explorer_double_entry_init (&widget_pointers[channel_id][index],
|
||||
adj, ¶m->mod_rate);
|
||||
|
@ -1770,6 +1774,7 @@ CML_dialog_channel_panel_new (gchar *name,
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, index,
|
||||
_("Env. Sensitivity:"), SCALE_WIDTH, 0,
|
||||
param->env_sensitivity, 0.0, 1.0, 0.01, 0.1, 2,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
CML_explorer_double_entry_init (&widget_pointers[channel_id][index],
|
||||
adj, ¶m->env_sensitivity);
|
||||
|
@ -1778,6 +1783,7 @@ CML_dialog_channel_panel_new (gchar *name,
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, index,
|
||||
_("Diffusion Dist.:"), SCALE_WIDTH, 0,
|
||||
param->diffusion_dist, 2, 10, 1, 2, 0,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
CML_explorer_int_entry_init (&widget_pointers[channel_id][index],
|
||||
adj, ¶m->diffusion_dist);
|
||||
|
@ -1786,6 +1792,7 @@ CML_dialog_channel_panel_new (gchar *name,
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, index,
|
||||
_("# of Subranges:"), SCALE_WIDTH, 0,
|
||||
param->range_num, 1, 10, 1, 2, 0,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
CML_explorer_int_entry_init (&widget_pointers[channel_id][index],
|
||||
adj, ¶m->range_num);
|
||||
|
@ -1794,6 +1801,7 @@ CML_dialog_channel_panel_new (gchar *name,
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, index,
|
||||
_("P(ower Factor):"), SCALE_WIDTH, 0,
|
||||
param->power, 0.0, 10.0, 0.1, 1.0, 2,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
CML_explorer_double_entry_init (&widget_pointers[channel_id][index],
|
||||
adj, ¶m->power);
|
||||
|
@ -1802,6 +1810,7 @@ CML_dialog_channel_panel_new (gchar *name,
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, index,
|
||||
_("Parameter k:"), SCALE_WIDTH, 0,
|
||||
param->parameter_k, 0.0, 10.0, 0.1, 1.0, 2,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
CML_explorer_double_entry_init (&widget_pointers[channel_id][index],
|
||||
adj, ¶m->parameter_k);
|
||||
|
@ -1810,6 +1819,7 @@ CML_dialog_channel_panel_new (gchar *name,
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, index,
|
||||
_("Range Low:"), SCALE_WIDTH, 0,
|
||||
param->range_l, 0.0, 1.0, 0.01, 0.1, 2,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
CML_explorer_double_entry_init (&widget_pointers[channel_id][index],
|
||||
adj, ¶m->range_l);
|
||||
|
@ -1818,6 +1828,7 @@ CML_dialog_channel_panel_new (gchar *name,
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, index,
|
||||
_("Range High:"), SCALE_WIDTH, 0,
|
||||
param->range_h, 0.0, 1.0, 0.01, 0.1, 2,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
CML_explorer_double_entry_init (&widget_pointers[channel_id][index],
|
||||
adj, ¶m->range_h);
|
||||
|
@ -1882,6 +1893,7 @@ CML_dialog_advanced_panel_new (gchar *name)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, index,
|
||||
_("Ch. Sensitivity:"), SCALE_WIDTH, 0,
|
||||
param->ch_sensitivity, 0.0, 1.0, 0.01, 0.1, 2,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
CML_explorer_double_entry_init (&widget_pointers[channel_id][index +
|
||||
widget_offset],
|
||||
|
@ -1891,6 +1903,7 @@ CML_dialog_advanced_panel_new (gchar *name)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, index,
|
||||
_("Mutation Rate:"), SCALE_WIDTH, 0,
|
||||
param->mutation_rate, 0.0, 1.0, 0.01, 0.1, 2,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
CML_explorer_double_entry_init (&widget_pointers[channel_id][index +
|
||||
widget_offset],
|
||||
|
@ -1900,6 +1913,7 @@ CML_dialog_advanced_panel_new (gchar *name)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, index,
|
||||
_("Mutation Dist.:"), SCALE_WIDTH, 0,
|
||||
param->mutation_dist, 0.0, 1.0, 0.01, 0.1, 2,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
CML_explorer_double_entry_init (&widget_pointers[channel_id][index +
|
||||
widget_offset],
|
||||
|
|
|
@ -530,6 +530,7 @@ align_layers_dialog (void)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 6,
|
||||
_("Grid Size:"), SCALE_WIDTH, 0,
|
||||
VALS.grid_size, 0, 200, 1, 10, 0,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_int_adjustment_update),
|
||||
|
|
|
@ -434,6 +434,7 @@ blinds_dialog (void)
|
|||
size_data = gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
|
||||
_("Displacement:"), SCALE_WIDTH, 0,
|
||||
bvals.angledsp, 1, 90, 1, 15, 0,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (size_data), "value_changed",
|
||||
GTK_SIGNAL_FUNC (blinds_scale_update),
|
||||
|
@ -442,6 +443,7 @@ blinds_dialog (void)
|
|||
size_data = gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
|
||||
_("Num Segments:"), SCALE_WIDTH, 0,
|
||||
bvals.numsegs, 1, MAX_FANS, 1, 2, 0,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (size_data), "value_changed",
|
||||
GTK_SIGNAL_FUNC (blinds_scale_update),
|
||||
|
|
|
@ -654,7 +654,8 @@ blur_dialog (void)
|
|||
gtk_widget_show (table);
|
||||
|
||||
/* Random Seed */
|
||||
seed_hbox = gimp_random_seed_new (&pivals.blur_seed, &pivals.seed_type,
|
||||
seed_hbox = gimp_random_seed_new (&pivals.blur_seed, NULL,
|
||||
&pivals.seed_type, NULL,
|
||||
SEED_TIME, SEED_USER);
|
||||
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
|
||||
_("Random Seed:"), 1.0, 0.5,
|
||||
|
@ -666,6 +667,7 @@ blur_dialog (void)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
|
||||
_("Randomization %:"), SCALE_WIDTH, 0,
|
||||
pivals.blur_pct, 1.0, 100.0, 1.0, 10.0, 0,
|
||||
TRUE, 0, 0,
|
||||
_("Percentage of pixels to be filtered"), NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_int_adjustment_update),
|
||||
|
@ -677,6 +679,7 @@ blur_dialog (void)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 2,
|
||||
_("Repeat:"), SCALE_WIDTH, 0,
|
||||
pivals.blur_rcount, 1.0, 100.0, 1.0, 10.0, 0,
|
||||
TRUE, 0, 0,
|
||||
_("Number of times to apply filter"), NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_int_adjustment_update),
|
||||
|
|
|
@ -107,7 +107,7 @@
|
|||
#define PLUG_IN_VERSION "August 1997, 2.04"
|
||||
|
||||
#define PREVIEW_SIZE 128
|
||||
#define SCALE_WIDTH 200
|
||||
#define SCALE_WIDTH 0
|
||||
|
||||
/***** Types *****/
|
||||
|
||||
|
@ -760,6 +760,7 @@ bumpmap_dialog (void)
|
|||
GtkWidget *top_vbox;
|
||||
GtkWidget *hbox;
|
||||
GtkWidget *frame;
|
||||
GtkWidget *vbox;
|
||||
GtkWidget *sep;
|
||||
GtkWidget *abox;
|
||||
GtkWidget *pframe;
|
||||
|
@ -773,6 +774,7 @@ bumpmap_dialog (void)
|
|||
gchar **argv;
|
||||
guchar *color_cube;
|
||||
gint i;
|
||||
gint row;
|
||||
|
||||
#if 0
|
||||
g_print ("bumpmap: waiting... (pid %d)\n", getpid ());
|
||||
|
@ -898,78 +900,104 @@ bumpmap_dialog (void)
|
|||
NULL);
|
||||
gtk_widget_show (button);
|
||||
|
||||
/* Table for bottom controls */
|
||||
frame = gtk_frame_new (_("Parameter Settings"));
|
||||
gtk_box_pack_start (GTK_BOX (top_vbox), frame, FALSE, FALSE, 0);
|
||||
gtk_widget_show (frame);
|
||||
|
||||
table = gtk_table_new (8, 3, FALSE);
|
||||
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
|
||||
gtk_table_set_row_spacings (GTK_TABLE (table), 2);
|
||||
gtk_box_pack_start (GTK_BOX (top_vbox), table, FALSE, FALSE, 0);
|
||||
gtk_widget_show (table);
|
||||
vbox = gtk_vbox_new (FALSE, 2);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (vbox), 4);
|
||||
gtk_container_add (GTK_CONTAINER (frame), vbox);
|
||||
gtk_widget_show (vbox);
|
||||
|
||||
/* Bump map menu */
|
||||
table = gtk_table_new (1, 2, FALSE);
|
||||
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
|
||||
gtk_widget_show (table);
|
||||
|
||||
option_menu = gtk_option_menu_new ();
|
||||
menu = gimp_drawable_menu_new (dialog_constrain,
|
||||
dialog_bumpmap_callback,
|
||||
NULL,
|
||||
bmvals.bumpmap_id);
|
||||
gtk_option_menu_set_menu (GTK_OPTION_MENU(option_menu), menu);
|
||||
gtk_option_menu_set_menu (GTK_OPTION_MENU (option_menu), menu);
|
||||
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
|
||||
_("Bump Map:"), 1.0, 0.5,
|
||||
option_menu, 2, FALSE);
|
||||
option_menu, 2, TRUE);
|
||||
|
||||
sep = gtk_hseparator_new ();
|
||||
gtk_box_pack_start (GTK_BOX (vbox), sep, FALSE, FALSE, 0);
|
||||
gtk_widget_show (sep);
|
||||
|
||||
/* Table for bottom controls */
|
||||
|
||||
table = gtk_table_new (7, 3, FALSE);
|
||||
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
|
||||
gtk_table_set_row_spacings (GTK_TABLE (table), 2);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
|
||||
gtk_widget_show (table);
|
||||
|
||||
/* Controls */
|
||||
row = 0;
|
||||
|
||||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
|
||||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, row++,
|
||||
_("Azimuth:"), SCALE_WIDTH, 0,
|
||||
bmvals.azimuth, 0.0, 360.0, 1.0, 15.0, 2,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (dialog_dscale_update),
|
||||
&bmvals.azimuth);
|
||||
|
||||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 2,
|
||||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, row++,
|
||||
_("Elevation:"), SCALE_WIDTH, 0,
|
||||
bmvals.elevation, 0.5, 90.0, 1.0, 5.0, 2,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (dialog_dscale_update),
|
||||
&bmvals.elevation);
|
||||
|
||||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 3,
|
||||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, row++,
|
||||
_("Depth:"), SCALE_WIDTH, 0,
|
||||
bmvals.depth, 1.0, 65.0, 1.0, 5.0, 0,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (dialog_iscale_update_normal),
|
||||
&bmvals.depth);
|
||||
|
||||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 4,
|
||||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, row++,
|
||||
_("X Offset:"), SCALE_WIDTH, 0,
|
||||
bmvals.xofs, -1000.0, 1001.0, 1.0, 10.0, 0,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (dialog_iscale_update_normal),
|
||||
&bmvals.xofs);
|
||||
|
||||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 5,
|
||||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, row++,
|
||||
_("Y Offset:"), SCALE_WIDTH, 0,
|
||||
bmvals.yofs, -1000.0, 1001.0, 1.0, 10.0, 0,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (dialog_iscale_update_normal),
|
||||
&bmvals.yofs);
|
||||
|
||||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 6,
|
||||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, row++,
|
||||
_("Waterlevel:"), SCALE_WIDTH, 0,
|
||||
bmvals.waterlevel, 0.0, 256.0, 1.0, 8.0, 0,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (dialog_iscale_update_full),
|
||||
&bmvals.waterlevel);
|
||||
|
||||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 7,
|
||||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, row++,
|
||||
_("Ambient:"), SCALE_WIDTH, 0,
|
||||
bmvals.ambient, 0.0, 256.0, 1.0, 8.0, 0,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (dialog_iscale_update_normal),
|
||||
|
|
|
@ -393,6 +393,7 @@ check_dialog (void)
|
|||
size_data = gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
|
||||
_("Check Size:"), 200, 0,
|
||||
cvals.size, 1, 400, 1, 10, 0,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (size_data), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_int_adjustment_update),
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/* The GIMP -- an image manipulation program
|
||||
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
||||
*
|
||||
* Compose plug-in (C) 1997,1999 Peter Kirchgessner
|
||||
* e-mail: peter@kirchgessner.net, WWW: http://www.kirchgessner.net
|
||||
*
|
||||
|
@ -57,41 +58,36 @@ static char ident[] = "@(#) GIMP Compose plug-in v1.03 17-Mar-99";
|
|||
/* Declare local functions
|
||||
*/
|
||||
static void query (void);
|
||||
static void run (char *name,
|
||||
int nparams,
|
||||
static void run (gchar *name,
|
||||
gint nparams,
|
||||
GParam *param,
|
||||
int *nreturn_vals,
|
||||
gint *nreturn_vals,
|
||||
GParam **return_vals);
|
||||
|
||||
static void show_message (const char *message);
|
||||
|
||||
static gint32 compose (char *compose_type,
|
||||
static gint32 compose (gchar *compose_type,
|
||||
gint32 *compose_ID,
|
||||
int compose_by_drawable);
|
||||
gint compose_by_drawable);
|
||||
|
||||
static gint32 create_new_image (char *filename, guint width, guint height,
|
||||
GDrawableType gdtype, gint32 *layer_ID, GDrawable **drawable,
|
||||
GPixelRgn *pixel_rgn);
|
||||
static gint32 create_new_image (gchar *filename,
|
||||
guint width,
|
||||
guint height,
|
||||
GDrawableType gdtype,
|
||||
gint32 *layer_ID,
|
||||
GDrawable **drawable,
|
||||
GPixelRgn *pixel_rgn);
|
||||
|
||||
static int cmp_icase (char *s1, char *s2);
|
||||
static void compose_rgb (guchar **src, gint *incr, gint numpix, guchar *dst);
|
||||
static void compose_rgba (guchar **src, gint *incr, gint numpix, guchar *dst);
|
||||
static void compose_hsv (guchar **src, gint *incr, gint numpix, guchar *dst);
|
||||
static void compose_cmy (guchar **src, gint *incr, gint numpix, guchar *dst);
|
||||
static void compose_cmyk (guchar **src, gint *incr, gint numpix, guchar *dst);
|
||||
|
||||
static void compose_rgb (unsigned char **src, int *incr, int numpix,
|
||||
unsigned char *dst);
|
||||
static void compose_rgba (unsigned char **src, int *incr, int numpix,
|
||||
unsigned char *dst);
|
||||
static void compose_hsv (unsigned char **src, int *incr, int numpix,
|
||||
unsigned char *dst);
|
||||
static void compose_cmy (unsigned char **src, int *incr, int numpix,
|
||||
unsigned char *dst);
|
||||
static void compose_cmyk (unsigned char **src, int *incr, int numpix,
|
||||
unsigned char *dst);
|
||||
static gint compose_dialog (gchar *compose_type,
|
||||
gint32 drawable_ID);
|
||||
|
||||
static gint compose_dialog (char *compose_type,
|
||||
gint32 drawable_ID);
|
||||
|
||||
static gint check_gray (gint32 image_id,
|
||||
gint32 drawable_id,
|
||||
gpointer data);
|
||||
static gint check_gray (gint32 image_id,
|
||||
gint32 drawable_id,
|
||||
gpointer data);
|
||||
|
||||
static void image_menu_callback (gint32 id,
|
||||
gpointer data);
|
||||
|
@ -106,58 +102,71 @@ static void compose_type_toggle_update (GtkWidget *widget,
|
|||
|
||||
|
||||
/* Description of a composition */
|
||||
typedef struct {
|
||||
char *compose_type; /* Type of composition ("RGB", "RGBA",...) */
|
||||
int num_images; /* Number of input images needed */
|
||||
char *channel_name[MAX_COMPOSE_IMAGES]; /* channel names for dialog */
|
||||
char *filename; /* Name of new image */
|
||||
/* Compose functon */
|
||||
void (*compose_fun)(unsigned char **src, int *incr_src, int numpix,
|
||||
unsigned char *dst);
|
||||
typedef struct
|
||||
{
|
||||
gchar *compose_type; /* Type of composition ("RGB", "RGBA",...) */
|
||||
gint num_images; /* Number of input images needed */
|
||||
gchar *channel_name[MAX_COMPOSE_IMAGES]; /* channel names for dialog */
|
||||
gchar *filename; /* Name of new image */
|
||||
/* Compose functon */
|
||||
void (*compose_fun) (guchar **src, gint *incr_src, gint numpix, guchar *dst);
|
||||
} COMPOSE_DSC;
|
||||
|
||||
/* Array of available compositions. */
|
||||
#define CHNL_NA "-"
|
||||
|
||||
static COMPOSE_DSC compose_dsc[] = {
|
||||
{ N_("RGB"), 3, { N_("Red:"), N_("Green:"), N_("Blue:"), CHNL_NA },
|
||||
N_("rgb-compose"), compose_rgb },
|
||||
{ N_("RGBA"), 4, { N_("Red:"), N_("Green:"), N_("Blue:"),N_("Alpha:") },
|
||||
N_("rgba-compose"), compose_rgba },
|
||||
{ N_("HSV"), 3, { N_("Hue:"), N_("Saturation:"), N_("Value:"), CHNL_NA },
|
||||
N_("hsv-compose"), compose_hsv },
|
||||
{ N_("CMY"), 3, { N_("Cyan:"), N_("Magenta:"), N_("Yellow:"), CHNL_NA },
|
||||
N_("cmy-compose"), compose_cmy },
|
||||
{ N_("CMYK"), 4, { N_("Cyan:"), N_("Magenta:"),N_("Yellow:"),N_("Black:")},
|
||||
N_("cmyk-compose"), compose_cmyk }
|
||||
static COMPOSE_DSC compose_dsc[] =
|
||||
{
|
||||
{ N_("RGB"), 3, { N_("Red:"),
|
||||
N_("Green:"),
|
||||
N_("Blue:"),
|
||||
CHNL_NA }, N_("rgb-compose"), compose_rgb },
|
||||
{ N_("RGBA"), 4, { N_("Red:"),
|
||||
N_("Green:"),
|
||||
N_("Blue:"),
|
||||
N_("Alpha:") }, N_("rgba-compose"), compose_rgba },
|
||||
{ N_("HSV"), 3, { N_("Hue:"),
|
||||
N_("Saturation:"),
|
||||
N_("Value:"),
|
||||
CHNL_NA }, N_("hsv-compose"), compose_hsv },
|
||||
{ N_("CMY"), 3, { N_("Cyan:"),
|
||||
N_("Magenta:"),
|
||||
N_("Yellow:"),
|
||||
CHNL_NA }, N_("cmy-compose"), compose_cmy },
|
||||
{ N_("CMYK"), 4, { N_("Cyan:"),
|
||||
N_("Magenta:"),
|
||||
N_("Yellow:"),
|
||||
N_("Black:") }, N_("cmyk-compose"), compose_cmyk }
|
||||
};
|
||||
|
||||
#define MAX_COMPOSE_TYPES (sizeof (compose_dsc) / sizeof (compose_dsc[0]))
|
||||
|
||||
|
||||
typedef struct {
|
||||
typedef struct
|
||||
{
|
||||
gint32 compose_ID[MAX_COMPOSE_IMAGES]; /* Image IDs of input images */
|
||||
char compose_type[32]; /* type of composition */
|
||||
gchar compose_type[32]; /* type of composition */
|
||||
} ComposeVals;
|
||||
|
||||
/* Dialog structure */
|
||||
typedef struct {
|
||||
int width, height; /* Size of selected image */
|
||||
typedef struct
|
||||
{
|
||||
gint width, height; /* Size of selected image */
|
||||
|
||||
GtkWidget *channel_label[MAX_COMPOSE_IMAGES]; /* The labels to change */
|
||||
GtkWidget *channel_menu[MAX_COMPOSE_IMAGES]; /* The menues */
|
||||
|
||||
gint32 select_ID[MAX_COMPOSE_IMAGES]; /* Image Ids selected by menu */
|
||||
gint compose_flag[MAX_COMPOSE_TYPES]; /* toggle data of compose type */
|
||||
gint run;
|
||||
gint32 select_ID[MAX_COMPOSE_IMAGES]; /* Image Ids selected by menu */
|
||||
gint compose_flag[MAX_COMPOSE_TYPES]; /* toggle data of compose type */
|
||||
gint run;
|
||||
} ComposeInterface;
|
||||
|
||||
GPlugInInfo PLUG_IN_INFO =
|
||||
{
|
||||
NULL, /* init_proc */
|
||||
NULL, /* quit_proc */
|
||||
query, /* query_proc */
|
||||
run, /* run_proc */
|
||||
NULL, /* init_proc */
|
||||
NULL, /* quit_proc */
|
||||
query, /* query_proc */
|
||||
run, /* run_proc */
|
||||
};
|
||||
|
||||
static ComposeVals composevals =
|
||||
|
@ -182,7 +191,7 @@ static GRunModeType run_mode;
|
|||
MAIN ()
|
||||
|
||||
static void
|
||||
query ()
|
||||
query (void)
|
||||
{
|
||||
static GParamDef args[] =
|
||||
{
|
||||
|
@ -192,15 +201,14 @@ query ()
|
|||
{ PARAM_IMAGE, "image2", "Second input image" },
|
||||
{ PARAM_IMAGE, "image3", "Third input image" },
|
||||
{ PARAM_IMAGE, "image4", "Fourth input image" },
|
||||
{ PARAM_STRING, "compose_type", "What to compose: RGB, RGBA, HSV,\
|
||||
CMY, CMYK" }
|
||||
{ PARAM_STRING, "compose_type", "What to compose: RGB, RGBA, HSV, CMY, CMYK" }
|
||||
};
|
||||
static GParamDef return_vals[] =
|
||||
{
|
||||
{ PARAM_IMAGE, "new_image", "Output image" }
|
||||
};
|
||||
static int nargs = sizeof (args) / sizeof (args[0]);
|
||||
static int nreturn_vals = sizeof (return_vals) / sizeof (return_vals[0]);
|
||||
static gint nargs = sizeof (args) / sizeof (args[0]);
|
||||
static gint nreturn_vals = sizeof (return_vals) / sizeof (return_vals[0]);
|
||||
|
||||
static GParamDef drw_args[] =
|
||||
{
|
||||
|
@ -210,15 +218,14 @@ query ()
|
|||
{ PARAM_DRAWABLE, "drawable2", "Second input drawable" },
|
||||
{ PARAM_DRAWABLE, "drawable3", "Third input drawable" },
|
||||
{ PARAM_DRAWABLE, "drawable4", "Fourth input drawable" },
|
||||
{ PARAM_STRING, "compose_type", "What to compose: RGB, RGBA, HSV,\
|
||||
CMY, CMYK" }
|
||||
{ PARAM_STRING, "compose_type", "What to compose: RGB, RGBA, HSV, CMY, CMYK" }
|
||||
};
|
||||
static GParamDef drw_return_vals[] =
|
||||
{
|
||||
{ PARAM_IMAGE, "new_image", "Output image" }
|
||||
};
|
||||
static int drw_nargs = sizeof (args) / sizeof (args[0]);
|
||||
static int drw_nreturn_vals = sizeof (return_vals) / sizeof (return_vals[0]);
|
||||
static gint drw_nargs = sizeof (args) / sizeof (args[0]);
|
||||
static gint drw_nreturn_vals = sizeof (return_vals) / sizeof (return_vals[0]);
|
||||
|
||||
INIT_I18N ();
|
||||
|
||||
|
@ -250,28 +257,17 @@ query ()
|
|||
}
|
||||
|
||||
|
||||
static void show_message (const char *message)
|
||||
|
||||
{
|
||||
if (run_mode == RUN_INTERACTIVE)
|
||||
gimp_message (message);
|
||||
else
|
||||
printf ("%s\n", message);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
run (char *name,
|
||||
int nparams,
|
||||
run (gchar *name,
|
||||
gint nparams,
|
||||
GParam *param,
|
||||
int *nreturn_vals,
|
||||
gint *nreturn_vals,
|
||||
GParam **return_vals)
|
||||
{
|
||||
static GParam values[2];
|
||||
GStatusType status = STATUS_SUCCESS;
|
||||
gint32 image_ID, drawable_ID;
|
||||
int compose_by_drawable;
|
||||
gchar *msg;
|
||||
gint compose_by_drawable;
|
||||
|
||||
INIT_I18N_UI ();
|
||||
|
||||
|
@ -300,10 +296,8 @@ run (char *name,
|
|||
layer_list = gimp_image_get_layers (param[1].data.d_int32, &nlayers);
|
||||
if ((layer_list == NULL) || (nlayers <= 0))
|
||||
{
|
||||
msg = g_strdup_printf (_("compose: Could not get layers for image %d"),
|
||||
(int)param[1].data.d_int32);
|
||||
show_message (msg);
|
||||
g_free (msg);
|
||||
g_message (_("compose: Could not get layers for image %d"),
|
||||
(gint) param[1].data.d_int32);
|
||||
return;
|
||||
}
|
||||
drawable_ID = layer_list[0];
|
||||
|
@ -323,19 +317,20 @@ run (char *name,
|
|||
case RUN_NONINTERACTIVE:
|
||||
/* Make sure all the arguments are there! */
|
||||
if (nparams != 7)
|
||||
status = STATUS_CALLING_ERROR;
|
||||
|
||||
if (status == STATUS_SUCCESS)
|
||||
{
|
||||
composevals.compose_ID[0] =
|
||||
compose_by_drawable ? param[2].data.d_int32 : param[1].data.d_int32;
|
||||
composevals.compose_ID[1] = param[3].data.d_int32;
|
||||
composevals.compose_ID[2] = param[4].data.d_int32;
|
||||
composevals.compose_ID[3] = param[5].data.d_int32;
|
||||
strncpy (composevals.compose_type, param[6].data.d_string,
|
||||
sizeof (composevals.compose_type));
|
||||
composevals.compose_type[sizeof (composevals.compose_type)-1] = '\0';
|
||||
}
|
||||
{
|
||||
status = STATUS_CALLING_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
composevals.compose_ID[0] =
|
||||
compose_by_drawable ? param[2].data.d_int32 : param[1].data.d_int32;
|
||||
composevals.compose_ID[1] = param[3].data.d_int32;
|
||||
composevals.compose_ID[2] = param[4].data.d_int32;
|
||||
composevals.compose_ID[3] = param[5].data.d_int32;
|
||||
strncpy (composevals.compose_type, param[6].data.d_string,
|
||||
sizeof (composevals.compose_type));
|
||||
composevals.compose_type[sizeof (composevals.compose_type)-1] = '\0';
|
||||
}
|
||||
break;
|
||||
|
||||
case RUN_WITH_LAST_VALS:
|
||||
|
@ -352,21 +347,22 @@ run (char *name,
|
|||
if (run_mode != RUN_NONINTERACTIVE)
|
||||
gimp_progress_init (_("Composing..."));
|
||||
|
||||
image_ID = compose (composevals.compose_type, composevals.compose_ID,
|
||||
image_ID = compose (composevals.compose_type,
|
||||
composevals.compose_ID,
|
||||
compose_by_drawable);
|
||||
|
||||
if (image_ID < 0)
|
||||
{
|
||||
status = STATUS_EXECUTION_ERROR;
|
||||
}
|
||||
{
|
||||
status = STATUS_EXECUTION_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
values[1].data.d_int32 = image_ID;
|
||||
gimp_image_undo_enable (image_ID);
|
||||
gimp_image_clean_all (image_ID);
|
||||
if (run_mode != RUN_NONINTERACTIVE)
|
||||
gimp_display_new (image_ID);
|
||||
}
|
||||
{
|
||||
values[1].data.d_int32 = image_ID;
|
||||
gimp_image_undo_enable (image_ID);
|
||||
gimp_image_clean_all (image_ID);
|
||||
if (run_mode != RUN_NONINTERACTIVE)
|
||||
gimp_display_new (image_ID);
|
||||
}
|
||||
|
||||
/* Store data */
|
||||
if (run_mode == RUN_INTERACTIVE)
|
||||
|
@ -379,13 +375,13 @@ run (char *name,
|
|||
|
||||
/* Compose an image from several gray-images */
|
||||
static gint32
|
||||
compose (char *compose_type,
|
||||
compose (gchar *compose_type,
|
||||
gint32 *compose_ID,
|
||||
int compose_by_drawable)
|
||||
gint compose_by_drawable)
|
||||
{
|
||||
int width, height, tile_height, scan_lines;
|
||||
int num_images, compose_idx, incr_src[MAX_COMPOSE_IMAGES];
|
||||
int i, j;
|
||||
gint width, height, tile_height, scan_lines;
|
||||
gint num_images, compose_idx, incr_src[MAX_COMPOSE_IMAGES];
|
||||
gint i, j;
|
||||
gint num_layers;
|
||||
gint32 layer_ID_dst, image_ID_dst;
|
||||
guchar *src[MAX_COMPOSE_IMAGES], *dst = (guchar *)ident;
|
||||
|
@ -397,7 +393,7 @@ compose (char *compose_type,
|
|||
compose_idx = -1;
|
||||
for (j = 0; j < MAX_COMPOSE_TYPES; j++)
|
||||
{
|
||||
if (cmp_icase (compose_type, compose_dsc[j].compose_type) == 0)
|
||||
if (g_strcasecmp (compose_type, compose_dsc[j].compose_type) == 0)
|
||||
compose_idx = j;
|
||||
}
|
||||
if (compose_idx < 0)
|
||||
|
@ -414,10 +410,10 @@ compose (char *compose_type,
|
|||
|
||||
for (j = 1; j < num_images; j++)
|
||||
{
|
||||
if ( (width != (int)gimp_drawable_width (compose_ID[j]))
|
||||
|| (height != (int)gimp_drawable_height (compose_ID[j])))
|
||||
if ((width != (gint)gimp_drawable_width (compose_ID[j])) ||
|
||||
(height != (gint)gimp_drawable_height (compose_ID[j])))
|
||||
{
|
||||
show_message (_("Compose: Drawables have different size"));
|
||||
g_message (_("Compose: Drawables have different size"));
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
@ -431,29 +427,30 @@ compose (char *compose_type,
|
|||
|
||||
for (j = 1; j < num_images; j++)
|
||||
{
|
||||
if ( (width != (int)gimp_image_width (compose_ID[j]))
|
||||
|| (height != (int)gimp_image_height (compose_ID[j])))
|
||||
if ((width != (gint)gimp_image_width (compose_ID[j])) ||
|
||||
(height != (gint)gimp_image_height (compose_ID[j])))
|
||||
{
|
||||
show_message (_("Compose: Images have different size"));
|
||||
g_message (_("Compose: Images have different size"));
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/* Get first layer/drawable for all input images */
|
||||
for (j = 0; j < num_images; j++)
|
||||
{gint32 *g32;
|
||||
{
|
||||
gint32 *g32;
|
||||
|
||||
/* Get first layer of image */
|
||||
g32 = gimp_image_get_layers (compose_ID[j], &num_layers);
|
||||
if ((g32 == NULL) || (num_layers <= 0))
|
||||
{
|
||||
show_message (_("Compose: Error in getting layer IDs"));
|
||||
return (-1);
|
||||
}
|
||||
|
||||
/* Get drawable for layer */
|
||||
drawable_src[j] = gimp_drawable_get (g32[0]);
|
||||
g_free (g32);
|
||||
/* Get first layer of image */
|
||||
g32 = gimp_image_get_layers (compose_ID[j], &num_layers);
|
||||
if ((g32 == NULL) || (num_layers <= 0))
|
||||
{
|
||||
g_message (_("Compose: Error in getting layer IDs"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Get drawable for layer */
|
||||
drawable_src[j] = gimp_drawable_get (g32[0]);
|
||||
g_free (g32);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -464,12 +461,9 @@ compose (char *compose_type,
|
|||
incr_src[j] = drawable_src[j]->bpp;
|
||||
if ((incr_src[j] != 1) && (incr_src[j] != 2))
|
||||
{
|
||||
gchar *msg =
|
||||
g_strdup_printf (_("Compose: Image is not a gray image (bpp=%d)"),
|
||||
incr_src[j]);
|
||||
show_message (msg);
|
||||
g_free (msg);
|
||||
return (-1);
|
||||
g_message (_("Compose: Image is not a gray image (bpp=%d)"),
|
||||
incr_src[j]);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Get pixel region */
|
||||
|
@ -477,8 +471,7 @@ compose (char *compose_type,
|
|||
width, height, FALSE, FALSE);
|
||||
|
||||
/* Get memory for retrieving information */
|
||||
src[j] = (unsigned char *)g_malloc (tile_height * width
|
||||
* drawable_src[j]->bpp);
|
||||
src[j] = g_new (guchar, tile_height * width * drawable_src[j]->bpp);
|
||||
}
|
||||
|
||||
/* Create new image */
|
||||
|
@ -487,31 +480,31 @@ compose (char *compose_type,
|
|||
image_ID_dst = create_new_image (compose_dsc[compose_idx].filename,
|
||||
width, height, gdtype_dst,
|
||||
&layer_ID_dst, &drawable_dst, &pixel_rgn_dst);
|
||||
dst = (unsigned char *)g_malloc (tile_height * width * drawable_dst->bpp);
|
||||
|
||||
dst = g_new (guchar, tile_height * width * drawable_dst->bpp);
|
||||
|
||||
/* Do the composition */
|
||||
i = 0;
|
||||
while (i < height)
|
||||
{
|
||||
scan_lines = (i+tile_height-1 < height) ? tile_height : (height-i);
|
||||
|
||||
|
||||
/* Get source pixel regions */
|
||||
for (j = 0; j < num_images; j++)
|
||||
gimp_pixel_rgn_get_rect (&(pixel_rgn_src[j]), src[j], 0, i,
|
||||
width, scan_lines);
|
||||
|
||||
|
||||
/* Do the composition */
|
||||
compose_dsc[compose_idx].compose_fun (src,incr_src,width*tile_height,dst);
|
||||
|
||||
|
||||
/* Set destination pixel region */
|
||||
gimp_pixel_rgn_set_rect (&pixel_rgn_dst, dst, 0, i, width, scan_lines);
|
||||
|
||||
|
||||
i += scan_lines;
|
||||
|
||||
|
||||
if (run_mode != RUN_NONINTERACTIVE)
|
||||
gimp_progress_update (((double)i) / (double)height);
|
||||
gimp_progress_update (((gdouble)i) / (gdouble)height);
|
||||
}
|
||||
|
||||
|
||||
for (j = 0; j < num_images; j++)
|
||||
{
|
||||
g_free (src[j]);
|
||||
|
@ -528,69 +521,50 @@ compose (char *compose_type,
|
|||
|
||||
/* Create an image. Sets layer_ID, drawable and rgn. Returns image_ID */
|
||||
static gint32
|
||||
create_new_image (char *filename,
|
||||
create_new_image (gchar *filename,
|
||||
guint width,
|
||||
guint height,
|
||||
GDrawableType gdtype,
|
||||
gint32 *layer_ID,
|
||||
GDrawable **drawable,
|
||||
GPixelRgn *pixel_rgn)
|
||||
GPixelRgn *pixel_rgn)
|
||||
{
|
||||
gint32 image_ID;
|
||||
GImageType gitype;
|
||||
|
||||
|
||||
if ((gdtype == GRAY_IMAGE) || (gdtype == GRAYA_IMAGE))
|
||||
gitype = GRAY;
|
||||
else if ((gdtype == INDEXED_IMAGE) || (gdtype == INDEXEDA_IMAGE))
|
||||
gitype = INDEXED;
|
||||
else
|
||||
gitype = RGB;
|
||||
|
||||
|
||||
image_ID = gimp_image_new (width, height, gitype);
|
||||
gimp_image_set_filename (image_ID, filename);
|
||||
|
||||
|
||||
*layer_ID = gimp_layer_new (image_ID, _("Background"), width, height,
|
||||
gdtype, 100, NORMAL_MODE);
|
||||
gimp_image_add_layer (image_ID, *layer_ID, 0);
|
||||
|
||||
|
||||
*drawable = gimp_drawable_get (*layer_ID);
|
||||
gimp_pixel_rgn_init (pixel_rgn, *drawable, 0, 0, (*drawable)->width,
|
||||
(*drawable)->height, TRUE, FALSE);
|
||||
|
||||
return (image_ID);
|
||||
|
||||
return image_ID;
|
||||
}
|
||||
|
||||
|
||||
/* Compare two strings ignoring case (could also be done by strcasecmp() */
|
||||
/* but is it available everywhere ?) */
|
||||
static int
|
||||
cmp_icase (char *s1,
|
||||
char *s2)
|
||||
{
|
||||
int c1, c2;
|
||||
|
||||
c1 = toupper (*s1); c2 = toupper (*s2);
|
||||
while (*s1 && *s2)
|
||||
{
|
||||
if (c1 != c2) return (c2 - c1);
|
||||
c1 = toupper (*(++s1)); c2 = toupper (*(++s2));
|
||||
}
|
||||
return (c2 - c1);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
compose_rgb (unsigned char **src,
|
||||
int *incr_src,
|
||||
int numpix,
|
||||
unsigned char *dst)
|
||||
compose_rgb (guchar **src,
|
||||
gint *incr_src,
|
||||
gint numpix,
|
||||
guchar *dst)
|
||||
{
|
||||
register unsigned char *red_src = src[0];
|
||||
register unsigned char *green_src = src[1];
|
||||
register unsigned char *blue_src = src[2];
|
||||
register unsigned char *rgb_dst = dst;
|
||||
register int count = numpix;
|
||||
int red_incr = incr_src[0], green_incr = incr_src[1], blue_incr = incr_src[2];
|
||||
register guchar *red_src = src[0];
|
||||
register guchar *green_src = src[1];
|
||||
register guchar *blue_src = src[2];
|
||||
register guchar *rgb_dst = dst;
|
||||
register gint count = numpix;
|
||||
gint red_incr = incr_src[0], green_incr = incr_src[1], blue_incr = incr_src[2];
|
||||
|
||||
if ((red_incr == 1) && (green_incr == 1) && (blue_incr == 1))
|
||||
{
|
||||
|
@ -614,22 +588,22 @@ compose_rgb (unsigned char **src,
|
|||
|
||||
|
||||
static void
|
||||
compose_rgba (unsigned char **src,
|
||||
int *incr_src,
|
||||
int numpix,
|
||||
unsigned char *dst)
|
||||
compose_rgba (guchar **src,
|
||||
gint *incr_src,
|
||||
gint numpix,
|
||||
guchar *dst)
|
||||
{
|
||||
register unsigned char *red_src = src[0];
|
||||
register unsigned char *green_src = src[1];
|
||||
register unsigned char *blue_src = src[2];
|
||||
register unsigned char *alpha_src = src[3];
|
||||
register unsigned char *rgb_dst = dst;
|
||||
register int count = numpix;
|
||||
int red_incr = incr_src[0], green_incr = incr_src[1],
|
||||
register guchar *red_src = src[0];
|
||||
register guchar *green_src = src[1];
|
||||
register guchar *blue_src = src[2];
|
||||
register guchar *alpha_src = src[3];
|
||||
register guchar *rgb_dst = dst;
|
||||
register gint count = numpix;
|
||||
gint red_incr = incr_src[0], green_incr = incr_src[1],
|
||||
blue_incr = incr_src[2], alpha_incr = incr_src[3];
|
||||
|
||||
if ( (red_incr == 1) && (green_incr == 1) && (blue_incr == 1)
|
||||
&& (alpha_incr == 1))
|
||||
if ((red_incr == 1) && (green_incr == 1) && (blue_incr == 1) &&
|
||||
(alpha_incr == 1))
|
||||
{
|
||||
while (count-- > 0)
|
||||
{
|
||||
|
@ -653,23 +627,23 @@ compose_rgba (unsigned char **src,
|
|||
|
||||
|
||||
static void
|
||||
compose_hsv (unsigned char **src,
|
||||
int *incr_src,
|
||||
int numpix,
|
||||
unsigned char *dst)
|
||||
compose_hsv (guchar **src,
|
||||
gint *incr_src,
|
||||
gint numpix,
|
||||
guchar *dst)
|
||||
{
|
||||
register unsigned char *hue_src = src[0];
|
||||
register unsigned char *sat_src = src[1];
|
||||
register unsigned char *val_src = src[2];
|
||||
register unsigned char *rgb_dst = dst;
|
||||
register int count = numpix;
|
||||
int hue_incr = incr_src[0], sat_incr = incr_src[1], val_incr = incr_src[2];
|
||||
|
||||
register guchar *hue_src = src[0];
|
||||
register guchar *sat_src = src[1];
|
||||
register guchar *val_src = src[2];
|
||||
register guchar *rgb_dst = dst;
|
||||
register gint count = numpix;
|
||||
gint hue_incr = incr_src[0], sat_incr = incr_src[1], val_incr = incr_src[2];
|
||||
|
||||
while (count-- > 0)
|
||||
{
|
||||
gimp_hsv_to_rgb4 (rgb_dst, (double) *hue_src / 255.0,
|
||||
(double) *sat_src / 255.0,
|
||||
(double) *val_src / 255.0);
|
||||
gimp_hsv_to_rgb4 (rgb_dst, (gdouble) *hue_src / 255.0,
|
||||
(gdouble) *sat_src / 255.0,
|
||||
(gdouble) *val_src / 255.0);
|
||||
rgb_dst += 3;
|
||||
hue_src += hue_incr;
|
||||
sat_src += sat_incr;
|
||||
|
@ -679,19 +653,20 @@ compose_hsv (unsigned char **src,
|
|||
|
||||
|
||||
static void
|
||||
compose_cmy (unsigned char **src,
|
||||
int *incr_src,
|
||||
int numpix,
|
||||
unsigned char *dst)
|
||||
compose_cmy (guchar **src,
|
||||
gint *incr_src,
|
||||
gint numpix,
|
||||
guchar *dst)
|
||||
{
|
||||
register unsigned char *cyan_src = src[0];
|
||||
register unsigned char *magenta_src = src[1];
|
||||
register unsigned char *yellow_src = src[2];
|
||||
register unsigned char *rgb_dst = dst;
|
||||
register int count = numpix;
|
||||
int cyan_incr = incr_src[0], magenta_incr = incr_src[1],
|
||||
yellow_incr = incr_src[2];
|
||||
|
||||
register guchar *cyan_src = src[0];
|
||||
register guchar *magenta_src = src[1];
|
||||
register guchar *yellow_src = src[2];
|
||||
register guchar *rgb_dst = dst;
|
||||
register gint count = numpix;
|
||||
gint cyan_incr = incr_src[0];
|
||||
gint magenta_incr = incr_src[1];
|
||||
gint yellow_incr = incr_src[2];
|
||||
|
||||
if ((cyan_incr == 1) && (magenta_incr == 1) && (yellow_incr == 1))
|
||||
{
|
||||
while (count-- > 0)
|
||||
|
@ -717,32 +692,36 @@ compose_cmy (unsigned char **src,
|
|||
|
||||
|
||||
static void
|
||||
compose_cmyk (unsigned char **src,
|
||||
int *incr_src,
|
||||
int numpix,
|
||||
unsigned char *dst)
|
||||
compose_cmyk (guchar **src,
|
||||
gint *incr_src,
|
||||
gint numpix,
|
||||
guchar *dst)
|
||||
{
|
||||
register unsigned char *cyan_src = src[0];
|
||||
register unsigned char *magenta_src = src[1];
|
||||
register unsigned char *yellow_src = src[2];
|
||||
register unsigned char *black_src = src[3];
|
||||
register unsigned char *rgb_dst = dst;
|
||||
register int count = numpix;
|
||||
int cyan, magenta, yellow, black;
|
||||
int cyan_incr = incr_src[0], magenta_incr = incr_src[1],
|
||||
yellow_incr = incr_src[2], black_incr = incr_src[3];
|
||||
|
||||
register guchar *cyan_src = src[0];
|
||||
register guchar *magenta_src = src[1];
|
||||
register guchar *yellow_src = src[2];
|
||||
register guchar *black_src = src[3];
|
||||
register guchar *rgb_dst = dst;
|
||||
register gint count = numpix;
|
||||
gint cyan, magenta, yellow, black;
|
||||
gint cyan_incr = incr_src[0];
|
||||
gint magenta_incr = incr_src[1];
|
||||
gint yellow_incr = incr_src[2];
|
||||
gint black_incr = incr_src[3];
|
||||
|
||||
while (count-- > 0)
|
||||
{
|
||||
black = (int)*black_src;
|
||||
black = (gint)*black_src;
|
||||
if (black)
|
||||
{
|
||||
cyan = (int)*cyan_src;
|
||||
magenta = (int)*magenta_src;
|
||||
yellow = (int)*yellow_src;
|
||||
cyan += black; if (cyan > 255) cyan = 255;
|
||||
cyan = (gint) *cyan_src;
|
||||
magenta = (gint) *magenta_src;
|
||||
yellow = (gint) *yellow_src;
|
||||
|
||||
cyan += black; if (cyan > 255) cyan = 255;
|
||||
magenta += black; if (magenta > 255) magenta = 255;
|
||||
yellow += black; if (yellow > 255) yellow = 255;
|
||||
yellow += black; if (yellow > 255) yellow = 255;
|
||||
|
||||
*(rgb_dst++) = 255 - cyan;
|
||||
*(rgb_dst++) = 255 - magenta;
|
||||
*(rgb_dst++) = 255 - yellow;
|
||||
|
@ -762,7 +741,7 @@ compose_cmyk (unsigned char **src,
|
|||
|
||||
|
||||
static gint
|
||||
compose_dialog (char *compose_type,
|
||||
compose_dialog (gchar *compose_type,
|
||||
gint32 drawable_ID)
|
||||
{
|
||||
GtkWidget *dlg;
|
||||
|
@ -773,26 +752,26 @@ compose_dialog (char *compose_type,
|
|||
GtkWidget *label;
|
||||
GtkWidget *table;
|
||||
GtkWidget *image_option_menu, *image_menu;
|
||||
GSList *group;
|
||||
gchar **argv;
|
||||
gint argc;
|
||||
int j, compose_idx, sensitive;
|
||||
GSList *group;
|
||||
gchar **argv;
|
||||
gint argc;
|
||||
gint j, compose_idx, sensitive;
|
||||
|
||||
/* Check default compose type */
|
||||
compose_idx = -1;
|
||||
for (j = 0; j < MAX_COMPOSE_TYPES; j++)
|
||||
{
|
||||
if (cmp_icase (compose_type, compose_dsc[j].compose_type) == 0)
|
||||
compose_idx = j;
|
||||
}
|
||||
{
|
||||
if (g_strcasecmp (compose_type, compose_dsc[j].compose_type) == 0)
|
||||
compose_idx = j;
|
||||
}
|
||||
if (compose_idx < 0) compose_idx = 0;
|
||||
|
||||
/* Save original image width/height */
|
||||
composeint.width = gimp_drawable_width (drawable_ID);
|
||||
composeint.width = gimp_drawable_width (drawable_ID);
|
||||
composeint.height = gimp_drawable_height (drawable_ID);
|
||||
|
||||
argc = 1;
|
||||
argv = g_new (gchar *, 1);
|
||||
argc = 1;
|
||||
argv = g_new (gchar *, 1);
|
||||
argv[0] = g_strdup ("compose");
|
||||
|
||||
gtk_init (&argc, &argv);
|
||||
|
@ -825,8 +804,8 @@ compose_dialog (char *compose_type,
|
|||
gtk_frame_set_shadow_type (GTK_FRAME (left_frame), GTK_SHADOW_ETCHED_IN);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), left_frame, FALSE, FALSE, 0);
|
||||
|
||||
left_vbox = gtk_vbox_new (FALSE, 2);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (left_vbox), 4);
|
||||
left_vbox = gtk_vbox_new (FALSE, 1);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (left_vbox), 2);
|
||||
gtk_container_add (GTK_CONTAINER (left_frame), left_vbox);
|
||||
|
||||
/* The right frame keeps the selection menues for images. */
|
||||
|
@ -916,9 +895,9 @@ check_gray (gint32 image_id,
|
|||
gpointer data)
|
||||
|
||||
{
|
||||
return ((gimp_image_base_type (image_id) == GRAY)
|
||||
&& (gimp_image_width (image_id) == composeint.width)
|
||||
&& (gimp_image_height (image_id) == composeint.height));
|
||||
return ((gimp_image_base_type (image_id) == GRAY) &&
|
||||
(gimp_image_width (image_id) == composeint.width) &&
|
||||
(gimp_image_height (image_id) == composeint.height));
|
||||
}
|
||||
|
||||
|
||||
|
@ -926,7 +905,7 @@ static void
|
|||
image_menu_callback (gint32 id,
|
||||
gpointer data)
|
||||
{
|
||||
*(gint32 *)data = id;
|
||||
*(gint32 *) data = id;
|
||||
}
|
||||
|
||||
|
||||
|
@ -934,7 +913,7 @@ static void
|
|||
compose_ok_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
int j;
|
||||
gint j;
|
||||
|
||||
composeint.run = TRUE;
|
||||
gtk_widget_destroy (GTK_WIDGET (data));
|
||||
|
@ -958,8 +937,8 @@ compose_type_toggle_update (GtkWidget *widget,
|
|||
gpointer data)
|
||||
{
|
||||
gint *toggle_val;
|
||||
gint compose_idx, j;
|
||||
int sensitive;
|
||||
gint compose_idx, j;
|
||||
gint sensitive;
|
||||
|
||||
toggle_val = (gint *) data;
|
||||
|
||||
|
@ -980,11 +959,3 @@ compose_type_toggle_update (GtkWidget *widget,
|
|||
else
|
||||
*toggle_val = FALSE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -773,6 +773,7 @@ run_save_dialog (Config *config)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
|
||||
_("Opacity:"), 100, 0,
|
||||
config->opacity, 0, 100, 1, 10, 1,
|
||||
TRUE, 0, 0,
|
||||
FALSE, FALSE);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
|
||||
|
|
|
@ -350,6 +350,7 @@ cubism_dialog (void)
|
|||
scale_data = gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
|
||||
_("Tile Size:"), SCALE_WIDTH, 0,
|
||||
cvals.tile_size, 0.0, 100.0, 1.0, 10.0, 1,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (scale_data), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
|
||||
|
@ -359,6 +360,7 @@ cubism_dialog (void)
|
|||
gimp_scale_entry_new (GTK_TABLE (table), 0, 2,
|
||||
_("Tile Saturation:"), SCALE_WIDTH, 0,
|
||||
cvals.tile_saturation, 0.0, 10.0, 0.1, 1, 1,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (scale_data), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/* The GIMP -- an image manipulation program
|
||||
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
||||
*
|
||||
* Decompose plug-in (C) 1997 Peter Kirchgessner
|
||||
* e-mail: peter@kirchgessner.net, WWW: http://www.kirchgessner.net
|
||||
*
|
||||
|
@ -49,124 +50,113 @@ static char ident[] = "@(#) GIMP Decompose plug-in v1.01 19-Mar-99";
|
|||
/* Declare local functions
|
||||
*/
|
||||
static void query (void);
|
||||
static void run (char *name,
|
||||
int nparams,
|
||||
static void run (gchar *name,
|
||||
gint nparams,
|
||||
GParam *param,
|
||||
int *nreturn_vals,
|
||||
gint *nreturn_vals,
|
||||
GParam **return_vals);
|
||||
|
||||
static gint32 decompose (gint32 image_id,
|
||||
gint32 drawable_ID,
|
||||
char *extract_type,
|
||||
gchar *extract_type,
|
||||
gint32 *drawable_ID_dst);
|
||||
|
||||
static gint32 create_new_image (char *filename, guint width, guint height,
|
||||
GImageType type, gint32 *layer_ID, GDrawable **drawable,
|
||||
GPixelRgn *pixel_rgn);
|
||||
static gint32 create_new_image (gchar *filename,
|
||||
guint width,
|
||||
guint height,
|
||||
GImageType type,
|
||||
gint32 *layer_ID,
|
||||
GDrawable **drawable,
|
||||
GPixelRgn *pixel_rgn);
|
||||
|
||||
static void show_message (const char *msg);
|
||||
static int cmp_icase (char *s1, char *s2);
|
||||
static void extract_rgb (guchar *src, gint bpp, gint numpix, guchar **dst);
|
||||
static void extract_red (guchar *src, gint bpp, gint numpix, guchar **dst);
|
||||
static void extract_green (guchar *src, gint bpp, gint numpix, guchar **dst);
|
||||
static void extract_blue (guchar *src, gint bpp, gint numpix, guchar **dst);
|
||||
static void extract_alpha (guchar *src, gint bpp, gint numpix, guchar **dst);
|
||||
static void extract_hsv (guchar *src, gint bpp, gint numpix, guchar **dst);
|
||||
static void extract_hue (guchar *src, gint bpp, gint numpix, guchar **dst);
|
||||
static void extract_sat (guchar *src, gint bpp, gint numpix, guchar **dst);
|
||||
static void extract_val (guchar *src, gint bpp, gint numpix, guchar **dst);
|
||||
static void extract_cmy (guchar *src, gint bpp, gint numpix, guchar **dst);
|
||||
static void extract_cyan (guchar *src, gint bpp, gint numpix, guchar **dst);
|
||||
static void extract_magenta (guchar *src, gint bpp, gint numpix, guchar **dst);
|
||||
static void extract_yellow (guchar *src, gint bpp, gint numpix, guchar **dst);
|
||||
static void extract_cmyk (guchar *src, gint bpp, gint numpix, guchar **dst);
|
||||
static void extract_cyank (guchar *src, gint bpp, gint numpix, guchar **dst);
|
||||
static void extract_magentak (guchar *src, gint bpp, gint numpix, guchar **dst);
|
||||
static void extract_yellowk (guchar *src, gint bpp, gint numpix, guchar **dst);
|
||||
|
||||
static void extract_rgb (unsigned char *src, int bpp, int numpix,
|
||||
unsigned char **dst);
|
||||
static void extract_red (unsigned char *src, int bpp, int numpix,
|
||||
unsigned char **dst);
|
||||
static void extract_green (unsigned char *src, int bpp, int numpix,
|
||||
unsigned char **dst);
|
||||
static void extract_blue (unsigned char *src, int bpp, int numpix,
|
||||
unsigned char **dst);
|
||||
static void extract_alpha (unsigned char *src, int bpp, int numpix,
|
||||
unsigned char **dst);
|
||||
static void extract_hsv (unsigned char *src, int bpp, int numpix,
|
||||
unsigned char **dst);
|
||||
static void extract_hue (unsigned char *src, int bpp, int numpix,
|
||||
unsigned char **dst);
|
||||
static void extract_sat (unsigned char *src, int bpp, int numpix,
|
||||
unsigned char **dst);
|
||||
static void extract_val (unsigned char *src, int bpp, int numpix,
|
||||
unsigned char **dst);
|
||||
static void extract_cmy (unsigned char *src, int bpp, int numpix,
|
||||
unsigned char **dst);
|
||||
static void extract_cyan (unsigned char *src, int bpp, int numpix,
|
||||
unsigned char **dst);
|
||||
static void extract_magenta (unsigned char *src, int bpp, int numpix,
|
||||
unsigned char **dst);
|
||||
static void extract_yellow (unsigned char *src, int bpp, int numpix,
|
||||
unsigned char **dst);
|
||||
static void extract_cmyk (unsigned char *src, int bpp, int numpix,
|
||||
unsigned char **dst);
|
||||
static void extract_cyank (unsigned char *src, int bpp, int numpix,
|
||||
unsigned char **dst);
|
||||
static void extract_magentak (unsigned char *src, int bpp, int numpix,
|
||||
unsigned char **dst);
|
||||
static void extract_yellowk (unsigned char *src, int bpp, int numpix,
|
||||
unsigned char **dst);
|
||||
|
||||
|
||||
static gint decompose_dialog (void);
|
||||
|
||||
static void decompose_ok_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
static void decompose_toggle_update (GtkWidget *widget,
|
||||
gpointer data);
|
||||
static gint decompose_dialog (void);
|
||||
static void decompose_ok_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
|
||||
/* Maximum number of new images generated by an extraction */
|
||||
#define MAX_EXTRACT_IMAGES 4
|
||||
|
||||
/* Description of an extraction */
|
||||
typedef struct {
|
||||
char *type; /* What to extract */
|
||||
int dialog; /* Dialog-Flag. Set it to 1 if you want to appear */
|
||||
/* this extract function within the dialog */
|
||||
int num_images; /* Number of images to create */
|
||||
char *channel_name[MAX_EXTRACT_IMAGES]; /* Names of channels to extract */
|
||||
/* Function that performs the extraction */
|
||||
void (*extract_fun)(unsigned char *src, int bpp, int numpix,
|
||||
unsigned char **dst);
|
||||
typedef struct
|
||||
{
|
||||
gchar *type; /* What to extract */
|
||||
gint dialog; /* Dialog-Flag. Set it to 1 if you want to appear */
|
||||
/* this extract function within the dialog */
|
||||
gint num_images; /* Number of images to create */
|
||||
gchar *channel_name[MAX_EXTRACT_IMAGES]; /* Names of channels to extract */
|
||||
/* Function that performs the extraction */
|
||||
void (*extract_fun) (guchar *src, int bpp, gint numpix,
|
||||
guchar **dst);
|
||||
} EXTRACT;
|
||||
|
||||
static EXTRACT extract[] = {
|
||||
{ N_("RGB"), 1, 3, { N_("red"), N_("green"), N_("blue") }, extract_rgb },
|
||||
{ N_("Red"), 0, 1, { N_("red") }, extract_red },
|
||||
{ N_("Green"), 0, 1, { N_("green") }, extract_green },
|
||||
{ N_("Blue"), 0, 1, { N_("blue") }, extract_blue },
|
||||
{ N_("HSV"), 1, 3, { N_("hue"), N_("saturation"), N_("value") },
|
||||
extract_hsv },
|
||||
{ N_("Hue"), 0, 1, { N_("hue") }, extract_hue },
|
||||
{ N_("Saturation"),0,1, { N_("saturation") }, extract_sat },
|
||||
{ N_("Value"), 0, 1, { N_("value") }, extract_val },
|
||||
{ N_("CMY"), 1, 3, { N_("cyan"), N_("magenta"), N_("yellow") },
|
||||
extract_cmy },
|
||||
{ N_("Cyan"), 0, 1, { N_("cyan") }, extract_cyan },
|
||||
{ N_("Magenta"), 0, 1, { N_("magenta") }, extract_magenta },
|
||||
{ N_("Yellow"), 0, 1, { N_("yellow") }, extract_yellow },
|
||||
{ N_("CMYK"), 1, 4, { N_("cyan_k"), N_("magenta_k"), N_("yellow_k"),
|
||||
N_("black") }, extract_cmyk },
|
||||
{ N_("Cyan_K"), 0, 1, { N_("cyan_k") }, extract_cyank },
|
||||
{ N_("Magenta_K"), 0,1, { N_("magenta_k") }, extract_magentak },
|
||||
{ N_("Yellow_K"), 0, 1, { N_("yellow_k") }, extract_yellowk },
|
||||
{ N_("Alpha"), 1, 1, { N_("alpha") }, extract_alpha }
|
||||
static EXTRACT extract[] =
|
||||
{
|
||||
{ N_("RGB"), TRUE, 3, { N_("red"),
|
||||
N_("green"),
|
||||
N_("blue") }, extract_rgb },
|
||||
{ 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_("saturation"),
|
||||
N_("value") }, extract_hsv },
|
||||
{ N_("Hue"), FALSE, 1, { N_("hue") }, extract_hue },
|
||||
{ N_("Saturation"), FALSE, 1, { N_("saturation") }, extract_sat },
|
||||
{ N_("Value"), FALSE, 1, { N_("value") }, extract_val },
|
||||
{ N_("CMY"), TRUE, 3, { N_("cyan"),
|
||||
N_("magenta"),
|
||||
N_("yellow") }, extract_cmy },
|
||||
{ N_("Cyan"), FALSE, 1, { N_("cyan") }, extract_cyan },
|
||||
{ N_("Magenta"), FALSE, 1, { N_("magenta") }, extract_magenta },
|
||||
{ N_("Yellow"), FALSE, 1, { N_("yellow") }, extract_yellow },
|
||||
{ N_("CMYK"), TRUE, 4, { N_("cyan_k"),
|
||||
N_("magenta_k"),
|
||||
N_("yellow_k"),
|
||||
N_("black") }, extract_cmyk },
|
||||
{ N_("Cyan_K"), FALSE, 1, { N_("cyan_k") }, extract_cyank },
|
||||
{ N_("Magenta_K"), FALSE, 1, { N_("magenta_k") }, extract_magentak },
|
||||
{ N_("Yellow_K"), FALSE, 1, { N_("yellow_k") }, extract_yellowk },
|
||||
{ N_("Alpha"), TRUE, 1, { N_("alpha") }, extract_alpha }
|
||||
};
|
||||
|
||||
/* Number of types of extractions */
|
||||
#define NUM_EXTRACT_TYPES (sizeof (extract)/sizeof (extract[0]))
|
||||
#define NUM_EXTRACT_TYPES (sizeof (extract) / sizeof (extract[0]))
|
||||
|
||||
|
||||
typedef struct {
|
||||
char extract_type[32];
|
||||
typedef struct
|
||||
{
|
||||
gchar extract_type[32];
|
||||
} DecoVals;
|
||||
|
||||
typedef struct {
|
||||
typedef struct
|
||||
{
|
||||
gint extract_flag[NUM_EXTRACT_TYPES];
|
||||
gint run;
|
||||
} DecoInterface;
|
||||
|
||||
GPlugInInfo PLUG_IN_INFO =
|
||||
{
|
||||
NULL, /* init_proc */
|
||||
NULL, /* quit_proc */
|
||||
query, /* query_proc */
|
||||
run, /* run_proc */
|
||||
NULL, /* init_proc */
|
||||
NULL, /* quit_proc */
|
||||
query, /* query_proc */
|
||||
run, /* run_proc */
|
||||
};
|
||||
|
||||
static DecoVals decovals =
|
||||
|
@ -193,22 +183,17 @@ query (void)
|
|||
{ PARAM_INT32, "run_mode", "Interactive, non-interactive" },
|
||||
{ PARAM_IMAGE, "image", "Input image (unused)" },
|
||||
{ PARAM_DRAWABLE, "drawable", "Input drawable" },
|
||||
{ PARAM_STRING, "decompose_type", "What to decompose: RGB, Red, Green,\
|
||||
Blue, HSV, Hue, Saturation, Value, CMY, Cyan, Magenta, Yellow, CMYK,\
|
||||
Cyan_K, Magenta_K, Yellow_K, Alpha" }
|
||||
{ PARAM_STRING, "decompose_type", "What to decompose: RGB, Red, Green, Blue, HSV, Hue, Saturation, Value, CMY, Cyan, Magenta, Yellow, CMYK, Cyan_K, Magenta_K, Yellow_K, Alpha" }
|
||||
};
|
||||
static GParamDef return_vals[] =
|
||||
{
|
||||
{ PARAM_IMAGE, "new_image", "Output gray image" },
|
||||
{ PARAM_IMAGE, "new_image",
|
||||
"Output gray image (N/A for single channel extract)" },
|
||||
{ PARAM_IMAGE, "new_image",
|
||||
"Output gray image (N/A for single channel extract)" },
|
||||
{ PARAM_IMAGE, "new_image",
|
||||
"Output gray image (N/A for single channel extract)" },
|
||||
{ PARAM_IMAGE, "new_image", "Output gray image (N/A for single channel extract)" },
|
||||
{ PARAM_IMAGE, "new_image", "Output gray image (N/A for single channel extract)" },
|
||||
{ PARAM_IMAGE, "new_image", "Output gray image (N/A for single channel extract)" },
|
||||
};
|
||||
static int nargs = sizeof (args) / sizeof (args[0]);
|
||||
static int nreturn_vals = sizeof (return_vals) / sizeof (return_vals[0]);
|
||||
static gint nargs = sizeof (args) / sizeof (args[0]);
|
||||
static gint nreturn_vals = sizeof (return_vals) / sizeof (return_vals[0]);
|
||||
|
||||
INIT_I18N ();
|
||||
|
||||
|
@ -227,20 +212,10 @@ query (void)
|
|||
}
|
||||
|
||||
static void
|
||||
show_message (const char *message)
|
||||
{
|
||||
if (run_mode == RUN_INTERACTIVE)
|
||||
gimp_message (message);
|
||||
else
|
||||
g_print ("%s\n", message);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
run (char *name,
|
||||
int nparams,
|
||||
run (gchar *name,
|
||||
gint nparams,
|
||||
GParam *param,
|
||||
int *nreturn_vals,
|
||||
gint *nreturn_vals,
|
||||
GParam **return_vals)
|
||||
{
|
||||
static GParam values[MAX_EXTRACT_IMAGES+1];
|
||||
|
@ -279,8 +254,10 @@ run (char *name,
|
|||
case RUN_NONINTERACTIVE:
|
||||
/* Make sure all the arguments are there! */
|
||||
if (nparams != 4)
|
||||
status = STATUS_CALLING_ERROR;
|
||||
if (status == STATUS_SUCCESS)
|
||||
{
|
||||
status = STATUS_CALLING_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
strncpy (decovals.extract_type, param[3].data.d_string,
|
||||
sizeof (decovals.extract_type));
|
||||
|
@ -301,7 +278,7 @@ run (char *name,
|
|||
drawable_type = gimp_drawable_type (param[2].data.d_drawable);
|
||||
if ((drawable_type != RGB_IMAGE) && (drawable_type != RGBA_IMAGE))
|
||||
{
|
||||
show_message ("plug_in_decompose: Can only work on RGB*_IMAGE");
|
||||
g_message ("decompose: Can only work on RGB*_IMAGE");
|
||||
status = STATUS_CALLING_ERROR;
|
||||
}
|
||||
if (status == STATUS_SUCCESS)
|
||||
|
@ -347,11 +324,11 @@ decompose (gint32 image_ID,
|
|||
char *extract_type,
|
||||
gint32 *image_ID_dst)
|
||||
{
|
||||
int i, j, extract_idx, scan_lines;
|
||||
int height, width, tile_height, num_images;
|
||||
unsigned char *src = (unsigned char *)ident; /* Just to satisfy gcc/lint */
|
||||
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];
|
||||
unsigned char *dst[MAX_EXTRACT_IMAGES];
|
||||
guchar *dst[MAX_EXTRACT_IMAGES];
|
||||
gint32 layer_ID_dst[MAX_EXTRACT_IMAGES];
|
||||
GDrawable *drawable_src, *drawable_dst[MAX_EXTRACT_IMAGES];
|
||||
GPixelRgn pixel_rgn_src, pixel_rgn_dst[MAX_EXTRACT_IMAGES];
|
||||
|
@ -359,7 +336,7 @@ decompose (gint32 image_ID,
|
|||
extract_idx = -1; /* Search extract type */
|
||||
for (j = 0; j < NUM_EXTRACT_TYPES; j++)
|
||||
{
|
||||
if (cmp_icase (extract_type, extract[j].type) == 0)
|
||||
if (g_strcasecmp (extract_type, extract[j].type) == 0)
|
||||
{
|
||||
extract_idx = j;
|
||||
break;
|
||||
|
@ -371,13 +348,13 @@ decompose (gint32 image_ID,
|
|||
drawable_src = gimp_drawable_get (drawable_ID);
|
||||
if (drawable_src->bpp < 3)
|
||||
{
|
||||
show_message ("decompose: not an RGB image");
|
||||
g_message ("decompose: not an RGB image");
|
||||
return (-1);
|
||||
}
|
||||
if ((extract[extract_idx].extract_fun == extract_alpha) &&
|
||||
(!gimp_drawable_has_alpha (drawable_ID)))
|
||||
{
|
||||
show_message ("decompose: No alpha channel available");
|
||||
g_message ("decompose: No alpha channel available");
|
||||
return (-1);
|
||||
}
|
||||
|
||||
|
@ -389,7 +366,7 @@ decompose (gint32 image_ID,
|
|||
FALSE, FALSE);
|
||||
|
||||
/* allocate a buffer for retrieving information from the src pixel region */
|
||||
src = (unsigned char *)g_malloc (tile_height * width * drawable_src->bpp);
|
||||
src = g_new (guchar, tile_height * width * drawable_src->bpp);
|
||||
|
||||
/* Create all new gray images */
|
||||
num_images = extract[extract_idx].num_images;
|
||||
|
@ -402,8 +379,9 @@ decompose (gint32 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);
|
||||
dst[j] = (unsigned char *)g_malloc (tile_height * width);
|
||||
layer_ID_dst+j, drawable_dst+j,
|
||||
pixel_rgn_dst+j);
|
||||
dst[j] = g_new (guchar, tile_height * width);
|
||||
}
|
||||
|
||||
i = 0;
|
||||
|
@ -424,7 +402,7 @@ decompose (gint32 image_ID,
|
|||
i += scan_lines;
|
||||
|
||||
if (run_mode != RUN_NONINTERACTIVE)
|
||||
gimp_progress_update (((double)i) / (double)height);
|
||||
gimp_progress_update (((gdouble)i) / (gdouble)height);
|
||||
}
|
||||
g_free (src);
|
||||
for (j = 0; j < num_images; j++)
|
||||
|
@ -443,7 +421,7 @@ decompose (gint32 image_ID,
|
|||
|
||||
/* Create an image. Sets layer_ID, drawable and rgn. Returns image_ID */
|
||||
static gint32
|
||||
create_new_image (char *filename,
|
||||
create_new_image (gchar *filename,
|
||||
guint width,
|
||||
guint height,
|
||||
GImageType type,
|
||||
|
@ -476,38 +454,19 @@ create_new_image (char *filename,
|
|||
}
|
||||
|
||||
|
||||
/* Compare two strings ignoring case (could also be done by strcasecmp() */
|
||||
/* but is it available everywhere ?) */
|
||||
static int
|
||||
cmp_icase (char *s1,
|
||||
char *s2)
|
||||
{
|
||||
int c1, c2;
|
||||
|
||||
c1 = toupper (*s1); c2 = toupper (*s2);
|
||||
while (*s1 && *s2)
|
||||
{
|
||||
if (c1 != c2)
|
||||
return (c2 - c1);
|
||||
c1 = toupper (*(++s1)); c2 = toupper (*(++s2));
|
||||
}
|
||||
return (c2 - c1);
|
||||
}
|
||||
|
||||
|
||||
/* Extract functions */
|
||||
|
||||
static void
|
||||
extract_rgb (unsigned char *src,
|
||||
int bpp,
|
||||
int numpix,
|
||||
unsigned char **dst)
|
||||
extract_rgb (guchar *src,
|
||||
gint bpp,
|
||||
gint numpix,
|
||||
guchar **dst)
|
||||
{
|
||||
register unsigned char *rgb_src = src;
|
||||
register unsigned char *red_dst = dst[0];
|
||||
register unsigned char *green_dst = dst[1];
|
||||
register unsigned char *blue_dst = dst[2];
|
||||
register int count = numpix, offset = bpp-3;
|
||||
register guchar *rgb_src = src;
|
||||
register guchar *red_dst = dst[0];
|
||||
register guchar *green_dst = dst[1];
|
||||
register guchar *blue_dst = dst[2];
|
||||
register gint count = numpix, offset = bpp-3;
|
||||
|
||||
while (count-- > 0)
|
||||
{
|
||||
|
@ -520,14 +479,14 @@ extract_rgb (unsigned char *src,
|
|||
|
||||
|
||||
static void
|
||||
extract_red (unsigned char *src,
|
||||
int bpp,
|
||||
int numpix,
|
||||
unsigned char **dst)
|
||||
extract_red (guchar *src,
|
||||
gint bpp,
|
||||
gint numpix,
|
||||
guchar **dst)
|
||||
{
|
||||
register unsigned char *rgb_src = src;
|
||||
register unsigned char *red_dst = dst[0];
|
||||
register int count = numpix, offset = bpp;
|
||||
register guchar *rgb_src = src;
|
||||
register guchar *red_dst = dst[0];
|
||||
register gint count = numpix, offset = bpp;
|
||||
|
||||
while (count-- > 0)
|
||||
{
|
||||
|
@ -538,14 +497,14 @@ extract_red (unsigned char *src,
|
|||
|
||||
|
||||
static void
|
||||
extract_green (unsigned char *src,
|
||||
int bpp,
|
||||
int numpix,
|
||||
unsigned char **dst)
|
||||
extract_green (guchar *src,
|
||||
gint bpp,
|
||||
gint numpix,
|
||||
guchar **dst)
|
||||
{
|
||||
register unsigned char *rgb_src = src+1;
|
||||
register unsigned char *green_dst = dst[0];
|
||||
register int count = numpix, offset = bpp;
|
||||
register guchar *rgb_src = src+1;
|
||||
register guchar *green_dst = dst[0];
|
||||
register gint count = numpix, offset = bpp;
|
||||
|
||||
while (count-- > 0)
|
||||
{
|
||||
|
@ -556,14 +515,14 @@ extract_green (unsigned char *src,
|
|||
|
||||
|
||||
static void
|
||||
extract_blue (unsigned char *src,
|
||||
int bpp,
|
||||
int numpix,
|
||||
unsigned char **dst)
|
||||
extract_blue (guchar *src,
|
||||
gint bpp,
|
||||
gint numpix,
|
||||
guchar **dst)
|
||||
{
|
||||
register unsigned char *rgb_src = src+2;
|
||||
register unsigned char *blue_dst = dst[0];
|
||||
register int count = numpix, offset = bpp;
|
||||
register guchar *rgb_src = src+2;
|
||||
register guchar *blue_dst = dst[0];
|
||||
register gint count = numpix, offset = bpp;
|
||||
|
||||
while (count-- > 0)
|
||||
{
|
||||
|
@ -574,14 +533,14 @@ extract_blue (unsigned char *src,
|
|||
|
||||
|
||||
static void
|
||||
extract_alpha (unsigned char *src,
|
||||
int bpp,
|
||||
int numpix,
|
||||
unsigned char **dst)
|
||||
extract_alpha (guchar *src,
|
||||
gint bpp,
|
||||
gint numpix,
|
||||
guchar **dst)
|
||||
{
|
||||
register unsigned char *rgb_src = src+3;
|
||||
register unsigned char *alpha_dst = dst[0];
|
||||
register int count = numpix, offset = bpp;
|
||||
register guchar *rgb_src = src+3;
|
||||
register guchar *alpha_dst = dst[0];
|
||||
register gint count = numpix, offset = bpp;
|
||||
|
||||
while (count-- > 0)
|
||||
{
|
||||
|
@ -592,16 +551,16 @@ extract_alpha (unsigned char *src,
|
|||
|
||||
|
||||
static void
|
||||
extract_cmy (unsigned char *src,
|
||||
int bpp,
|
||||
int numpix,
|
||||
unsigned char **dst)
|
||||
extract_cmy (guchar *src,
|
||||
gint bpp,
|
||||
gint numpix,
|
||||
guchar **dst)
|
||||
{
|
||||
register unsigned char *rgb_src = src;
|
||||
register unsigned char *cyan_dst = dst[0];
|
||||
register unsigned char *magenta_dst = dst[1];
|
||||
register unsigned char *yellow_dst = dst[2];
|
||||
register int count = numpix, offset = bpp-3;
|
||||
register guchar *rgb_src = src;
|
||||
register guchar *cyan_dst = dst[0];
|
||||
register guchar *magenta_dst = dst[1];
|
||||
register guchar *yellow_dst = dst[2];
|
||||
register gint count = numpix, offset = bpp-3;
|
||||
|
||||
while (count-- > 0)
|
||||
{
|
||||
|
@ -614,98 +573,98 @@ extract_cmy (unsigned char *src,
|
|||
|
||||
|
||||
static void
|
||||
extract_hsv (unsigned char *src,
|
||||
int bpp,
|
||||
int numpix,
|
||||
unsigned char **dst)
|
||||
extract_hsv (guchar *src,
|
||||
gint bpp,
|
||||
gint numpix,
|
||||
guchar **dst)
|
||||
{
|
||||
register unsigned char *rgb_src = src;
|
||||
register unsigned char *hue_dst = dst[0];
|
||||
register unsigned char *sat_dst = dst[1];
|
||||
register unsigned char *val_dst = dst[2];
|
||||
register int count = numpix, offset = bpp;
|
||||
double hue, sat, val;
|
||||
register guchar *rgb_src = src;
|
||||
register guchar *hue_dst = dst[0];
|
||||
register guchar *sat_dst = dst[1];
|
||||
register guchar *val_dst = dst[2];
|
||||
register gint count = numpix, offset = bpp;
|
||||
gdouble hue, sat, val;
|
||||
|
||||
while (count-- > 0)
|
||||
{
|
||||
gimp_rgb_to_hsv4 (rgb_src, &hue, &sat, &val);
|
||||
*hue_dst++ = (unsigned char) (hue * 255.999);
|
||||
*sat_dst++ = (unsigned char) (sat * 255.999);
|
||||
*val_dst++ = (unsigned char) (val * 255.999);
|
||||
*hue_dst++ = (guchar) (hue * 255.999);
|
||||
*sat_dst++ = (guchar) (sat * 255.999);
|
||||
*val_dst++ = (guchar) (val * 255.999);
|
||||
rgb_src += offset;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
extract_hue (unsigned char *src,
|
||||
int bpp,
|
||||
int numpix,
|
||||
unsigned char **dst)
|
||||
extract_hue (guchar *src,
|
||||
gint bpp,
|
||||
gint numpix,
|
||||
guchar **dst)
|
||||
{
|
||||
register unsigned char *rgb_src = src;
|
||||
register unsigned char *hue_dst = dst[0];
|
||||
register int count = numpix, offset = bpp;
|
||||
double hue, dummy;
|
||||
register guchar *rgb_src = src;
|
||||
register guchar *hue_dst = dst[0];
|
||||
register gint count = numpix, offset = bpp;
|
||||
gdouble hue, dummy;
|
||||
|
||||
while (count-- > 0)
|
||||
{
|
||||
gimp_rgb_to_hsv4 (rgb_src, &hue, &dummy, &dummy);
|
||||
*hue_dst++ = (unsigned char) (hue * 255.999);
|
||||
*hue_dst++ = (guchar) (hue * 255.999);
|
||||
rgb_src += offset;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
extract_sat (unsigned char *src,
|
||||
int bpp,
|
||||
int numpix,
|
||||
unsigned char **dst)
|
||||
extract_sat (guchar *src,
|
||||
gint bpp,
|
||||
gint numpix,
|
||||
guchar **dst)
|
||||
{
|
||||
register unsigned char *rgb_src = src;
|
||||
register unsigned char *sat_dst = dst[0];
|
||||
register int count = numpix, offset = bpp;
|
||||
double sat, dummy;
|
||||
register guchar *rgb_src = src;
|
||||
register guchar *sat_dst = dst[0];
|
||||
register gint count = numpix, offset = bpp;
|
||||
gdouble sat, dummy;
|
||||
|
||||
while (count-- > 0)
|
||||
{
|
||||
gimp_rgb_to_hsv4 (rgb_src, &dummy, &sat, &dummy);
|
||||
*sat_dst++ = (unsigned char) (sat * 255.999);
|
||||
*sat_dst++ = (guchar) (sat * 255.999);
|
||||
rgb_src += offset;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
extract_val (unsigned char *src,
|
||||
int bpp,
|
||||
int numpix,
|
||||
unsigned char **dst)
|
||||
extract_val (guchar *src,
|
||||
gint bpp,
|
||||
gint numpix,
|
||||
guchar **dst)
|
||||
{
|
||||
register unsigned char *rgb_src = src;
|
||||
register unsigned char *val_dst = dst[0];
|
||||
register int count = numpix, offset = bpp;
|
||||
double val, dummy;
|
||||
register guchar *rgb_src = src;
|
||||
register guchar *val_dst = dst[0];
|
||||
register gint count = numpix, offset = bpp;
|
||||
gdouble val, dummy;
|
||||
|
||||
while (count-- > 0)
|
||||
{
|
||||
gimp_rgb_to_hsv4 (rgb_src, &dummy, &dummy, &val);
|
||||
*val_dst++ = (unsigned char) (val * 255.999);
|
||||
*val_dst++ = (guchar) (val * 255.999);
|
||||
rgb_src += offset;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
extract_cyan (unsigned char *src,
|
||||
int bpp,
|
||||
int numpix,
|
||||
unsigned char **dst)
|
||||
extract_cyan (guchar *src,
|
||||
gint bpp,
|
||||
gint numpix,
|
||||
guchar **dst)
|
||||
{
|
||||
register unsigned char *rgb_src = src;
|
||||
register unsigned char *cyan_dst = dst[0];
|
||||
register int count = numpix, offset = bpp-1;
|
||||
register guchar *rgb_src = src;
|
||||
register guchar *cyan_dst = dst[0];
|
||||
register gint count = numpix, offset = bpp-1;
|
||||
|
||||
while (count-- > 0)
|
||||
{
|
||||
|
@ -716,14 +675,14 @@ extract_cyan (unsigned char *src,
|
|||
|
||||
|
||||
static void
|
||||
extract_magenta (unsigned char *src,
|
||||
int bpp,
|
||||
int numpix,
|
||||
unsigned char **dst)
|
||||
extract_magenta (guchar *src,
|
||||
gint bpp,
|
||||
gint numpix,
|
||||
guchar **dst)
|
||||
{
|
||||
register unsigned char *rgb_src = src+1;
|
||||
register unsigned char *magenta_dst = dst[0];
|
||||
register int count = numpix, offset = bpp-1;
|
||||
register guchar *rgb_src = src+1;
|
||||
register guchar *magenta_dst = dst[0];
|
||||
register gint count = numpix, offset = bpp-1;
|
||||
|
||||
while (count-- > 0)
|
||||
{
|
||||
|
@ -734,14 +693,14 @@ extract_magenta (unsigned char *src,
|
|||
|
||||
|
||||
static void
|
||||
extract_yellow (unsigned char *src,
|
||||
int bpp,
|
||||
int numpix,
|
||||
unsigned char **dst)
|
||||
extract_yellow (guchar *src,
|
||||
gint bpp,
|
||||
gint numpix,
|
||||
guchar **dst)
|
||||
{
|
||||
register unsigned char *rgb_src = src+2;
|
||||
register unsigned char *yellow_dst = dst[0];
|
||||
register int count = numpix, offset = bpp-1;
|
||||
register guchar *rgb_src = src+2;
|
||||
register guchar *yellow_dst = dst[0];
|
||||
register gint count = numpix, offset = bpp-1;
|
||||
|
||||
while (count-- > 0)
|
||||
{
|
||||
|
@ -752,19 +711,19 @@ extract_yellow (unsigned char *src,
|
|||
|
||||
|
||||
static void
|
||||
extract_cmyk (unsigned char *src,
|
||||
int bpp,
|
||||
int numpix,
|
||||
unsigned char **dst)
|
||||
extract_cmyk (guchar *src,
|
||||
gint bpp,
|
||||
gint numpix,
|
||||
guchar **dst)
|
||||
|
||||
{
|
||||
register unsigned char *rgb_src = src;
|
||||
register unsigned char *cyan_dst = dst[0];
|
||||
register unsigned char *magenta_dst = dst[1];
|
||||
register unsigned char *yellow_dst = dst[2];
|
||||
register unsigned char *black_dst = dst[3];
|
||||
register unsigned char k, s;
|
||||
register int count = numpix, offset = bpp-3;
|
||||
register guchar *rgb_src = src;
|
||||
register guchar *cyan_dst = dst[0];
|
||||
register guchar *magenta_dst = dst[1];
|
||||
register guchar *yellow_dst = dst[2];
|
||||
register guchar *black_dst = dst[3];
|
||||
register guchar k, s;
|
||||
register gint count = numpix, offset = bpp-3;
|
||||
|
||||
while (count-- > 0)
|
||||
{
|
||||
|
@ -792,15 +751,15 @@ extract_cmyk (unsigned char *src,
|
|||
|
||||
|
||||
static void
|
||||
extract_cyank (unsigned char *src,
|
||||
int bpp,
|
||||
int numpix,
|
||||
unsigned char **dst)
|
||||
extract_cyank (guchar *src,
|
||||
gint bpp,
|
||||
gint numpix,
|
||||
guchar **dst)
|
||||
{
|
||||
register unsigned char *rgb_src = src;
|
||||
register unsigned char *cyan_dst = dst[0];
|
||||
register unsigned char s, k;
|
||||
register int count = numpix, offset = bpp-3;
|
||||
register guchar *rgb_src = src;
|
||||
register guchar *cyan_dst = dst[0];
|
||||
register guchar s, k;
|
||||
register gint count = numpix, offset = bpp-3;
|
||||
|
||||
while (count-- > 0)
|
||||
{
|
||||
|
@ -818,15 +777,15 @@ extract_cyank (unsigned char *src,
|
|||
|
||||
|
||||
static void
|
||||
extract_magentak (unsigned char *src,
|
||||
int bpp,
|
||||
int numpix,
|
||||
unsigned char **dst)
|
||||
extract_magentak (guchar *src,
|
||||
gint bpp,
|
||||
gint numpix,
|
||||
guchar **dst)
|
||||
{
|
||||
register unsigned char *rgb_src = src;
|
||||
register unsigned char *magenta_dst = dst[0];
|
||||
register unsigned char s, k;
|
||||
register int count = numpix, offset = bpp-3;
|
||||
register guchar *rgb_src = src;
|
||||
register guchar *magenta_dst = dst[0];
|
||||
register guchar s, k;
|
||||
register gint count = numpix, offset = bpp-3;
|
||||
|
||||
while (count-- > 0)
|
||||
{
|
||||
|
@ -847,16 +806,16 @@ extract_magentak (unsigned char *src,
|
|||
|
||||
|
||||
static void
|
||||
extract_yellowk (unsigned char *src,
|
||||
int bpp,
|
||||
int numpix,
|
||||
unsigned char **dst)
|
||||
extract_yellowk (guchar *src,
|
||||
gint bpp,
|
||||
gint numpix,
|
||||
guchar **dst)
|
||||
|
||||
{
|
||||
register unsigned char *rgb_src = src;
|
||||
register unsigned char *yellow_dst = dst[0];
|
||||
register unsigned char s, k;
|
||||
register int count = numpix, offset = bpp-3;
|
||||
register guchar *rgb_src = src;
|
||||
register guchar *yellow_dst = dst[0];
|
||||
register guchar s, k;
|
||||
register gint count = numpix, offset = bpp-3;
|
||||
|
||||
while (count-- > 0)
|
||||
{
|
||||
|
@ -884,12 +843,12 @@ decompose_dialog (void)
|
|||
GtkWidget *vbox;
|
||||
GSList *group;
|
||||
gchar **argv;
|
||||
gint argc;
|
||||
int j;
|
||||
gint argc;
|
||||
gint j;
|
||||
|
||||
argc = 1;
|
||||
argv = g_new (gchar *, 1);
|
||||
argv[0] = g_strdup (_("Decompose"));
|
||||
argc = 1;
|
||||
argv = g_new (gchar *, 1);
|
||||
argv[0] = g_strdup ("decompose");
|
||||
|
||||
gtk_init (&argc, &argv);
|
||||
gtk_rc_parse (gimp_gtkrc ());
|
||||
|
@ -916,8 +875,8 @@ decompose_dialog (void)
|
|||
gtk_container_set_border_width (GTK_CONTAINER (frame), 6);
|
||||
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox), frame, TRUE, TRUE, 0);
|
||||
|
||||
vbox = gtk_vbox_new (FALSE, 2);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (vbox), 4);
|
||||
vbox = gtk_vbox_new (FALSE, 1);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (vbox), 2);
|
||||
gtk_container_add (GTK_CONTAINER (frame), vbox);
|
||||
|
||||
group = NULL;
|
||||
|
@ -928,9 +887,9 @@ decompose_dialog (void)
|
|||
group = gtk_radio_button_group (GTK_RADIO_BUTTON (toggle));
|
||||
gtk_box_pack_start (GTK_BOX (vbox), toggle, TRUE, TRUE, 0);
|
||||
decoint.extract_flag[j] =
|
||||
(cmp_icase (decovals.extract_type, extract[j].type) == 0);
|
||||
(g_strcasecmp (decovals.extract_type, extract[j].type) == 0);
|
||||
gtk_signal_connect (GTK_OBJECT (toggle), "toggled",
|
||||
GTK_SIGNAL_FUNC (decompose_toggle_update),
|
||||
GTK_SIGNAL_FUNC (gimp_toggle_button_update),
|
||||
&(decoint.extract_flag[j]));
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle),
|
||||
decoint.extract_flag[j]);
|
||||
|
@ -950,7 +909,7 @@ static void
|
|||
decompose_ok_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
int j;
|
||||
gint j;
|
||||
|
||||
decoint.run = TRUE;
|
||||
gtk_widget_destroy (GTK_WIDGET (data));
|
||||
|
@ -964,17 +923,3 @@ decompose_ok_callback (GtkWidget *widget,
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
decompose_toggle_update (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
gint *toggle_val;
|
||||
|
||||
toggle_val = (int *) data;
|
||||
|
||||
if (GTK_TOGGLE_BUTTON (widget)->active)
|
||||
*toggle_val = TRUE;
|
||||
else
|
||||
*toggle_val = FALSE;
|
||||
}
|
||||
|
|
|
@ -784,6 +784,7 @@ DepthMerge_dialog (DepthMerge *dm)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (numericParameterTable), 0, 0,
|
||||
_("Overlap:"), 0, 0,
|
||||
dm->params.overlap, 0, 2, 0.001, 0.01, 3,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (dialogValueScaleUpdateCallback),
|
||||
|
@ -793,6 +794,7 @@ DepthMerge_dialog (DepthMerge *dm)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (numericParameterTable), 0, 1,
|
||||
_("Offset:"), 0, 0,
|
||||
dm->params.offset, -1, 1, 0.001, 0.01, 3,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (dialogValueScaleUpdateCallback),
|
||||
|
@ -802,6 +804,7 @@ DepthMerge_dialog (DepthMerge *dm)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (numericParameterTable), 0, 2,
|
||||
_("Scale 1:"), 0, 0,
|
||||
dm->params.scale1, -1, 1, 0.001, 0.01, 3,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (dialogValueScaleUpdateCallback),
|
||||
|
@ -811,6 +814,7 @@ DepthMerge_dialog (DepthMerge *dm)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (numericParameterTable), 0, 3,
|
||||
_("Scale 2:"), 0, 0,
|
||||
dm->params.scale2, -1, 1, 0.001, 0.01, 3,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (dialogValueScaleUpdateCallback),
|
||||
|
|
|
@ -746,10 +746,15 @@ despeckle_dialog (void)
|
|||
NULL);
|
||||
gtk_widget_show (button);
|
||||
|
||||
frame = gtk_frame_new (_("Parameter Settings"));
|
||||
gtk_box_pack_start (GTK_BOX (main_vbox), frame, FALSE, FALSE, 0);
|
||||
gtk_widget_show (frame);
|
||||
|
||||
table = gtk_table_new (3, 3, FALSE);
|
||||
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
|
||||
gtk_table_set_row_spacings (GTK_TABLE (table), 2);
|
||||
gtk_box_pack_start (GTK_BOX (main_vbox), table, FALSE, FALSE, 0);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (table), 4);
|
||||
gtk_container_add (GTK_CONTAINER (frame), table);
|
||||
gtk_widget_show (table);
|
||||
|
||||
/*
|
||||
|
@ -759,6 +764,7 @@ despeckle_dialog (void)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
|
||||
_("Radius:"), 100, 0,
|
||||
despeckle_radius, 1, MAX_RADIUS, 1, 5, 0,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (dialog_iscale_update),
|
||||
|
@ -771,6 +777,7 @@ despeckle_dialog (void)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
|
||||
_("Black Level:"), 100, 0,
|
||||
black_level, 0, 256, 1, 8, 0,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (dialog_iscale_update),
|
||||
|
@ -783,6 +790,7 @@ despeckle_dialog (void)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 2,
|
||||
_("White Level:"), 100, 0,
|
||||
white_level, 0, 256, 1, 8, 0,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (dialog_iscale_update),
|
||||
|
|
|
@ -241,8 +241,8 @@ run (gchar *name,
|
|||
/*
|
||||
* Set the tile cache size...
|
||||
*/
|
||||
gimp_tile_cache_ntiles ((drawable->width + gimp_tile_width() - 1) /
|
||||
gimp_tile_width());
|
||||
gimp_tile_cache_ntiles ((drawable->width + gimp_tile_width () - 1) /
|
||||
gimp_tile_width ());
|
||||
|
||||
/*
|
||||
* Run!
|
||||
|
@ -532,9 +532,10 @@ static gint
|
|||
destripe_dialog (void)
|
||||
{
|
||||
GtkWidget *dialog;
|
||||
GtkWidget *vbox;
|
||||
GtkWidget *abox;
|
||||
GtkWidget *table;
|
||||
GtkWidget *ptable;
|
||||
GtkWidget *ftable;
|
||||
GtkWidget *frame;
|
||||
GtkWidget *scrollbar;
|
||||
GtkWidget *button;
|
||||
|
@ -585,21 +586,27 @@ destripe_dialog (void)
|
|||
* Top-level table for dialog...
|
||||
*/
|
||||
|
||||
table = gtk_table_new (3, 3, FALSE);
|
||||
gtk_table_set_row_spacings (GTK_TABLE (table), 4);
|
||||
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (table), 6);
|
||||
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), table,
|
||||
vbox = gtk_vbox_new (FALSE, 4);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (vbox), 6);
|
||||
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), vbox,
|
||||
FALSE, FALSE, 0);
|
||||
gtk_widget_show (table);
|
||||
gtk_widget_show (vbox);
|
||||
|
||||
/*
|
||||
* Preview window...
|
||||
*/
|
||||
|
||||
frame = gtk_frame_new (_("Preview"));
|
||||
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
|
||||
gtk_widget_show (frame);
|
||||
|
||||
abox = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (abox), 4);
|
||||
gtk_container_add (GTK_CONTAINER (frame), abox);
|
||||
gtk_widget_show (abox);
|
||||
|
||||
ptable = gtk_table_new (2, 2, FALSE);
|
||||
gtk_table_attach (GTK_TABLE (table), ptable, 0, 2, 0, 1,
|
||||
0, 0, 0, 0);
|
||||
gtk_container_add (GTK_CONTAINER (abox), ptable);
|
||||
gtk_widget_show (ptable);
|
||||
|
||||
frame = gtk_frame_new (NULL);
|
||||
|
@ -650,14 +657,19 @@ destripe_dialog (void)
|
|||
* Filter type controls...
|
||||
*/
|
||||
|
||||
ftable = gtk_table_new (4, 1, FALSE);
|
||||
gtk_table_attach (GTK_TABLE (table), ftable, 2, 3, 0, 1,
|
||||
0, 0, 0, 0);
|
||||
gtk_widget_show (ftable);
|
||||
frame = gtk_frame_new (_("Parameter Settings"));
|
||||
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
|
||||
gtk_widget_show (frame);
|
||||
|
||||
button = gtk_check_button_new_with_label (_("Histogram"));
|
||||
gtk_table_attach (GTK_TABLE (ftable), button, 0, 1, 0, 1,
|
||||
GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
|
||||
table = gtk_table_new (2, 3, FALSE);
|
||||
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
|
||||
gtk_table_set_row_spacings (GTK_TABLE (table), 4);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (table), 4);
|
||||
gtk_container_add (GTK_CONTAINER (frame), table);
|
||||
gtk_widget_show (table);
|
||||
|
||||
button = gtk_check_button_new_with_label (_("Create Histogram"));
|
||||
gtk_table_attach_defaults (GTK_TABLE (table), button, 0, 3, 0, 1);
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
|
||||
histogram ? TRUE : FALSE);
|
||||
gtk_signal_connect (GTK_OBJECT (button), "toggled",
|
||||
|
@ -666,22 +678,22 @@ destripe_dialog (void)
|
|||
gtk_widget_show (button);
|
||||
|
||||
/* button = gtk_check_button_new_with_label("Recursive");
|
||||
gtk_table_attach(GTK_TABLE(ftable), button, 0, 1, 1, 2,
|
||||
GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
|
||||
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button),
|
||||
(filter_type & FILTER_RECURSIVE) ? TRUE : FALSE);
|
||||
gtk_signal_connect(GTK_OBJECT(button), "toggled",
|
||||
(GtkSignalFunc)dialog_recursive_callback,
|
||||
NULL);
|
||||
gtk_widget_show(button);*/
|
||||
gtk_table_attach_defaults (GTK_TABLE (table), button, 0, 1, 1, 2);
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
|
||||
(filter_type & FILTER_RECURSIVE) ? TRUE : FALSE);
|
||||
gtk_signal_connect (GTK_OBJECT (button), "toggled",
|
||||
GTK_SIGNAL_FUNC (dialog_recursive_callback),
|
||||
NULL);
|
||||
gtk_widget_show (button);*/
|
||||
|
||||
/*
|
||||
* Box size (radius) control...
|
||||
*/
|
||||
|
||||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 2,
|
||||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
|
||||
_("Width:"), SCALE_WIDTH, 0,
|
||||
avg_width, 2, MAX_AVG, 1, 10, 0,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (dialog_iscale_update),
|
||||
|
|
|
@ -630,6 +630,7 @@ diffraction_dialog (void)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
|
||||
_("Red:"), SCALE_WIDTH, 0,
|
||||
dvals.lam_r, 0.0, 20.0, 0.2, 1.0, 3,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
|
||||
|
@ -638,6 +639,7 @@ diffraction_dialog (void)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
|
||||
_("Green:"), SCALE_WIDTH, 0,
|
||||
dvals.lam_g, 0.0, 20.0, 0.2, 1.0, 3,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
|
||||
|
@ -646,6 +648,7 @@ diffraction_dialog (void)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 2,
|
||||
_("Blue:"), SCALE_WIDTH, 0,
|
||||
dvals.lam_b, 0.0, 20.0, 0.2, 1.0, 3,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
|
||||
|
@ -666,6 +669,7 @@ diffraction_dialog (void)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
|
||||
_("Red:"), SCALE_WIDTH, 0,
|
||||
dvals.contour_r, 0.0, 10.0, 0.1, 1.0, 3,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
|
||||
|
@ -674,6 +678,7 @@ diffraction_dialog (void)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
|
||||
_("Green:"), SCALE_WIDTH, 0,
|
||||
dvals.contour_g, 0.0, 10.0, 0.1, 1.0, 3,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
|
||||
|
@ -682,6 +687,7 @@ diffraction_dialog (void)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 2,
|
||||
_("Blue:"), SCALE_WIDTH, 0,
|
||||
dvals.contour_b, 0.0, 10.0, 0.1, 1.0, 3,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
|
||||
|
@ -702,6 +708,7 @@ diffraction_dialog (void)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
|
||||
_("Red:"), SCALE_WIDTH, 0,
|
||||
dvals.edges_r, 0.0, 1.0, 0.01, 0.1, 3,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
|
||||
|
@ -710,6 +717,7 @@ diffraction_dialog (void)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
|
||||
_("Green:"), SCALE_WIDTH, 0,
|
||||
dvals.edges_g, 0.0, 1.0, 0.01, 0.1, 3,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
|
||||
|
@ -718,6 +726,7 @@ diffraction_dialog (void)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 2,
|
||||
_("Blue:"), SCALE_WIDTH, 0,
|
||||
dvals.edges_b, 0.0, 1.0, 0.01, 0.1, 3,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
|
||||
|
@ -738,6 +747,7 @@ diffraction_dialog (void)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
|
||||
_("Brightness:"), SCALE_WIDTH, 0,
|
||||
dvals.brightness, 0.0, 1.0, 0.01, 0.1, 3,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
|
||||
|
@ -746,6 +756,7 @@ diffraction_dialog (void)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
|
||||
_("Scattering:"), SCALE_WIDTH, 0,
|
||||
dvals.scattering, 0.0, 100.0, 1.0, 10.0, 3,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
|
||||
|
@ -754,6 +765,7 @@ diffraction_dialog (void)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 2,
|
||||
_("Polatization:"), SCALE_WIDTH, 0,
|
||||
dvals.polarization, -1.0, 1.0, 0.02, 0.2, 3,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
|
||||
|
|
|
@ -681,6 +681,7 @@ edge_dialog (GDrawable *drawable)
|
|||
scale_data = gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
|
||||
_("Amount:"), 100, 0,
|
||||
evals.amount, 1.0, 10.0, 0.1, 1.0, 1,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (scale_data), "value_changed",
|
||||
|
|
|
@ -569,7 +569,7 @@ pluginCoreIA (struct piArgs *argp)
|
|||
gtk_box_pack_start (GTK_BOX (hbox), frame, TRUE, TRUE, 0);
|
||||
gtk_widget_show (frame);
|
||||
|
||||
frame = gtk_frame_new (_("Parameters"));
|
||||
frame = gtk_frame_new (_("Parameter Settings"));
|
||||
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_ETCHED_IN);
|
||||
gtk_box_pack_start (GTK_BOX (main_vbox), frame, FALSE, FALSE, 0);
|
||||
gtk_widget_show (frame);
|
||||
|
@ -583,6 +583,7 @@ pluginCoreIA (struct piArgs *argp)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
|
||||
_("Azimuth:"), 100, 0,
|
||||
argp->azimuth, 0.0, 360.0, 1.0, 10.0, 2,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (emboss_float_adjustment_callback),
|
||||
|
@ -591,6 +592,7 @@ pluginCoreIA (struct piArgs *argp)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
|
||||
_("Elevation:"), 100, 0,
|
||||
argp->elevation, 0.0, 180.0, 1.0, 10.0, 2,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (emboss_float_adjustment_callback),
|
||||
|
@ -599,6 +601,7 @@ pluginCoreIA (struct piArgs *argp)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 2,
|
||||
_("Depth:"), 100, 0,
|
||||
argp->depth, 1.0, 100.0, 1.0, 5.0, 0,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (emboss_int_adjustment_callback),
|
||||
|
|
|
@ -265,6 +265,7 @@ engrave_dialog (void)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
|
||||
_("Height:"), SCALE_WIDTH, 0,
|
||||
pvals.height, 2.0, 16.0, 1.0, 4.0, 0,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_int_adjustment_update),
|
||||
|
|
|
@ -376,7 +376,9 @@ doDialog (void)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
|
||||
_("Red:"), SCALE_WIDTH, 0,
|
||||
framenumber ? xargs.tored : xargs.fromred,
|
||||
0, 255, 1, 8, 0, NULL, NULL);
|
||||
0, 255, 1, 8, 0,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_object_set_user_data (GTK_OBJECT (adj), colorbutton);
|
||||
gtk_object_set_data (GTK_OBJECT (colorbutton), "red", adj);
|
||||
id = gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
|
@ -389,7 +391,9 @@ doDialog (void)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 2,
|
||||
_("Red Threshold:"), SCALE_WIDTH, 0,
|
||||
xargs.red_threshold,
|
||||
0, 255, 1, 8, 0, NULL, NULL);
|
||||
0, 255, 1, 8, 0,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (scale_callback),
|
||||
&xargs.red_threshold);
|
||||
|
@ -398,7 +402,9 @@ doDialog (void)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, framenumber ? 2 : 3,
|
||||
_("Green:"), SCALE_WIDTH, 0,
|
||||
framenumber ? xargs.togreen : xargs.fromgreen,
|
||||
0, 255, 1, 8, 0, NULL, NULL);
|
||||
0, 255, 1, 8, 0,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_object_set_user_data (GTK_OBJECT (adj), colorbutton);
|
||||
gtk_object_set_data (GTK_OBJECT (colorbutton), "green", adj);
|
||||
id = gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
|
@ -411,7 +417,9 @@ doDialog (void)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 4,
|
||||
_("Green Threshold:"), SCALE_WIDTH, 0,
|
||||
xargs.green_threshold,
|
||||
0, 255, 1, 8, 0, NULL, NULL);
|
||||
0, 255, 1, 8, 0,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (scale_callback),
|
||||
&xargs.green_threshold);
|
||||
|
@ -420,7 +428,9 @@ doDialog (void)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, framenumber ? 3 : 5,
|
||||
_("Blue:"), SCALE_WIDTH, 0,
|
||||
framenumber ? xargs.toblue : xargs.fromblue,
|
||||
0, 255, 1, 8, 0, NULL, NULL);
|
||||
0, 255, 1, 8, 0,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_object_set_user_data (GTK_OBJECT (adj), colorbutton);
|
||||
gtk_object_set_data (GTK_OBJECT (colorbutton), "blue", adj);
|
||||
id = gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
|
@ -433,7 +443,9 @@ doDialog (void)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 6,
|
||||
_("Blue Threshold:"), SCALE_WIDTH, 0,
|
||||
xargs.blue_threshold,
|
||||
0, 255, 1, 8, 0, NULL, NULL);
|
||||
0, 255, 1, 8, 0,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (scale_callback),
|
||||
&xargs.blue_threshold);
|
||||
|
|
|
@ -56,25 +56,24 @@ FP_Params Current =
|
|||
GDrawable *drawable, *mask;
|
||||
|
||||
void query (void);
|
||||
void run (char *name,
|
||||
int nparams,
|
||||
void run (gchar *name,
|
||||
gint nparams,
|
||||
GParam *param,
|
||||
int *nreturn_vals,
|
||||
gint *nreturn_vals,
|
||||
GParam **return_vals);
|
||||
|
||||
GPlugInInfo PLUG_IN_INFO =
|
||||
{
|
||||
NULL, /* init_proc */
|
||||
NULL, /* quit_proc */
|
||||
query, /* query_proc */
|
||||
run, /* run_proc */
|
||||
NULL, /* init_proc */
|
||||
NULL, /* quit_proc */
|
||||
query, /* query_proc */
|
||||
run, /* run_proc */
|
||||
};
|
||||
|
||||
MAIN()
|
||||
|
||||
|
||||
void
|
||||
query ()
|
||||
query (void)
|
||||
{
|
||||
GParamDef args[] =
|
||||
{
|
||||
|
@ -82,9 +81,7 @@ query ()
|
|||
{ PARAM_IMAGE, "image", "Input image (used for indexed images)" },
|
||||
{ PARAM_DRAWABLE, "drawable", "Input drawable" },
|
||||
};
|
||||
GParamDef *return_vals = NULL;
|
||||
int nargs = sizeof (args) / sizeof (args[0]);
|
||||
int nreturn_vals = 0;
|
||||
gint nargs = sizeof (args) / sizeof (args[0]);
|
||||
|
||||
INIT_I18N();
|
||||
gimp_install_procedure ("plug_in_filter_pack",
|
||||
|
@ -94,18 +91,19 @@ query ()
|
|||
"Pavel Grinfeld (pavel@ml.com)",
|
||||
"27th March 1997",
|
||||
N_("<Image>/Image/Colors/Filter Pack..."),
|
||||
"RGB*,INDEXED*,GRAY*",
|
||||
"RGB*",
|
||||
PROC_PLUG_IN,
|
||||
nargs, nreturn_vals,
|
||||
args, return_vals);
|
||||
nargs, 0,
|
||||
args, NULL);
|
||||
}
|
||||
|
||||
/********************************STANDARD RUN*************************/
|
||||
|
||||
void
|
||||
run (char *name,
|
||||
int nparams,
|
||||
run (gchar *name,
|
||||
gint nparams,
|
||||
GParam *param,
|
||||
int *nreturn_vals,
|
||||
gint *nreturn_vals,
|
||||
GParam **return_vals)
|
||||
{
|
||||
GParam values[1];
|
||||
|
@ -122,13 +120,14 @@ run (char *name,
|
|||
initializeFilterPacks();
|
||||
|
||||
drawable = gimp_drawable_get (param[2].data.d_drawable);
|
||||
mask=gimp_drawable_get(gimp_image_get_selection(param[1].data.d_image));
|
||||
mask = gimp_drawable_get (gimp_image_get_selection (param[1].data.d_image));
|
||||
|
||||
if (gimp_drawable_is_indexed (drawable->id) ||gimp_drawable_is_gray (drawable->id) ) {
|
||||
gimp_message (_("Convert the image to RGB first!"));
|
||||
status = STATUS_EXECUTION_ERROR;
|
||||
}
|
||||
|
||||
if (gimp_drawable_is_indexed (drawable->id) ||
|
||||
gimp_drawable_is_gray (drawable->id) )
|
||||
{
|
||||
gimp_message (_("Convert the image to RGB first!"));
|
||||
status = STATUS_EXECUTION_ERROR;
|
||||
}
|
||||
else if (gimp_drawable_is_rgb (drawable->id) && fp_dialog())
|
||||
{
|
||||
gimp_progress_init (_("Applying the Filter Pack..."));
|
||||
|
|
|
@ -809,6 +809,7 @@ dialog_show (void)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
|
||||
"X1:", 0, 0,
|
||||
parameters.x1, -50, 50, 0.1, 0.5, 2,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (dialog_double_adjustment_update),
|
||||
|
@ -817,6 +818,7 @@ dialog_show (void)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
|
||||
"X2:", 0, 0,
|
||||
parameters.x2, -50, 50, 0.1, 0.5, 2,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (dialog_double_adjustment_update),
|
||||
|
@ -825,6 +827,7 @@ dialog_show (void)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 2,
|
||||
"Y1:", 0, 0,
|
||||
parameters.y1, -50, 50, 0.1, 0.5, 2,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (dialog_double_adjustment_update),
|
||||
|
@ -833,6 +836,7 @@ dialog_show (void)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 3,
|
||||
"Y2:", 0, 0,
|
||||
parameters.y2, -50, 50, 0.1, 0.5, 2,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (dialog_double_adjustment_update),
|
||||
|
@ -841,6 +845,7 @@ dialog_show (void)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 4,
|
||||
"Depth:", 0, 0,
|
||||
parameters.depth, 1, 50, 1, 5, 0,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (dialog_int_adjustment_update),
|
||||
|
|
|
@ -261,6 +261,7 @@ glass_dialog (void)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
|
||||
_("Tile Width:"), 150, 0,
|
||||
gtvals.xblock, 10, 50, 1, 5, 0,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_int_adjustment_update),
|
||||
|
@ -270,6 +271,7 @@ glass_dialog (void)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
|
||||
_("Tile Height:"), 150, 0,
|
||||
gtvals.yblock, 10, 50, 1, 5, 0,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_int_adjustment_update),
|
||||
|
|
|
@ -2352,6 +2352,7 @@ dialog_box (void)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
|
||||
_("Horizontal:"), SCALE_WIDTH, 0,
|
||||
config.x, MIN_XTILES, MAX_XTILES, 1.0, 4.0, 0,
|
||||
TRUE, 0, 0,
|
||||
_("Number of pieces going across"), NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_int_adjustment_update),
|
||||
|
@ -2361,6 +2362,7 @@ dialog_box (void)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
|
||||
_("Vertical:"), SCALE_WIDTH, 0,
|
||||
config.y, MIN_YTILES, MAX_YTILES, 1.0, 4.0, 0,
|
||||
TRUE, 0, 0,
|
||||
_("Number of pieces going down"), NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_int_adjustment_update),
|
||||
|
@ -2384,6 +2386,7 @@ dialog_box (void)
|
|||
_("Bevel Width:"), SCALE_WIDTH, 0,
|
||||
config.blend_lines,
|
||||
MIN_BLEND_LINES, MAX_BLEND_LINES, 1.0, 2.0, 0,
|
||||
TRUE, 0, 0,
|
||||
_("Degree of slope of each piece's edge"), NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_int_adjustment_update),
|
||||
|
@ -2394,6 +2397,7 @@ dialog_box (void)
|
|||
_("Highlight:"), SCALE_WIDTH, 0,
|
||||
config.blend_amount,
|
||||
MIN_BLEND_AMOUNT, MAX_BLEND_AMOUNT, 0.05, 0.1, 2,
|
||||
TRUE, 0, 0,
|
||||
_("The amount of highlighting on the edges "
|
||||
"of each piece"), NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -823,6 +823,7 @@ mblur_dialog (void)
|
|||
adjustment = gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
|
||||
_("Length:"), 150, 0,
|
||||
mbvals.length, 0.0, 256.0, 1.0, 8.0, 0,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (adjustment, "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_int_adjustment_update),
|
||||
|
@ -831,6 +832,7 @@ mblur_dialog (void)
|
|||
adjustment = gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
|
||||
_("Angle:"), 150, 0,
|
||||
mbvals.angle, 0.0, 360.0, 1.0, 15.0, 0,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (adjustment, "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_int_adjustment_update),
|
||||
|
|
|
@ -670,6 +670,7 @@ mosaic_dialog (void)
|
|||
scale_data = gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
|
||||
_("Tile Size:"), SCALE_WIDTH, 0,
|
||||
mvals.tile_size, 5.0, 100.0, 1.0, 10.0, 1,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (scale_data), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
|
||||
|
@ -678,6 +679,7 @@ mosaic_dialog (void)
|
|||
scale_data = gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
|
||||
_("Tile Height:"), SCALE_WIDTH, 0,
|
||||
mvals.tile_height, 1.0, 50.0, 1.0, 10.0, 1,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (scale_data), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
|
||||
|
@ -686,6 +688,7 @@ mosaic_dialog (void)
|
|||
scale_data = gimp_scale_entry_new (GTK_TABLE (table), 0, 2,
|
||||
_("Tile Spacing:"), SCALE_WIDTH, 0,
|
||||
mvals.tile_spacing, 1.0, 50.0, 1.0, 10.0, 1,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (scale_data), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
|
||||
|
@ -695,6 +698,7 @@ mosaic_dialog (void)
|
|||
_("Tile Neatness:"), SCALE_WIDTH, 0,
|
||||
mvals.tile_neatness,
|
||||
0.0, 1.0, 0.10, 0.1, 2,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (scale_data), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
|
||||
|
@ -703,6 +707,7 @@ mosaic_dialog (void)
|
|||
scale_data = gimp_scale_entry_new (GTK_TABLE (table), 0, 4,
|
||||
_("Light Direction:"), SCALE_WIDTH, 0,
|
||||
mvals.light_dir, 0.0, 360.0, 1.0, 15.0, 1,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (scale_data), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
|
||||
|
@ -712,6 +717,7 @@ mosaic_dialog (void)
|
|||
_("Color Variation:"), SCALE_WIDTH, 0,
|
||||
mvals.color_variation,
|
||||
0.0, 1.0, 0.01, 0.1, 2,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (scale_data), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
|
||||
|
|
|
@ -1025,6 +1025,7 @@ new_channel (const chan_tmpl *ct)
|
|||
_("Angle:"), SCALE_WIDTH, 0,
|
||||
*ct->angle,
|
||||
-90, 90, 1, 15, 1,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_object_set_user_data (chst->angle_adj, ct->angle);
|
||||
gtk_signal_connect (GTK_OBJECT (chst->angle_adj), "value_changed",
|
||||
|
@ -1270,6 +1271,7 @@ newsprint_dialog (GDrawable *drawable)
|
|||
_("Input SPI:"), SCALE_WIDTH, 0,
|
||||
pvals_ui.input_spi,
|
||||
1.0, 1200.0, 1.0, 10.0, 0,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (st.input_spi), "value_changed",
|
||||
GTK_SIGNAL_FUNC (spi_callback),
|
||||
|
@ -1279,6 +1281,7 @@ newsprint_dialog (GDrawable *drawable)
|
|||
_("Output LPI:"), SCALE_WIDTH, 0,
|
||||
pvals_ui.output_lpi,
|
||||
1.0, 1200.0, 1.0, 10.0, 1,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (st.output_lpi), "value_changed",
|
||||
GTK_SIGNAL_FUNC (lpi_callback),
|
||||
|
@ -1288,6 +1291,7 @@ newsprint_dialog (GDrawable *drawable)
|
|||
_("Cell Size:"), SCALE_WIDTH, 0,
|
||||
pvals.cell_width,
|
||||
3.0, 100.0, 1.0, 5.0, 0,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (st.cellsize), "value_changed",
|
||||
GTK_SIGNAL_FUNC (cellsize_callback),
|
||||
|
@ -1323,6 +1327,7 @@ newsprint_dialog (GDrawable *drawable)
|
|||
_("Black Pullout (%):"), SCALE_WIDTH, 0,
|
||||
pvals.k_pullout,
|
||||
0, 100, 1, 10, 0,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (st.pull), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_int_adjustment_update),
|
||||
|
@ -1432,6 +1437,7 @@ newsprint_dialog (GDrawable *drawable)
|
|||
_("Oversample:"), SCALE_WIDTH, 0,
|
||||
pvals.oversample,
|
||||
1.0, 15.0, 1.0, 5.0, 0,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_int_adjustment_update),
|
||||
|
|
|
@ -397,7 +397,7 @@ pluginCoreIA (struct piArgs *argp)
|
|||
gtk_box_pack_start (GTK_BOX (hbox), frame, FALSE, FALSE, 0);
|
||||
gtk_widget_show (frame);
|
||||
|
||||
frame = gtk_frame_new (_("Parameters"));
|
||||
frame = gtk_frame_new (_("Parameter Settings"));
|
||||
gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_ETCHED_IN);
|
||||
gtk_box_pack_start (GTK_BOX (main_vbox), frame, FALSE, FALSE, 0);
|
||||
gtk_widget_show (frame);
|
||||
|
@ -411,6 +411,7 @@ pluginCoreIA (struct piArgs *argp)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
|
||||
_("Alpha:"), 0, 0,
|
||||
argp->alpha, 0.0, 1.0, 0.05, 0.1, 2,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (nlfilt_double_adjustment_update),
|
||||
|
@ -419,6 +420,7 @@ pluginCoreIA (struct piArgs *argp)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
|
||||
_("Radius:"), 0, 0,
|
||||
argp->radius, 1.0 / 3.0, 1.0, 0.05, 0.1, 2,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (nlfilt_double_adjustment_update),
|
||||
|
|
|
@ -51,6 +51,8 @@ typedef struct
|
|||
|
||||
typedef struct
|
||||
{
|
||||
gint channels;
|
||||
GtkObject *channel_adj[4];
|
||||
gint run;
|
||||
} NoisifyInterface;
|
||||
|
||||
|
@ -63,12 +65,14 @@ static void run (gchar *name,
|
|||
gint *nreturn_vals,
|
||||
GParam **return_vals);
|
||||
|
||||
static void noisify (GDrawable * drawable);
|
||||
static gint noisify_dialog (gint channels);
|
||||
static gdouble gauss (void);
|
||||
static void noisify (GDrawable * drawable);
|
||||
static gdouble gauss (void);
|
||||
|
||||
static void noisify_ok_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
static gint noisify_dialog (gint channels);
|
||||
static void noisify_ok_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
static void noisify_double_adjustment_update (GtkAdjustment *adjustment,
|
||||
gpointer data);
|
||||
|
||||
GPlugInInfo PLUG_IN_INFO =
|
||||
{
|
||||
|
@ -86,6 +90,8 @@ static NoisifyVals nvals =
|
|||
|
||||
static NoisifyInterface noise_int =
|
||||
{
|
||||
0,
|
||||
{ NULL, NULL, NULL, NULL },
|
||||
FALSE /* run */
|
||||
};
|
||||
|
||||
|
@ -106,9 +112,7 @@ query (void)
|
|||
{ PARAM_FLOAT, "noise_3", "Noise in the third channel (blue)" },
|
||||
{ PARAM_FLOAT, "noise_4", "Noise in the fourth channel (alpha)" }
|
||||
};
|
||||
static GParamDef *return_vals = NULL;
|
||||
static int nargs = sizeof (args) / sizeof (args[0]);
|
||||
static int nreturn_vals = 0;
|
||||
static gint nargs = sizeof (args) / sizeof (args[0]);
|
||||
|
||||
INIT_I18N();
|
||||
|
||||
|
@ -121,8 +125,8 @@ query (void)
|
|||
N_("<Image>/Filters/Noise/Noisify..."),
|
||||
"RGB*, GRAY*",
|
||||
PROC_PLUG_IN,
|
||||
nargs, nreturn_vals,
|
||||
args, return_vals);
|
||||
nargs, 0,
|
||||
args, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -167,14 +171,16 @@ run (gchar *name,
|
|||
INIT_I18N();
|
||||
/* Make sure all the arguments are there! */
|
||||
if (nparams != 8)
|
||||
status = STATUS_CALLING_ERROR;
|
||||
if (status == STATUS_SUCCESS)
|
||||
{
|
||||
nvals.independent = (param[3].data.d_int32) ? TRUE : FALSE;
|
||||
nvals.noise[0] = param[4].data.d_float;
|
||||
nvals.noise[1] = param[5].data.d_float;
|
||||
nvals.noise[2] = param[6].data.d_float;
|
||||
nvals.noise[3] = param[7].data.d_float;
|
||||
status = STATUS_CALLING_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
nvals.independent = param[3].data.d_int32 ? TRUE : FALSE;
|
||||
nvals.noise[0] = param[4].data.d_float;
|
||||
nvals.noise[1] = param[5].data.d_float;
|
||||
nvals.noise[2] = param[6].data.d_float;
|
||||
nvals.noise[3] = param[7].data.d_float;
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -344,6 +350,7 @@ noisify_dialog (gint channels)
|
|||
table = gtk_table_new (channels + 1, 3, FALSE);
|
||||
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
|
||||
gtk_table_set_row_spacings (GTK_TABLE (table), 2);
|
||||
gtk_table_set_row_spacing (GTK_TABLE (table), 0, 4);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (table), 4);
|
||||
gtk_container_add (GTK_CONTAINER (frame), table);
|
||||
|
||||
|
@ -355,33 +362,41 @@ noisify_dialog (gint channels)
|
|||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle), nvals.independent);
|
||||
gtk_widget_show (toggle);
|
||||
|
||||
noise_int.channels = channels;
|
||||
|
||||
if (channels == 1)
|
||||
{
|
||||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
|
||||
_("Gray:"), SCALE_WIDTH, 0,
|
||||
nvals.noise[0], 0.0, 1.0, 0.01, 0.1, 2,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
|
||||
GTK_SIGNAL_FUNC (noisify_double_adjustment_update),
|
||||
&nvals.noise[0]);
|
||||
noise_int.channel_adj[0] = adj;
|
||||
}
|
||||
else if (channels == 2)
|
||||
{
|
||||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
|
||||
_("Gray:"), SCALE_WIDTH, 0,
|
||||
nvals.noise[0], 0.0, 1.0, 0.01, 0.1, 2,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
|
||||
GTK_SIGNAL_FUNC (noisify_double_adjustment_update),
|
||||
&nvals.noise[0]);
|
||||
noise_int.channel_adj[0] = adj;
|
||||
|
||||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 2,
|
||||
_("Alpha:"), SCALE_WIDTH, 0,
|
||||
nvals.noise[1], 0.0, 1.0, 0.01, 0.1, 2,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
|
||||
GTK_SIGNAL_FUNC (noisify_double_adjustment_update),
|
||||
&nvals.noise[1]);
|
||||
noise_int.channel_adj[1] = adj;
|
||||
}
|
||||
|
||||
else if (channels == 3)
|
||||
|
@ -389,26 +404,32 @@ noisify_dialog (gint channels)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
|
||||
_("Red:"), SCALE_WIDTH, 0,
|
||||
nvals.noise[0], 0.0, 1.0, 0.01, 0.1, 2,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
|
||||
GTK_SIGNAL_FUNC (noisify_double_adjustment_update),
|
||||
&nvals.noise[0]);
|
||||
noise_int.channel_adj[0] = adj;
|
||||
|
||||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 2,
|
||||
_("Green:"), SCALE_WIDTH, 0,
|
||||
nvals.noise[1], 0.0, 1.0, 0.01, 0.1, 2,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
|
||||
GTK_SIGNAL_FUNC (noisify_double_adjustment_update),
|
||||
&nvals.noise[1]);
|
||||
noise_int.channel_adj[1] = adj;
|
||||
|
||||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 3,
|
||||
_("Blue:"), SCALE_WIDTH, 0,
|
||||
nvals.noise[2], 0.0, 1.0, 0.01, 0.1, 2,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
|
||||
GTK_SIGNAL_FUNC (noisify_double_adjustment_update),
|
||||
&nvals.noise[2]);
|
||||
noise_int.channel_adj[2] = adj;
|
||||
}
|
||||
|
||||
else if (channels == 4)
|
||||
|
@ -416,34 +437,42 @@ noisify_dialog (gint channels)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
|
||||
_("Red:"), SCALE_WIDTH, 0,
|
||||
nvals.noise[0], 0.0, 1.0, 0.01, 0.1, 2,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
|
||||
GTK_SIGNAL_FUNC (noisify_double_adjustment_update),
|
||||
&nvals.noise[0]);
|
||||
noise_int.channel_adj[0] = adj;
|
||||
|
||||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 2,
|
||||
_("Green:"), SCALE_WIDTH, 0,
|
||||
nvals.noise[1], 0.0, 1.0, 0.01, 0.1, 2,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
|
||||
GTK_SIGNAL_FUNC (noisify_double_adjustment_update),
|
||||
&nvals.noise[1]);
|
||||
noise_int.channel_adj[1] = adj;
|
||||
|
||||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 3,
|
||||
_("Blue:"), SCALE_WIDTH, 0,
|
||||
nvals.noise[2], 0.0, 1.0, 0.01, 0.1, 2,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
|
||||
GTK_SIGNAL_FUNC (noisify_double_adjustment_update),
|
||||
&nvals.noise[2]);
|
||||
noise_int.channel_adj[2] = adj;
|
||||
|
||||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 4,
|
||||
_("Alpha:"), SCALE_WIDTH, 0,
|
||||
nvals.noise[3], 0.0, 1.0, 0.01, 0.1, 2,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
|
||||
GTK_SIGNAL_FUNC (noisify_double_adjustment_update),
|
||||
&nvals.noise[3]);
|
||||
noise_int.channel_adj[3] = adj;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -454,10 +483,12 @@ noisify_dialog (gint channels)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, i + 1,
|
||||
buffer, SCALE_WIDTH, 0,
|
||||
nvals.noise[i], 0.0, 1.0, 0.01, 0.1, 2,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
|
||||
GTK_SIGNAL_FUNC (noisify_double_adjustment_update),
|
||||
&nvals.noise[i]);
|
||||
noise_int.channel_adj[i] = adj;
|
||||
|
||||
g_free (buffer);
|
||||
}
|
||||
|
@ -502,3 +533,20 @@ noisify_ok_callback (GtkWidget *widget,
|
|||
|
||||
gtk_widget_destroy (GTK_WIDGET (data));
|
||||
}
|
||||
|
||||
static void
|
||||
noisify_double_adjustment_update (GtkAdjustment *adjustment,
|
||||
gpointer data)
|
||||
{
|
||||
gimp_double_adjustment_update (adjustment, data);
|
||||
|
||||
if (! nvals.independent)
|
||||
{
|
||||
gint i;
|
||||
|
||||
for (i = 0; i < noise_int.channels; i++)
|
||||
if (adjustment != GTK_ADJUSTMENT (noise_int.channel_adj[i]))
|
||||
gtk_adjustment_set_value (GTK_ADJUSTMENT (noise_int.channel_adj[i]),
|
||||
adjustment->value);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -398,6 +398,7 @@ nova_dialog (GDrawable *drawable)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 2,
|
||||
_("Radius:"), SCALE_WIDTH, 0,
|
||||
pvals.radius, 1, 100, 1, 10, 0,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_int_adjustment_update),
|
||||
|
@ -406,6 +407,7 @@ nova_dialog (GDrawable *drawable)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 3,
|
||||
_("Spokes:"), SCALE_WIDTH, 0,
|
||||
pvals.nspoke, 1, 1024, 1, 16, 0,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_int_adjustment_update),
|
||||
|
@ -414,6 +416,7 @@ nova_dialog (GDrawable *drawable)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 4,
|
||||
_("Random Hue:"), SCALE_WIDTH, 0,
|
||||
pvals.randomhue, 0, 360, 1, 15, 0,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_int_adjustment_update),
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
#define MODE_RGB 0
|
||||
#define MODE_INTEN 1
|
||||
|
||||
#undef INTENSITY
|
||||
#define INTENSITY(p) ((guint) (p[0]*77+p[1]*150+p[2]*29) >> 8)
|
||||
|
||||
typedef struct
|
||||
|
@ -103,9 +104,7 @@ query (void)
|
|||
{ PARAM_INT32, "mask_size", "Oil paint mask size" },
|
||||
{ PARAM_INT32, "mode", "Algorithm {RGB (0), INTENSITY (1)}" }
|
||||
};
|
||||
static GParamDef *return_vals = NULL;
|
||||
static int nargs = sizeof (args) / sizeof (args[0]);
|
||||
static int nreturn_vals = 0;
|
||||
static gint nargs = sizeof (args) / sizeof (args[0]);
|
||||
|
||||
INIT_I18N();
|
||||
|
||||
|
@ -118,8 +117,8 @@ query (void)
|
|||
N_("<Image>/Filters/Artistic/Oilify..."),
|
||||
"RGB*, GRAY*",
|
||||
PROC_PLUG_IN,
|
||||
nargs, nreturn_vals,
|
||||
args, return_vals);
|
||||
nargs, 0,
|
||||
args, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -158,16 +157,19 @@ run (gchar *name,
|
|||
case RUN_NONINTERACTIVE:
|
||||
/* Make sure all the arguments are there! */
|
||||
if (nparams != 5)
|
||||
status = STATUS_CALLING_ERROR;
|
||||
if (status == STATUS_SUCCESS)
|
||||
{
|
||||
status = STATUS_CALLING_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
ovals.mask_size = (gdouble) param[3].data.d_int32;
|
||||
ovals.mode = (gint) param[4].data.d_int32;
|
||||
}
|
||||
if (status == STATUS_SUCCESS &&
|
||||
((ovals.mask_size < 1.0) ||
|
||||
((ovals.mode != MODE_INTEN) && (ovals.mode != MODE_RGB))))
|
||||
status = STATUS_CALLING_ERROR;
|
||||
|
||||
if ((ovals.mask_size < 1.0) ||
|
||||
((ovals.mode != MODE_INTEN) &&
|
||||
(ovals.mode != MODE_RGB)))
|
||||
status = STATUS_CALLING_ERROR;
|
||||
}
|
||||
break;
|
||||
|
||||
case RUN_WITH_LAST_VALS:
|
||||
|
@ -491,6 +493,7 @@ oilify_dialog (void)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
|
||||
_("Mask Size:"), SCALE_WIDTH, 0,
|
||||
ovals.mask_size, 3.0, 50.0, 1.0, 5.0, 0,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
|
||||
|
|
|
@ -312,6 +312,7 @@ pixelize_dialog (void)
|
|||
gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
|
||||
_("Pixel Width:"), SCALE_WIDTH, ENTRY_WIDTH,
|
||||
pvals.pixelwidth, 1, 64, 1, 8, 0,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adjustment), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_int_adjustment_update),
|
||||
|
|
|
@ -157,9 +157,7 @@ query (void)
|
|||
{ PARAM_INT32, "seed", "Random seed" },
|
||||
{ PARAM_FLOAT, "turbulence", "Turbulence of plasma" }
|
||||
};
|
||||
static GParamDef *return_vals = NULL;
|
||||
static gint nargs = sizeof (args) / sizeof (args[0]);
|
||||
static gint nreturn_vals = 0;
|
||||
|
||||
INIT_I18N();
|
||||
|
||||
|
@ -172,8 +170,8 @@ query (void)
|
|||
N_("<Image>/Filters/Render/Clouds/Plasma..."),
|
||||
"RGB*, GRAY*",
|
||||
PROC_PLUG_IN,
|
||||
nargs, nreturn_vals,
|
||||
args, return_vals);
|
||||
nargs, 0,
|
||||
args, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -319,7 +317,8 @@ plasma_dialog (void)
|
|||
gtk_container_set_border_width (GTK_CONTAINER (table), 4);
|
||||
gtk_container_add (GTK_CONTAINER (frame), table);
|
||||
|
||||
seed_hbox = gimp_random_seed_new (&pvals.seed, &pvals.timeseed,
|
||||
seed_hbox = gimp_random_seed_new (&pvals.seed, NULL,
|
||||
&pvals.timeseed, NULL,
|
||||
TRUE, FALSE);
|
||||
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
|
||||
_("Random Seed:"), 1.0, 0.5,
|
||||
|
@ -328,6 +327,7 @@ plasma_dialog (void)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
|
||||
_("Turbulence:"), SCALE_WIDTH, 0,
|
||||
pvals.turbulence,
|
||||
TRUE, 0, 0,
|
||||
0.1, 7.0, 0.1, 1.0, 1,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
|
|
|
@ -149,10 +149,10 @@ static void polar_toggle_callback (GtkWidget *widget, gpointer data);
|
|||
|
||||
GPlugInInfo PLUG_IN_INFO =
|
||||
{
|
||||
NULL, /* init_proc */
|
||||
NULL, /* quit_proc */
|
||||
query, /* query_proc */
|
||||
run /* run_proc */
|
||||
NULL, /* init_proc */
|
||||
NULL, /* quit_proc */
|
||||
query, /* query_proc */
|
||||
run /* run_proc */
|
||||
};
|
||||
|
||||
static polarize_vals_t pcvals =
|
||||
|
@ -202,10 +202,7 @@ query (void)
|
|||
{ PARAM_INT32, "inverse", "Map from top?" },
|
||||
{ PARAM_INT32, "polrec", "Polar to rectangular?" },
|
||||
};
|
||||
|
||||
static GParamDef *return_vals = NULL;
|
||||
static int nargs = sizeof(args) / sizeof(args[0]);
|
||||
static int nreturn_vals = 0;
|
||||
static gint nargs = sizeof (args) / sizeof (args[0]);
|
||||
|
||||
INIT_I18N();
|
||||
|
||||
|
@ -218,10 +215,8 @@ query (void)
|
|||
N_("<Image>/Filters/Distorts/Polar Coords..."),
|
||||
"RGB*, GRAY*",
|
||||
PROC_PLUG_IN,
|
||||
nargs,
|
||||
nreturn_vals,
|
||||
args,
|
||||
return_vals);
|
||||
nargs, 0,
|
||||
args, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -322,9 +317,10 @@ run (gchar *name,
|
|||
|
||||
/* Make sure all the arguments are present */
|
||||
if (nparams != 8)
|
||||
status = STATUS_CALLING_ERROR;
|
||||
|
||||
if (status == STATUS_SUCCESS)
|
||||
{
|
||||
status = STATUS_CALLING_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
pcvals.circle = param[3].data.d_float;
|
||||
pcvals.angle = param[4].data.d_float;
|
||||
|
@ -332,7 +328,6 @@ run (gchar *name,
|
|||
pcvals.inverse = param[6].data.d_int32;
|
||||
pcvals.polrec = param[7].data.d_int32;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case RUN_WITH_LAST_VALS:
|
||||
|
@ -1003,6 +998,7 @@ polarize_dialog (void)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
|
||||
_("Circle Depth in Percent:"), SCALE_WIDTH, 0,
|
||||
pcvals.circle, 0.0, 100.0, 1.0, 10.0, 2,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (dialog_scale_update),
|
||||
|
@ -1011,6 +1007,7 @@ polarize_dialog (void)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
|
||||
_("Offset Angle:"), SCALE_WIDTH, 0,
|
||||
pcvals.angle, 0.0, 359.0, 1.0, 15.0, 2,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (dialog_scale_update),
|
||||
|
|
|
@ -210,9 +210,7 @@ query (void)
|
|||
{ PARAM_INT32, "seed_type", "Seed type (10 = current time, 11 = seed value)" },
|
||||
{ PARAM_INT32, "rndm_seed", "Seed value (used only if seed type is 11)" },
|
||||
};
|
||||
static GParamDef *return_vals = NULL;
|
||||
static gint nargs = sizeof(args) / sizeof (args[0]);
|
||||
static gint nreturn_vals = 0;
|
||||
|
||||
const gchar *hurl_blurb =
|
||||
"Add a random factor to the image by hurling random data at it.";
|
||||
|
@ -243,8 +241,8 @@ query (void)
|
|||
N_("<Image>/Filters/Noise/Hurl..."),
|
||||
"RGB*, GRAY*, INDEXED*",
|
||||
PROC_PLUG_IN,
|
||||
nargs, nreturn_vals,
|
||||
args, return_vals);
|
||||
nargs, 0,
|
||||
args, NULL);
|
||||
|
||||
gimp_install_procedure (PLUG_IN_NAME[1],
|
||||
(gchar *) pick_blurb,
|
||||
|
@ -255,8 +253,8 @@ query (void)
|
|||
N_("<Image>/Filters/Noise/Pick..."),
|
||||
"RGB*, GRAY*, INDEXED*",
|
||||
PROC_PLUG_IN,
|
||||
nargs, nreturn_vals,
|
||||
args, return_vals);
|
||||
nargs, 0,
|
||||
args, NULL);
|
||||
|
||||
gimp_install_procedure (PLUG_IN_NAME[2],
|
||||
(gchar *) slur_blurb,
|
||||
|
@ -267,8 +265,8 @@ query (void)
|
|||
N_("<Image>/Filters/Noise/Slur..."),
|
||||
"RGB*, GRAY*, INDEXED*",
|
||||
PROC_PLUG_IN,
|
||||
nargs, nreturn_vals,
|
||||
args, return_vals);
|
||||
nargs, 0,
|
||||
args, NULL);
|
||||
}
|
||||
|
||||
/*********************************
|
||||
|
@ -742,7 +740,8 @@ randomize_dialog (void)
|
|||
gtk_widget_show(table);
|
||||
|
||||
/* Random Seed */
|
||||
seed_hbox = gimp_random_seed_new (&pivals.rndm_seed, &pivals.seed_type,
|
||||
seed_hbox = gimp_random_seed_new (&pivals.rndm_seed, NULL,
|
||||
&pivals.seed_type, NULL,
|
||||
SEED_TIME, SEED_USER);
|
||||
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
|
||||
_("Random Seed:"), 1.0, 0.5,
|
||||
|
@ -754,6 +753,7 @@ randomize_dialog (void)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
|
||||
_("Randomization %:"), SCALE_WIDTH, 0,
|
||||
pivals.rndm_pct, 1.0, 100.0, 1.0, 10.0, 0,
|
||||
TRUE, 0, 0,
|
||||
_("Percentage of pixels to be filtered"), NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_int_adjustment_update),
|
||||
|
@ -765,6 +765,7 @@ randomize_dialog (void)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 2,
|
||||
_("Repeat:"), SCALE_WIDTH, 0,
|
||||
pivals.rndm_rcount, 1.0, 100.0, 1.0, 10.0, 0,
|
||||
TRUE, 0, 0,
|
||||
_("Number of times to apply filter"), NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_int_adjustment_update),
|
||||
|
|
|
@ -143,9 +143,7 @@ query (void)
|
|||
{ PARAM_INT32, "antialias", "antialias; True or False" },
|
||||
{ PARAM_INT32, "tile", "tile; if this is true, the image will retain it's tilability" },
|
||||
};
|
||||
static GParamDef *return_vals = NULL;
|
||||
static gint nargs = sizeof (args) / sizeof (args[0]);
|
||||
static gint nreturn_vals = 0;
|
||||
|
||||
INIT_I18N();
|
||||
|
||||
|
@ -158,8 +156,8 @@ query (void)
|
|||
N_("<Image>/Filters/Distorts/Ripple..."),
|
||||
"RGB*, GRAY*",
|
||||
PROC_PLUG_IN,
|
||||
nargs, nreturn_vals,
|
||||
args, return_vals);
|
||||
nargs, 0,
|
||||
args, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -201,8 +199,10 @@ run (gchar *name,
|
|||
INIT_I18N();
|
||||
/* Make sure all the arguments are there! */
|
||||
if (nparams != 10)
|
||||
status = STATUS_CALLING_ERROR;
|
||||
if (status == STATUS_SUCCESS)
|
||||
{
|
||||
status = STATUS_CALLING_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
rvals.period = param[3].data.d_int32;
|
||||
rvals.amplitude = param[4].data.d_int32;
|
||||
|
@ -211,10 +211,10 @@ run (gchar *name,
|
|||
rvals.waveform = param[7].data.d_int32;
|
||||
rvals.antialias = (param[8].data.d_int32) ? TRUE : FALSE;
|
||||
rvals.tile = (param[9].data.d_int32) ? TRUE : FALSE;
|
||||
}
|
||||
if (status == STATUS_SUCCESS &&
|
||||
(rvals.edges < SMEAR || rvals.edges > BLACK))
|
||||
status = STATUS_CALLING_ERROR;
|
||||
|
||||
if (rvals.edges < SMEAR || rvals.edges > BLACK)
|
||||
status = STATUS_CALLING_ERROR;
|
||||
}
|
||||
break;
|
||||
|
||||
case RUN_WITH_LAST_VALS:
|
||||
|
@ -295,219 +295,259 @@ ripple (GDrawable *drawable)
|
|||
bytes = drawable->bpp;
|
||||
|
||||
if ( rvals.tile )
|
||||
{
|
||||
{
|
||||
rvals.edges = WRAP;
|
||||
rvals.period = width/(width/rvals.period)*(rvals.orientation==HORIZONTAL) + height/(height/rvals.period)*(rvals.orientation==VERTICAL);
|
||||
}
|
||||
rvals.period = (width / (width / rvals.period) *
|
||||
(rvals.orientation == HORIZONTAL) +
|
||||
height / (height / rvals.period) *
|
||||
(rvals.orientation == VERTICAL));
|
||||
}
|
||||
|
||||
progress = 0;
|
||||
max_progress = (x2 - x1) * (y2 - y1);
|
||||
|
||||
/* Ripple the image. It's a pretty simple algorithm. If horizontal
|
||||
/* Ripple the image. It's a pretty simple algorithm. If horizontal
|
||||
is selected, then every row is displaced a number of pixels that
|
||||
follows the pattern of the waveform selected. The effect is
|
||||
just reproduced with columns if vertical is selected.
|
||||
*/
|
||||
*/
|
||||
|
||||
gimp_pixel_rgn_init (&dest_rgn, drawable, x1, y1, (x2 - x1), (y2 - y1), TRUE, TRUE);
|
||||
for (pr = gimp_pixel_rgns_register (1, &dest_rgn); pr != NULL; pr = gimp_pixel_rgns_process (pr))
|
||||
{
|
||||
gimp_pixel_rgn_init (&dest_rgn, drawable,
|
||||
x1, y1, (x2 - x1), (y2 - y1), TRUE, TRUE);
|
||||
for (pr = gimp_pixel_rgns_register (1, &dest_rgn);
|
||||
pr != NULL;
|
||||
pr = gimp_pixel_rgns_process (pr))
|
||||
{
|
||||
if (rvals.orientation == VERTICAL)
|
||||
{
|
||||
{
|
||||
destline = dest_rgn.data;
|
||||
|
||||
for (x = dest_rgn.x; x < (dest_rgn.x + dest_rgn.w); x++)
|
||||
{
|
||||
{
|
||||
dest = destline;
|
||||
|
||||
for (y = dest_rgn.y; y < (dest_rgn.y + dest_rgn.h); y++)
|
||||
{
|
||||
{
|
||||
otherdest = dest;
|
||||
|
||||
needy = y + displace_amount(x);
|
||||
yi = floor(needy);
|
||||
|
||||
/* Tile the image. */
|
||||
/* Tile the image. */
|
||||
if (rvals.edges == WRAP)
|
||||
{
|
||||
{
|
||||
needy = fmod(needy + height, height);
|
||||
yi = (yi + height) % height;
|
||||
}
|
||||
/* Smear out the edges of the image by repeating pixels. */
|
||||
}
|
||||
/* Smear out the edges of the image by repeating pixels. */
|
||||
else if (rvals.edges == SMEAR)
|
||||
{
|
||||
{
|
||||
if (yi < 0)
|
||||
yi = 0;
|
||||
yi = 0;
|
||||
else if (yi > height - 1)
|
||||
yi = height - 1;
|
||||
}
|
||||
yi = height - 1;
|
||||
}
|
||||
|
||||
if ( rvals.antialias)
|
||||
{
|
||||
{
|
||||
if (yi == height - 1)
|
||||
{
|
||||
tile = ripple_pixel (drawable, tile, x1, y1, x2, y2, x, yi, &row, &col, pixel[0]);
|
||||
|
||||
{
|
||||
tile = ripple_pixel (drawable, tile,
|
||||
x1, y1, x2, y2,
|
||||
x, yi, &row, &col, pixel[0]);
|
||||
|
||||
for (k = 0; k < bytes; k++)
|
||||
*otherdest++ = pixel[0][k];
|
||||
}
|
||||
*otherdest++ = pixel[0][k];
|
||||
}
|
||||
else if (needy < 0 && needy > -1)
|
||||
{
|
||||
tile = ripple_pixel (drawable, tile, x1, y1, x2, y2, x, 0, &row, &col, pixel[0]);
|
||||
{
|
||||
tile = ripple_pixel (drawable, tile,
|
||||
x1, y1, x2, y2,
|
||||
x, 0, &row, &col, pixel[0]);
|
||||
|
||||
for (k = 0; k < bytes; k++)
|
||||
*otherdest++ = pixel[0][k];
|
||||
}
|
||||
*otherdest++ = pixel[0][k];
|
||||
}
|
||||
|
||||
else if (yi == height - 2 || yi == 0)
|
||||
{
|
||||
tile = ripple_pixel (drawable, tile, x1, y1, x2, y2, x, yi, &row, &col, pixel[0]);
|
||||
tile = ripple_pixel (drawable, tile, x1, y1, x2, y2, x, yi + 1, &row, &col, pixel[1]);
|
||||
{
|
||||
tile = ripple_pixel (drawable, tile,
|
||||
x1, y1, x2, y2,
|
||||
x, yi, &row, &col, pixel[0]);
|
||||
tile = ripple_pixel (drawable, tile,
|
||||
x1, y1, x2, y2,
|
||||
x, yi + 1, &row, &col, pixel[1]);
|
||||
|
||||
for (k = 0; k < bytes; k++)
|
||||
{
|
||||
{
|
||||
values[0] = pixel[0][k];
|
||||
values[1] = pixel[1][k];
|
||||
val = averagetwo(needy, values);
|
||||
|
||||
*otherdest++ = val;
|
||||
} /* for */
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
tile = ripple_pixel (drawable, tile, x1, y1, x2, y2, x, yi, &row, &col, pixel[0]);
|
||||
tile = ripple_pixel (drawable, tile, x1, y1, x2, y2, x, yi + 1, &row, &col, pixel[1]);
|
||||
tile = ripple_pixel (drawable, tile, x1, y1, x2, y2, x, yi - 1, &row, &col, pixel[2]);
|
||||
tile = ripple_pixel (drawable, tile, x1, y1, x2, y2, x, yi + 2, &row, &col, pixel[3]);
|
||||
{
|
||||
tile = ripple_pixel (drawable, tile,
|
||||
x1, y1, x2, y2,
|
||||
x, yi, &row, &col, pixel[0]);
|
||||
tile = ripple_pixel (drawable, tile,
|
||||
x1, y1, x2, y2,
|
||||
x, yi + 1, &row, &col, pixel[1]);
|
||||
tile = ripple_pixel (drawable, tile,
|
||||
x1, y1, x2, y2,
|
||||
x, yi - 1, &row, &col, pixel[2]);
|
||||
tile = ripple_pixel (drawable, tile,
|
||||
x1, y1, x2, y2,
|
||||
x, yi + 2, &row, &col, pixel[3]);
|
||||
|
||||
for (k = 0; k < bytes; k++)
|
||||
{
|
||||
{
|
||||
values[0] = pixel[0][k];
|
||||
values[1] = pixel[1][k];
|
||||
values[2] = pixel[2][k];
|
||||
values[3] = pixel[3][k];
|
||||
|
||||
val = averagefour(needy, values);
|
||||
val = averagefour (needy, values);
|
||||
|
||||
*otherdest++ = val;
|
||||
} /* for */
|
||||
} /* else */
|
||||
} /* antialias */
|
||||
|
||||
}
|
||||
}
|
||||
} /* antialias */
|
||||
else
|
||||
{
|
||||
tile = ripple_pixel (drawable, tile, x1, y1, x2, y2, x, yi, &row, &col, pixel[0]);
|
||||
{
|
||||
tile = ripple_pixel (drawable, tile,
|
||||
x1, y1, x2, y2,
|
||||
x, yi, &row, &col, pixel[0]);
|
||||
|
||||
for (k = 0; k < bytes; k++)
|
||||
*otherdest++ = pixel[0][k];
|
||||
}
|
||||
*otherdest++ = pixel[0][k];
|
||||
}
|
||||
dest += dest_rgn.rowstride;
|
||||
} /* for */
|
||||
} /* for */
|
||||
|
||||
for (k = 0; k < bytes; k++)
|
||||
destline++;
|
||||
} /* for */
|
||||
destline++;
|
||||
} /* for */
|
||||
|
||||
progress += dest_rgn.w * dest_rgn.h;
|
||||
gimp_progress_update ((double) progress / (double) max_progress);
|
||||
}
|
||||
}
|
||||
else /* HORIZONTAL */
|
||||
{
|
||||
{
|
||||
destline = dest_rgn.data;
|
||||
|
||||
for (y = dest_rgn.y; y < (dest_rgn.y + dest_rgn.h); y++)
|
||||
{
|
||||
{
|
||||
dest = destline;
|
||||
|
||||
for (x = dest_rgn.x; x < (dest_rgn.x + dest_rgn.w); x++)
|
||||
{
|
||||
{
|
||||
needx = x + displace_amount(y);
|
||||
xi = floor(needx);
|
||||
xi = floor (needx);
|
||||
|
||||
/* Tile the image. */
|
||||
/* Tile the image. */
|
||||
if (rvals.edges == WRAP)
|
||||
{
|
||||
{
|
||||
needx = fmod((needx + width), width);
|
||||
xi = (xi + width) % width;
|
||||
}
|
||||
/* Smear out the edges of the image by repeating pixels. */
|
||||
}
|
||||
/* Smear out the edges of the image by repeating pixels. */
|
||||
else if (rvals.edges == SMEAR)
|
||||
{
|
||||
{
|
||||
if (xi < 0)
|
||||
xi = 0;
|
||||
xi = 0;
|
||||
else if (xi > width - 1)
|
||||
xi = width - 1;
|
||||
}
|
||||
xi = width - 1;
|
||||
}
|
||||
|
||||
if ( rvals.antialias)
|
||||
{
|
||||
{
|
||||
if (xi == width - 1)
|
||||
{
|
||||
tile = ripple_pixel (drawable, tile, x1, y1, x2, y2, xi, y, &row, &col, pixel[0]);
|
||||
{
|
||||
tile = ripple_pixel (drawable, tile,
|
||||
x1, y1, x2, y2,
|
||||
xi, y, &row, &col, pixel[0]);
|
||||
|
||||
for (k = 0; k < bytes; k++)
|
||||
*dest++ = pixel[0][k];
|
||||
}
|
||||
*dest++ = pixel[0][k];
|
||||
}
|
||||
else if (floor(needx) == -1)
|
||||
{
|
||||
tile = ripple_pixel (drawable, tile, x1, y1, x2, y2, 0, y, &row, &col, pixel[0]);
|
||||
{
|
||||
tile = ripple_pixel (drawable, tile,
|
||||
x1, y1, x2, y2,
|
||||
0, y, &row, &col, pixel[0]);
|
||||
|
||||
for (k = 0; k < bytes; k++)
|
||||
*dest++ = pixel[0][k];
|
||||
}
|
||||
*dest++ = pixel[0][k];
|
||||
}
|
||||
|
||||
else if (xi == width - 2 || xi == 0)
|
||||
{
|
||||
tile = ripple_pixel (drawable, tile, x1, y1, x2, y2, xi, y, &row, &col, pixel[0]);
|
||||
tile = ripple_pixel (drawable, tile, x1, y1, x2, y2, xi + 1, y, &row, &col, pixel[1]);
|
||||
{
|
||||
tile = ripple_pixel (drawable, tile,
|
||||
x1, y1, x2, y2,
|
||||
xi, y, &row, &col, pixel[0]);
|
||||
tile = ripple_pixel (drawable, tile,
|
||||
x1, y1, x2, y2,
|
||||
xi + 1, y, &row, &col, pixel[1]);
|
||||
|
||||
for (k = 0; k < bytes; k++)
|
||||
{
|
||||
{
|
||||
values[0] = pixel[0][k];
|
||||
values[1] = pixel[1][k];
|
||||
val = averagetwo(needx, values);
|
||||
val = averagetwo (needx, values);
|
||||
|
||||
*dest++ = val;
|
||||
} /* for */
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
tile = ripple_pixel (drawable, tile, x1, y1, x2, y2, xi, y, &row, &col, pixel[0]);
|
||||
tile = ripple_pixel (drawable, tile, x1, y1, x2, y2, xi + 1, y, &row, &col, pixel[1]);
|
||||
tile = ripple_pixel (drawable, tile, x1, y1, x2, y2, xi - 1 , y, &row, &col, pixel[2]);
|
||||
tile = ripple_pixel (drawable, tile, x1, y1, x2, y2, xi + 2, y, &row, &col, pixel[3]);
|
||||
{
|
||||
tile = ripple_pixel (drawable, tile,
|
||||
x1, y1, x2, y2,
|
||||
xi, y, &row, &col, pixel[0]);
|
||||
tile = ripple_pixel (drawable, tile,
|
||||
x1, y1, x2, y2,
|
||||
xi + 1, y, &row, &col, pixel[1]);
|
||||
tile = ripple_pixel (drawable, tile,
|
||||
x1, y1, x2, y2,
|
||||
xi - 1 , y, &row, &col, pixel[2]);
|
||||
tile = ripple_pixel (drawable, tile,
|
||||
x1, y1, x2, y2,
|
||||
xi + 2, y, &row, &col, pixel[3]);
|
||||
|
||||
for (k = 0; k < bytes; k++)
|
||||
{
|
||||
{
|
||||
values[0] = pixel[0][k];
|
||||
values[1] = pixel[1][k];
|
||||
values[2] = pixel[2][k];
|
||||
values[3] = pixel[3][k];
|
||||
|
||||
val = averagefour(needx, values);
|
||||
val = averagefour (needx, values);
|
||||
|
||||
*dest++ = val;
|
||||
} /* for */
|
||||
} /* else */
|
||||
} /* antialias */
|
||||
}
|
||||
}
|
||||
} /* antialias */
|
||||
|
||||
else
|
||||
{
|
||||
tile = ripple_pixel (drawable, tile, x1, y1, x2, y2, xi, y, &row, &col, pixel[0]);
|
||||
{
|
||||
tile = ripple_pixel (drawable, tile,
|
||||
x1, y1, x2, y2,
|
||||
xi, y, &row, &col, pixel[0]);
|
||||
|
||||
for (k = 0; k < bytes; k++)
|
||||
*dest++ = pixel[0][k];
|
||||
}
|
||||
} /* for */
|
||||
*dest++ = pixel[0][k];
|
||||
}
|
||||
} /* for */
|
||||
|
||||
destline += dest_rgn.rowstride;
|
||||
} /* for */
|
||||
} /* for */
|
||||
|
||||
progress += dest_rgn.w * dest_rgn.h;
|
||||
gimp_progress_update ((double) progress / (double) max_progress);
|
||||
}
|
||||
|
||||
} /* for */
|
||||
}
|
||||
} /* for */
|
||||
|
||||
if (tile)
|
||||
gimp_tile_unref (tile, FALSE);
|
||||
|
@ -518,7 +558,6 @@ ripple (GDrawable *drawable)
|
|||
gimp_drawable_update (drawable->id, x1, y1, (x2 - x1), (y2 - y1));
|
||||
} /* ripple */
|
||||
|
||||
|
||||
static gint
|
||||
ripple_dialog (void)
|
||||
{
|
||||
|
@ -664,6 +703,7 @@ ripple_dialog (void)
|
|||
scale_data = gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
|
||||
_("Period:"), SCALE_WIDTH, 0,
|
||||
rvals.period, 0, 200, 1, 10, 0,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (scale_data), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_int_adjustment_update),
|
||||
|
@ -673,6 +713,7 @@ ripple_dialog (void)
|
|||
scale_data = gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
|
||||
_("Amplitude:"), SCALE_WIDTH, 0,
|
||||
rvals.amplitude, 0, 200, 1, 10, 0,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (scale_data), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_int_adjustment_update),
|
||||
|
|
|
@ -457,6 +457,7 @@ scatter_hsv_dialog (void)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
|
||||
_("Holdness:"), SCALE_WIDTH, 0,
|
||||
VALS.holdness, 1, 8, 1, 2, 0,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (scatter_hsv_iscale_update),
|
||||
|
@ -465,6 +466,7 @@ scatter_hsv_dialog (void)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
|
||||
_("Hue:"), SCALE_WIDTH, 0,
|
||||
VALS.hue_distance, 0, 255, 1, 8, 0,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (scatter_hsv_iscale_update),
|
||||
|
@ -473,6 +475,7 @@ scatter_hsv_dialog (void)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 2,
|
||||
_("Saturation:"), SCALE_WIDTH, 0,
|
||||
VALS.saturation_distance, 0, 255, 1, 8, 0,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (scatter_hsv_iscale_update),
|
||||
|
@ -481,6 +484,7 @@ scatter_hsv_dialog (void)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 3,
|
||||
_("Value:"), SCALE_WIDTH, 0,
|
||||
VALS.value_distance, 0, 255, 1, 8, 0,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (scatter_hsv_iscale_update),
|
||||
|
|
|
@ -280,6 +280,7 @@ sel_gauss_dialog (void)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
|
||||
_("Max. Delta:"), 128, 0,
|
||||
bvals.maxdelta, 0, 255, 1, 8, 0,
|
||||
TRUE, 0, 0,
|
||||
FALSE, FALSE);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_int_adjustment_update),
|
||||
|
@ -295,7 +296,16 @@ sel_gauss_dialog (void)
|
|||
return bint.run;
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
sel_gauss_ok_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
bint.run = TRUE;
|
||||
|
||||
gtk_widget_destroy (GTK_WIDGET (data));
|
||||
}
|
||||
|
||||
static void
|
||||
init_matrix (gdouble radius,
|
||||
gdouble **mat,
|
||||
gint num)
|
||||
|
@ -444,14 +454,3 @@ sel_gauss (GDrawable *drawable,
|
|||
g_free (mat[i]);
|
||||
g_free (mat);
|
||||
}
|
||||
|
||||
/* Gauss interface functions */
|
||||
|
||||
static void
|
||||
sel_gauss_ok_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
bint.run = TRUE;
|
||||
|
||||
gtk_widget_destroy (GTK_WIDGET (data));
|
||||
}
|
||||
|
|
|
@ -155,9 +155,7 @@ query (void)
|
|||
{ PARAM_DRAWABLE, "drawable", "Input drawable" },
|
||||
{ PARAM_INT32, "percent", "Percent sharpening (default = 10)" }
|
||||
};
|
||||
static GParamDef *return_vals = NULL;
|
||||
static int nargs = sizeof(args) / sizeof(args[0]),
|
||||
nreturn_vals = 0;
|
||||
static gint nargs = sizeof (args) / sizeof (args[0]);
|
||||
|
||||
INIT_I18N();
|
||||
|
||||
|
@ -170,8 +168,8 @@ query (void)
|
|||
N_("<Image>/Filters/Enhance/Sharpen..."),
|
||||
"RGB*, GRAY*",
|
||||
PROC_PLUG_IN,
|
||||
nargs, nreturn_vals,
|
||||
args, return_vals);
|
||||
nargs, 0,
|
||||
args, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -505,7 +503,9 @@ static gint
|
|||
sharpen_dialog (void)
|
||||
{
|
||||
GtkWidget *dialog;
|
||||
GtkWidget *vbox;
|
||||
GtkWidget *table;
|
||||
GtkWidget *abox;
|
||||
GtkWidget *ptable;
|
||||
GtkWidget *frame;
|
||||
GtkWidget *scrollbar;
|
||||
|
@ -554,20 +554,27 @@ sharpen_dialog (void)
|
|||
* Top-level table for dialog...
|
||||
*/
|
||||
|
||||
table = gtk_table_new (3, 3, FALSE);
|
||||
gtk_container_border_width (GTK_CONTAINER (table), 6);
|
||||
gtk_table_set_row_spacings (GTK_TABLE (table), 4);
|
||||
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
|
||||
gtk_box_pack_start (GTK_BOX (GTK_DIALOG(dialog)->vbox), table,
|
||||
FALSE, FALSE, 0);
|
||||
gtk_widget_show (table);
|
||||
vbox = gtk_vbox_new (FALSE, 4);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (vbox), 6);
|
||||
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), vbox,
|
||||
FALSE, FALSE, 0);
|
||||
gtk_widget_show (vbox);
|
||||
|
||||
/*
|
||||
* Preview window...
|
||||
*/
|
||||
|
||||
frame = gtk_frame_new (_("Preview"));
|
||||
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
|
||||
gtk_widget_show (frame);
|
||||
|
||||
abox = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (abox), 4);
|
||||
gtk_container_add (GTK_CONTAINER (frame), abox);
|
||||
gtk_widget_show (abox);
|
||||
|
||||
ptable = gtk_table_new (2, 2, FALSE);
|
||||
gtk_table_attach (GTK_TABLE (table), ptable, 0, 3, 0, 1, 0, 0, 0, 0);
|
||||
gtk_container_add (GTK_CONTAINER (abox), ptable);
|
||||
gtk_widget_show (ptable);
|
||||
|
||||
frame = gtk_frame_new (NULL);
|
||||
|
@ -617,9 +624,20 @@ sharpen_dialog (void)
|
|||
* Sharpness control...
|
||||
*/
|
||||
|
||||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 2,
|
||||
frame = gtk_frame_new (_("Parameter Settings"));
|
||||
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
|
||||
gtk_widget_show (frame);
|
||||
|
||||
table = gtk_table_new (1, 3, FALSE);
|
||||
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (table), 4);
|
||||
gtk_container_add (GTK_CONTAINER (frame), table);
|
||||
gtk_widget_show (table);
|
||||
|
||||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
|
||||
_("Sharpness:"), SCALE_WIDTH, 0,
|
||||
sharpen_percent, 1, 99, 1, 10, 0,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (dialog_iscale_update),
|
||||
|
@ -640,7 +658,7 @@ sharpen_dialog (void)
|
|||
/* preview functions */
|
||||
|
||||
static void
|
||||
preview_init(void)
|
||||
preview_init (void)
|
||||
{
|
||||
int width; /* Byte width of the image */
|
||||
|
||||
|
|
|
@ -119,9 +119,7 @@ query (void)
|
|||
{ PARAM_INT32, "shift_amount", "shift amount (0 <= shift_amount_x <= 200)" },
|
||||
{ PARAM_INT32, "orientation", "vertical, horizontal orientation" },
|
||||
};
|
||||
static GParamDef *return_vals = NULL;
|
||||
static gint nargs = sizeof (args) / sizeof (args[0]);
|
||||
static gint nreturn_vals = 0;
|
||||
|
||||
INIT_I18N();
|
||||
|
||||
|
@ -134,8 +132,8 @@ query (void)
|
|||
N_("<Image>/Filters/Distorts/Shift..."),
|
||||
"RGB*, GRAY*",
|
||||
PROC_PLUG_IN,
|
||||
nargs, nreturn_vals,
|
||||
args, return_vals);
|
||||
nargs, 0,
|
||||
args, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -177,15 +175,17 @@ run (gchar *name,
|
|||
INIT_I18N();
|
||||
/* Make sure all the arguments are there! */
|
||||
if (nparams != 5)
|
||||
status = STATUS_CALLING_ERROR;
|
||||
if (status == STATUS_SUCCESS)
|
||||
{
|
||||
status = STATUS_CALLING_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
shvals.shift_amount = param[3].data.d_int32;
|
||||
shvals.orientation = (param[4].data.d_int32) ? HORIZONTAL : VERTICAL;
|
||||
}
|
||||
if ((status == STATUS_SUCCESS) &&
|
||||
(shvals.shift_amount < 0 || shvals.shift_amount > 200))
|
||||
status = STATUS_CALLING_ERROR;
|
||||
|
||||
if (shvals.shift_amount < 0 || shvals.shift_amount > 200)
|
||||
status = STATUS_CALLING_ERROR;
|
||||
}
|
||||
break;
|
||||
|
||||
case RUN_WITH_LAST_VALS:
|
||||
|
@ -418,6 +418,7 @@ shift_dialog (void)
|
|||
amount_data = gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
|
||||
_("Shift Amount:"), SCALE_WIDTH, 0,
|
||||
shvals.shift_amount, 0, 200, 1, 10, 0,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (amount_data), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_int_adjustment_update),
|
||||
|
|
|
@ -180,9 +180,7 @@ query (void)
|
|||
{ PARAM_FLOAT, "xsize", "Horizontal texture size" },
|
||||
{ PARAM_FLOAT, "ysize", "Vertical texture size" }
|
||||
};
|
||||
static GParamDef *return_vals = NULL;
|
||||
static gint nargs = sizeof (args) / sizeof (args[0]);
|
||||
static gint nreturn_vals = 0;
|
||||
|
||||
INIT_I18N();
|
||||
|
||||
|
@ -195,10 +193,8 @@ query (void)
|
|||
N_("<Image>/Filters/Render/Clouds/Solid Noise..."),
|
||||
"RGB*, GRAY*",
|
||||
PROC_PLUG_IN,
|
||||
nargs,
|
||||
nreturn_vals,
|
||||
args,
|
||||
return_vals);
|
||||
nargs, 0,
|
||||
args, NULL);
|
||||
}
|
||||
|
||||
|
||||
|
@ -243,7 +239,11 @@ run (gchar *name,
|
|||
case RUN_NONINTERACTIVE:
|
||||
INIT_I18N();
|
||||
/* Test number of arguments */
|
||||
if (nparams == 9)
|
||||
if (nparams != 9)
|
||||
{
|
||||
status = STATUS_CALLING_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
snvals.tilable = param[3].data.d_int32;
|
||||
snvals.turbulent = param[4].data.d_int32;
|
||||
|
@ -252,14 +252,12 @@ run (gchar *name,
|
|||
snvals.xsize = param[7].data.d_float;
|
||||
snvals.ysize = param[8].data.d_float;
|
||||
}
|
||||
else
|
||||
status = STATUS_CALLING_ERROR;
|
||||
break;
|
||||
|
||||
case RUN_WITH_LAST_VALS:
|
||||
INIT_I18N();
|
||||
/* Possibly retrieve data */
|
||||
gimp_get_data("plug_in_solid_noise", &snvals);
|
||||
gimp_get_data ("plug_in_solid_noise", &snvals);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -271,17 +269,18 @@ run (gchar *name,
|
|||
gimp_drawable_is_gray (drawable->id)))
|
||||
{
|
||||
/* Set the tile cache size */
|
||||
gimp_tile_cache_ntiles((drawable->width + gimp_tile_width() - 1) / gimp_tile_width());
|
||||
gimp_tile_cache_ntiles ((drawable->width + gimp_tile_width () - 1) /
|
||||
gimp_tile_width ());
|
||||
|
||||
/* Run! */
|
||||
solid_noise (drawable);
|
||||
|
||||
/* If run mode is interactive, flush displays */
|
||||
if (run_mode != RUN_NONINTERACTIVE)
|
||||
gimp_displays_flush();
|
||||
gimp_displays_flush ();
|
||||
|
||||
/* Store data */
|
||||
if (run_mode==RUN_INTERACTIVE || run_mode==RUN_WITH_LAST_VALS)
|
||||
if (run_mode == RUN_INTERACTIVE || run_mode == RUN_WITH_LAST_VALS)
|
||||
gimp_set_data ("plug_in_solid_noise", &snvals,
|
||||
sizeof (SolidNoiseValues));
|
||||
}
|
||||
|
@ -550,7 +549,8 @@ solid_noise_dialog (void)
|
|||
gtk_container_add (GTK_CONTAINER (frame), table);
|
||||
|
||||
/* Random Seed */
|
||||
seed_hbox = gimp_random_seed_new (&snvals.seed, &snvals.timeseed,
|
||||
seed_hbox = gimp_random_seed_new (&snvals.seed, NULL,
|
||||
&snvals.timeseed, NULL,
|
||||
TRUE, FALSE);
|
||||
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
|
||||
_("Random Seed:"), 1.0, 0.5,
|
||||
|
@ -590,6 +590,7 @@ solid_noise_dialog (void)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 2,
|
||||
_("X Size:"), SCALE_WIDTH, 0,
|
||||
snvals.xsize, 0.1, SCALE_MAX, 0.1, 1.0, 1,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
|
||||
|
@ -599,6 +600,7 @@ solid_noise_dialog (void)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 3,
|
||||
_("Y Size:"), SCALE_WIDTH, 0,
|
||||
snvals.ysize, 0.1, SCALE_MAX, 0.1, 1.0, 1,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
|
||||
|
|
|
@ -387,6 +387,7 @@ sparkle_dialog (void)
|
|||
gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
|
||||
_("Luminosity Threshold:"), SCALE_WIDTH, 0,
|
||||
svals.lum_threshold, 0.0, 0.1, 0.001, 0.01, 3,
|
||||
TRUE, 0, 0,
|
||||
_("Adjust the Luminosity Threshold"), NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (scale_data), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
|
||||
|
@ -396,6 +397,7 @@ sparkle_dialog (void)
|
|||
gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
|
||||
_("Flare Intensity:"), SCALE_WIDTH, 0,
|
||||
svals.flare_inten, 0.0, 1.0, 0.01, 0.1, 2,
|
||||
TRUE, 0, 0,
|
||||
_("Adjust the Flare Intensity"), NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (scale_data), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
|
||||
|
@ -405,6 +407,7 @@ sparkle_dialog (void)
|
|||
gimp_scale_entry_new (GTK_TABLE (table), 0, 2,
|
||||
_("Spike Length:"), SCALE_WIDTH, 0,
|
||||
svals.spike_len, 1, 100, 1, 10, 0,
|
||||
TRUE, 0, 0,
|
||||
_("Adjust the Spike Length"), NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (scale_data), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
|
||||
|
@ -414,6 +417,7 @@ sparkle_dialog (void)
|
|||
gimp_scale_entry_new (GTK_TABLE (table), 0, 3,
|
||||
_("Spike Points:"), SCALE_WIDTH, 0,
|
||||
svals.spike_pts, 0, 16, 1, 4, 0,
|
||||
TRUE, 0, 0,
|
||||
_("Adjust the Number of Spikes"), NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (scale_data), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
|
||||
|
@ -423,6 +427,7 @@ sparkle_dialog (void)
|
|||
gimp_scale_entry_new (GTK_TABLE (table), 0, 4,
|
||||
_("Spike Angle (-1: Random):"), SCALE_WIDTH, 0,
|
||||
svals.spike_angle, -1, 360, 1, 15, 0,
|
||||
TRUE, 0, 0,
|
||||
_("Adjust the Spike Angle "
|
||||
"(-1 means a Random Angle is choosen)"), NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (scale_data), "value_changed",
|
||||
|
@ -433,6 +438,7 @@ sparkle_dialog (void)
|
|||
gimp_scale_entry_new (GTK_TABLE (table), 0, 5,
|
||||
_("Spike Density:"), SCALE_WIDTH, 0,
|
||||
svals.density, 0.0, 1.0, 0.01, 0.1, 2,
|
||||
TRUE, 0, 0,
|
||||
_("Adjust the Spike Density"), NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (scale_data), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
|
||||
|
@ -442,6 +448,7 @@ sparkle_dialog (void)
|
|||
gimp_scale_entry_new (GTK_TABLE (table), 0, 6,
|
||||
_("Opacity:"), SCALE_WIDTH, 0,
|
||||
svals.opacity, 0.0, 1.0, 0.01, 0.1, 2,
|
||||
TRUE, 0, 0,
|
||||
_("Adjust the Opacity of the Spikes"), NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (scale_data), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
|
||||
|
@ -451,6 +458,7 @@ sparkle_dialog (void)
|
|||
gimp_scale_entry_new (GTK_TABLE (table), 0, 7,
|
||||
_("Random Hue:"), SCALE_WIDTH, 0,
|
||||
svals.random_hue, 0.0, 1.0, 0.01, 0.1, 2,
|
||||
TRUE, 0, 0,
|
||||
_("Adjust the Value how much the Hue should "
|
||||
"be changed randomly"), NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (scale_data), "value_changed",
|
||||
|
@ -461,6 +469,7 @@ sparkle_dialog (void)
|
|||
gimp_scale_entry_new (GTK_TABLE (table), 0, 8,
|
||||
_("Random Saturation:"), SCALE_WIDTH, 0,
|
||||
svals.random_saturation, 0.0, 1.0, 0.01, 0.1, 2,
|
||||
TRUE, 0, 0,
|
||||
_("Adjust the Value how much the Saturation should "
|
||||
"be changed randomly"), NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (scale_data), "value_changed",
|
||||
|
|
|
@ -156,26 +156,32 @@ run (gchar *name,
|
|||
if (! threshold_alpha_dialog ())
|
||||
return;
|
||||
break;
|
||||
|
||||
case RUN_NONINTERACTIVE:
|
||||
if (nparams != 4)
|
||||
status = STATUS_CALLING_ERROR;
|
||||
if (status == STATUS_SUCCESS)
|
||||
{
|
||||
status = STATUS_CALLING_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
VALS.threshold = param[3].data.d_int32;
|
||||
}
|
||||
break;
|
||||
|
||||
case RUN_WITH_LAST_VALS:
|
||||
gimp_get_data (PLUG_IN_NAME, &VALS);
|
||||
break;
|
||||
}
|
||||
|
||||
if (status == STATUS_SUCCESS)
|
||||
status = threshold_alpha (drawable_id);
|
||||
{
|
||||
status = threshold_alpha (drawable_id);
|
||||
|
||||
if (run_mode != RUN_NONINTERACTIVE)
|
||||
gimp_displays_flush();
|
||||
if (run_mode == RUN_INTERACTIVE && status == STATUS_SUCCESS )
|
||||
gimp_set_data (PLUG_IN_NAME, &VALS, sizeof (ValueType));
|
||||
if (run_mode != RUN_NONINTERACTIVE)
|
||||
gimp_displays_flush ();
|
||||
if (run_mode == RUN_INTERACTIVE && status == STATUS_SUCCESS)
|
||||
gimp_set_data (PLUG_IN_NAME, &VALS, sizeof (ValueType));
|
||||
}
|
||||
|
||||
values[0].type = PARAM_STATUS;
|
||||
values[0].data.d_status = status;
|
||||
|
@ -290,6 +296,7 @@ threshold_alpha_dialog (void)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
|
||||
_("Threshold:"), SCALE_WIDTH, 0,
|
||||
VALS.threshold, 0, 255, 1, 8, 0,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_int_adjustment_update),
|
||||
|
|
|
@ -303,8 +303,10 @@ run (gchar *name,
|
|||
|
||||
case RUN_NONINTERACTIVE:
|
||||
if (nparams != 4)
|
||||
status = STATUS_CALLING_ERROR;
|
||||
if (status == STATUS_SUCCESS)
|
||||
{
|
||||
status = STATUS_CALLING_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
itvals.numtiles = param[3].data.d_int32;
|
||||
}
|
||||
|
@ -602,6 +604,7 @@ tileit_dialog (void)
|
|||
op_data = gimp_scale_entry_new (GTK_TABLE (table2), 0, 0,
|
||||
_("Opacity:"), SCALE_WIDTH, ENTRY_WIDTH,
|
||||
opacity, 0, 100, 1, 10, 0,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (op_data), "value_changed",
|
||||
GTK_SIGNAL_FUNC (tileit_scale_update),
|
||||
|
@ -626,6 +629,7 @@ tileit_dialog (void)
|
|||
size_data = gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
|
||||
"1 / (2 ** n)", SCALE_WIDTH, ENTRY_WIDTH,
|
||||
itvals.numtiles, 2, MAX_SEGS, 1, 1, 0,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (size_data), "value_changed",
|
||||
GTK_SIGNAL_FUNC (tileit_scale_update),
|
||||
|
|
|
@ -168,9 +168,6 @@ query (void)
|
|||
{ PARAM_FLOAT, "threshold", "Threshold" }
|
||||
};
|
||||
static gint nargs = sizeof(args) / sizeof(args[0]);
|
||||
/* for return vals */
|
||||
static GParamDef *return_vals = NULL;
|
||||
static int nreturn_vals = 0;
|
||||
|
||||
INIT_I18N();
|
||||
|
||||
|
@ -184,8 +181,8 @@ query (void)
|
|||
N_("<Image>/Filters/Enhance/Unsharp Mask..."),
|
||||
"GRAY*, RGB*",
|
||||
PROC_PLUG_IN,
|
||||
nargs, nreturn_vals,
|
||||
args, return_vals);
|
||||
nargs, 0,
|
||||
args, NULL);
|
||||
}
|
||||
|
||||
/* this is the actual function */
|
||||
|
@ -223,9 +220,10 @@ run (gchar *name,
|
|||
|
||||
case RUN_NONINTERACTIVE:
|
||||
if (nparams != 6)
|
||||
status = STATUS_CALLING_ERROR;
|
||||
/* get the parameters */
|
||||
else if (status == STATUS_SUCCESS)
|
||||
{
|
||||
status = STATUS_CALLING_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
unsharp_params.radius = param[3].data.d_float;
|
||||
unsharp_params.amount = param[4].data.d_float;
|
||||
|
@ -822,6 +820,7 @@ unsharp_mask_dialog (void)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
|
||||
_("Radius:"), SCALE_WIDTH, 0,
|
||||
unsharp_params.radius, 1.0, 25.0, 0.1, 1.0, 1,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
|
||||
|
@ -830,6 +829,7 @@ unsharp_mask_dialog (void)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
|
||||
_("Amount:"), SCALE_WIDTH, 0,
|
||||
unsharp_params.amount, 0.0, 5.0, 0.01, 0.1, 2,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
|
||||
|
@ -838,6 +838,7 @@ unsharp_mask_dialog (void)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 2,
|
||||
_("Threshold:"), SCALE_WIDTH, 0,
|
||||
unsharp_params.threshold, 0.0, 255.0, 1.0, 10.0, 0,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_int_adjustment_update),
|
||||
|
|
|
@ -993,6 +993,7 @@ vpropagate_dialog (GImageType image_type)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
|
||||
_("Lower Threshold:"), SCALE_WIDTH, 0,
|
||||
vpvals.lower_limit, 0, 255, 1, 8, 0,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_int_adjustment_update),
|
||||
|
@ -1001,6 +1002,7 @@ vpropagate_dialog (GImageType image_type)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
|
||||
_("Upper Threshold:"), SCALE_WIDTH, 0,
|
||||
vpvals.upper_limit, 0, 255, 1, 8, 0,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_int_adjustment_update),
|
||||
|
@ -1009,6 +1011,7 @@ vpropagate_dialog (GImageType image_type)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 2,
|
||||
_("Propagating Rate:"), SCALE_WIDTH, 0,
|
||||
vpvals.propagating_rate, 0, 1, 0.01, 0.1, 2,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
|
||||
|
@ -1019,16 +1022,16 @@ vpropagate_dialog (GImageType image_type)
|
|||
gtk_widget_show (sep);
|
||||
|
||||
gtk_table_add_toggle (table, _("To Left"), 0, 1, 5,
|
||||
(GtkSignalFunc) gimp_toggle_button_update,
|
||||
GTK_SIGNAL_FUNC (gimp_toggle_button_update),
|
||||
&direction_mask_vec[Right2Left]);
|
||||
gtk_table_add_toggle (table, _("To Right"), 2, 3, 5,
|
||||
(GtkSignalFunc) gimp_toggle_button_update,
|
||||
GTK_SIGNAL_FUNC (gimp_toggle_button_update),
|
||||
&direction_mask_vec[Left2Right]);
|
||||
gtk_table_add_toggle (table, _("To Top"), 1, 2, 4,
|
||||
(GtkSignalFunc) gimp_toggle_button_update,
|
||||
GTK_SIGNAL_FUNC (gimp_toggle_button_update),
|
||||
&direction_mask_vec[Bottom2Top]);
|
||||
gtk_table_add_toggle (table, _("To Bottom"), 1, 2, 6,
|
||||
(GtkSignalFunc) gimp_toggle_button_update,
|
||||
GTK_SIGNAL_FUNC (gimp_toggle_button_update),
|
||||
&direction_mask_vec[Top2Bottom]);
|
||||
if ((image_type == RGBA_IMAGE) | (image_type == GRAYA_IMAGE))
|
||||
{
|
||||
|
|
|
@ -145,10 +145,7 @@ query (void)
|
|||
{ PARAM_INT32, "type", "Type of waves, black/smeared" },
|
||||
{ PARAM_INT32, "reflective", "Use Reflection" },
|
||||
};
|
||||
static int nargs = 8;
|
||||
|
||||
static GParamDef *rets = NULL;
|
||||
static int nrets = 0;
|
||||
static gint nargs = sizeof (args) / sizeof (args[0]);
|
||||
|
||||
INIT_I18N();
|
||||
|
||||
|
@ -161,8 +158,8 @@ query (void)
|
|||
N_("<Image>/Filters/Distorts/Waves..."),
|
||||
"RGB*, GRAY*",
|
||||
PROC_PLUG_IN,
|
||||
nargs, nrets,
|
||||
args, rets);
|
||||
nargs, 0,
|
||||
args, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -332,9 +329,11 @@ pluginCoreIA (struct piArgs *argp,
|
|||
{
|
||||
gint r=-1; /* default to error return */
|
||||
GtkWidget *dlg;
|
||||
GtkWidget *main_vbox;
|
||||
GtkWidget *frame;
|
||||
GtkWidget *hbox;
|
||||
GtkWidget *vbox;
|
||||
GtkWidget *sep;
|
||||
GtkWidget *table;
|
||||
GtkWidget *preview;
|
||||
GtkWidget *toggle;
|
||||
|
@ -365,19 +364,37 @@ pluginCoreIA (struct piArgs *argp,
|
|||
GTK_SIGNAL_FUNC (gtk_main_quit),
|
||||
NULL);
|
||||
|
||||
main_vbox = gtk_vbox_new (FALSE, 4);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 6);
|
||||
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox), main_vbox,
|
||||
TRUE, TRUE, 0);
|
||||
gtk_widget_show (main_vbox);
|
||||
|
||||
hbox = gtk_hbox_new (FALSE, 4);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (hbox), 6);
|
||||
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox), hbox, TRUE, TRUE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (main_vbox), hbox, FALSE, FALSE, 0);
|
||||
gtk_widget_show (hbox);
|
||||
|
||||
vbox = gtk_vbox_new (FALSE, 4);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), vbox, FALSE, FALSE, 0);
|
||||
gtk_widget_show (vbox);
|
||||
|
||||
preview = mw_preview_new (vbox, mwp);
|
||||
preview = mw_preview_new (hbox, mwp);
|
||||
gtk_object_set_data (GTK_OBJECT (preview), "piArgs", argp);
|
||||
waves_do_preview (preview);
|
||||
|
||||
frame = gimp_radio_group_new2 (TRUE, _("Mode"),
|
||||
waves_radio_button_update,
|
||||
&argp->type, (gpointer) argp->type,
|
||||
|
||||
_("Smear"), (gpointer) MODE_SMEAR, NULL,
|
||||
_("Blacken"), (gpointer) MODE_BLACKEN, NULL,
|
||||
|
||||
NULL);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), frame, TRUE, TRUE, 0);
|
||||
gtk_widget_show (frame);
|
||||
|
||||
vbox = GTK_BIN (frame)->child;
|
||||
|
||||
sep = gtk_hseparator_new ();
|
||||
gtk_box_pack_start (GTK_BOX (vbox), sep, FALSE, FALSE, 2);
|
||||
gtk_widget_show (sep);
|
||||
|
||||
toggle = gtk_check_button_new_with_label ( _("Reflective"));
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle), argp->reflective);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), toggle, FALSE, FALSE, 0);
|
||||
|
@ -386,13 +403,9 @@ pluginCoreIA (struct piArgs *argp,
|
|||
&argp->reflective);
|
||||
gtk_widget_show (toggle);
|
||||
|
||||
vbox = gtk_vbox_new (FALSE, 4);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 0);
|
||||
gtk_widget_show (vbox);
|
||||
|
||||
frame = gtk_frame_new ( _("Parameters"));
|
||||
frame = gtk_frame_new ( _("Parameter Settings"));
|
||||
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_ETCHED_IN);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (main_vbox), frame, FALSE, FALSE, 0);
|
||||
gtk_widget_show (frame);
|
||||
|
||||
table = gtk_table_new (3, 3, FALSE);
|
||||
|
@ -404,6 +417,7 @@ pluginCoreIA (struct piArgs *argp,
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
|
||||
_("Amplitude:"), 140, 0,
|
||||
argp->amplitude, 0.0, 101.0, 1.0, 5.0, 2,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (waves_double_adjustment_update),
|
||||
|
@ -412,6 +426,7 @@ pluginCoreIA (struct piArgs *argp,
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
|
||||
_("Phase:"), 140, 0,
|
||||
argp->phase, 0.0, 360.0, 2.0, 5.0, 2,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (waves_double_adjustment_update),
|
||||
|
@ -420,6 +435,7 @@ pluginCoreIA (struct piArgs *argp,
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 2,
|
||||
_("Wavelength:"), 140, 0,
|
||||
argp->wavelength, 0.1, 50.0, 1.0, 5.0, 2,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (waves_double_adjustment_update),
|
||||
|
@ -427,18 +443,6 @@ pluginCoreIA (struct piArgs *argp,
|
|||
|
||||
gtk_widget_show (table);
|
||||
|
||||
frame = gimp_radio_group_new2 (TRUE, _("Mode"),
|
||||
waves_radio_button_update,
|
||||
&argp->type, (gpointer) argp->type,
|
||||
|
||||
_("Smear"), (gpointer) MODE_SMEAR, NULL,
|
||||
_("Blacken"), (gpointer) MODE_BLACKEN, NULL,
|
||||
|
||||
NULL);
|
||||
|
||||
gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 0);
|
||||
gtk_widget_show (frame);
|
||||
|
||||
gtk_widget_show (dlg);
|
||||
|
||||
gtk_main ();
|
||||
|
|
|
@ -300,9 +300,10 @@ run (gchar *name,
|
|||
INIT_I18N();
|
||||
/* Make sure all the arguments are present */
|
||||
if (nparams != 6)
|
||||
status = STATUS_CALLING_ERROR;
|
||||
|
||||
if (status == STATUS_SUCCESS)
|
||||
{
|
||||
status = STATUS_CALLING_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
wpvals.whirl = param[3].data.d_float;
|
||||
wpvals.pinch = param[4].data.d_float;
|
||||
|
@ -878,6 +879,7 @@ whirl_pinch_dialog (void)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
|
||||
_("Whirl Angle:"), SCALE_WIDTH, 0,
|
||||
wpvals.whirl, -360.0, 360.0, 1.0, 15.0, 2,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (dialog_scale_update),
|
||||
|
@ -886,6 +888,7 @@ whirl_pinch_dialog (void)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
|
||||
_("Pinch Amount:"), SCALE_WIDTH, 0,
|
||||
wpvals.pinch, -1.0, 1.0, 0.01, 0.1, 3,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (dialog_scale_update),
|
||||
|
@ -894,6 +897,7 @@ whirl_pinch_dialog (void)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 2,
|
||||
_("Radius:"), SCALE_WIDTH, 0,
|
||||
wpvals.radius, 0.0, 2.0, 0.01, 0.1, 3,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (dialog_scale_update),
|
||||
|
|
|
@ -150,9 +150,7 @@ query (void)
|
|||
{PARAM_INT32, "alg", "WIND, BLAST"},
|
||||
{PARAM_INT32, "edge", "LEADING, TRAILING, or BOTH"}
|
||||
};
|
||||
static GParamDef *return_vals = NULL;
|
||||
static int nargs = sizeof(args) / sizeof(args[0]);
|
||||
static int nreturn_vals = 0;
|
||||
static gint nargs = sizeof(args) / sizeof(args[0]);
|
||||
|
||||
INIT_I18N();
|
||||
|
||||
|
@ -165,8 +163,8 @@ query (void)
|
|||
N_("<Image>/Filters/Distorts/Wind..."),
|
||||
"RGB*",
|
||||
PROC_PLUG_IN,
|
||||
nargs, nreturn_vals,
|
||||
args, return_vals);
|
||||
nargs, 0,
|
||||
args, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -188,21 +186,20 @@ run (gchar *name,
|
|||
{
|
||||
case RUN_NONINTERACTIVE:
|
||||
INIT_I18N();
|
||||
if (nparams == 8)
|
||||
if (nparams != 8)
|
||||
{
|
||||
status = STATUS_CALLING_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
config.threshold = param[3].data.d_int32;
|
||||
config.direction = param[4].data.d_int32;
|
||||
config.strength = param[5].data.d_int32;
|
||||
config.alg = param[6].data.d_int32;
|
||||
config.edge = param[7].data.d_int32;
|
||||
|
||||
if (render_effect(drawable) == -1)
|
||||
{
|
||||
status = STATUS_EXECUTION_ERROR;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
status = STATUS_CALLING_ERROR;
|
||||
status = STATUS_EXECUTION_ERROR;
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -860,6 +857,7 @@ dialog_box (void)
|
|||
_("Threshold:"), SCALE_WIDTH, 0,
|
||||
config.threshold,
|
||||
MIN_THRESHOLD, MAX_THRESHOLD, 1.0, 10, 0,
|
||||
TRUE, 0, 0,
|
||||
_("Higher values restrict the effect to fewer areas of the image"), NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_int_adjustment_update),
|
||||
|
@ -873,6 +871,7 @@ dialog_box (void)
|
|||
_("Strength:"), SCALE_WIDTH, 0,
|
||||
config.strength,
|
||||
MIN_STRENGTH, MAX_STRENGTH, 1.0, 10.0, 0,
|
||||
TRUE, 0, 0,
|
||||
_("Higher values increase the magnitude of the effect"), NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_int_adjustment_update),
|
||||
|
|
|
@ -823,6 +823,7 @@ save_dialog (void)
|
|||
scale_data = gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
|
||||
_("Alpha Threshold:"), SCALE_WIDTH, 0,
|
||||
xpmvals.threshold, 0.0, 1.0, 0.01, 0.1, 2,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (scale_data), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
|
||||
|
|
|
@ -56,25 +56,24 @@ FP_Params Current =
|
|||
GDrawable *drawable, *mask;
|
||||
|
||||
void query (void);
|
||||
void run (char *name,
|
||||
int nparams,
|
||||
void run (gchar *name,
|
||||
gint nparams,
|
||||
GParam *param,
|
||||
int *nreturn_vals,
|
||||
gint *nreturn_vals,
|
||||
GParam **return_vals);
|
||||
|
||||
GPlugInInfo PLUG_IN_INFO =
|
||||
{
|
||||
NULL, /* init_proc */
|
||||
NULL, /* quit_proc */
|
||||
query, /* query_proc */
|
||||
run, /* run_proc */
|
||||
NULL, /* init_proc */
|
||||
NULL, /* quit_proc */
|
||||
query, /* query_proc */
|
||||
run, /* run_proc */
|
||||
};
|
||||
|
||||
MAIN()
|
||||
|
||||
|
||||
void
|
||||
query ()
|
||||
query (void)
|
||||
{
|
||||
GParamDef args[] =
|
||||
{
|
||||
|
@ -82,9 +81,7 @@ query ()
|
|||
{ PARAM_IMAGE, "image", "Input image (used for indexed images)" },
|
||||
{ PARAM_DRAWABLE, "drawable", "Input drawable" },
|
||||
};
|
||||
GParamDef *return_vals = NULL;
|
||||
int nargs = sizeof (args) / sizeof (args[0]);
|
||||
int nreturn_vals = 0;
|
||||
gint nargs = sizeof (args) / sizeof (args[0]);
|
||||
|
||||
INIT_I18N();
|
||||
gimp_install_procedure ("plug_in_filter_pack",
|
||||
|
@ -94,18 +91,19 @@ query ()
|
|||
"Pavel Grinfeld (pavel@ml.com)",
|
||||
"27th March 1997",
|
||||
N_("<Image>/Image/Colors/Filter Pack..."),
|
||||
"RGB*,INDEXED*,GRAY*",
|
||||
"RGB*",
|
||||
PROC_PLUG_IN,
|
||||
nargs, nreturn_vals,
|
||||
args, return_vals);
|
||||
nargs, 0,
|
||||
args, NULL);
|
||||
}
|
||||
|
||||
/********************************STANDARD RUN*************************/
|
||||
|
||||
void
|
||||
run (char *name,
|
||||
int nparams,
|
||||
run (gchar *name,
|
||||
gint nparams,
|
||||
GParam *param,
|
||||
int *nreturn_vals,
|
||||
gint *nreturn_vals,
|
||||
GParam **return_vals)
|
||||
{
|
||||
GParam values[1];
|
||||
|
@ -122,13 +120,14 @@ run (char *name,
|
|||
initializeFilterPacks();
|
||||
|
||||
drawable = gimp_drawable_get (param[2].data.d_drawable);
|
||||
mask=gimp_drawable_get(gimp_image_get_selection(param[1].data.d_image));
|
||||
mask = gimp_drawable_get (gimp_image_get_selection (param[1].data.d_image));
|
||||
|
||||
if (gimp_drawable_is_indexed (drawable->id) ||gimp_drawable_is_gray (drawable->id) ) {
|
||||
gimp_message (_("Convert the image to RGB first!"));
|
||||
status = STATUS_EXECUTION_ERROR;
|
||||
}
|
||||
|
||||
if (gimp_drawable_is_indexed (drawable->id) ||
|
||||
gimp_drawable_is_gray (drawable->id) )
|
||||
{
|
||||
gimp_message (_("Convert the image to RGB first!"));
|
||||
status = STATUS_EXECUTION_ERROR;
|
||||
}
|
||||
else if (gimp_drawable_is_rgb (drawable->id) && fp_dialog())
|
||||
{
|
||||
gimp_progress_init (_("Applying the Filter Pack..."));
|
||||
|
|
|
@ -22,6 +22,7 @@ INCLUDES = \
|
|||
-I$(includedir)
|
||||
|
||||
LDADD = \
|
||||
$(top_builddir)/libgimp/libgimpui.la \
|
||||
$(top_builddir)/libgimp/libgimp.la \
|
||||
$(GTK_LIBS) \
|
||||
$(INTLLIBS)
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -670,6 +670,7 @@ mosaic_dialog (void)
|
|||
scale_data = gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
|
||||
_("Tile Size:"), SCALE_WIDTH, 0,
|
||||
mvals.tile_size, 5.0, 100.0, 1.0, 10.0, 1,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (scale_data), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
|
||||
|
@ -678,6 +679,7 @@ mosaic_dialog (void)
|
|||
scale_data = gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
|
||||
_("Tile Height:"), SCALE_WIDTH, 0,
|
||||
mvals.tile_height, 1.0, 50.0, 1.0, 10.0, 1,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (scale_data), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
|
||||
|
@ -686,6 +688,7 @@ mosaic_dialog (void)
|
|||
scale_data = gimp_scale_entry_new (GTK_TABLE (table), 0, 2,
|
||||
_("Tile Spacing:"), SCALE_WIDTH, 0,
|
||||
mvals.tile_spacing, 1.0, 50.0, 1.0, 10.0, 1,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (scale_data), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
|
||||
|
@ -695,6 +698,7 @@ mosaic_dialog (void)
|
|||
_("Tile Neatness:"), SCALE_WIDTH, 0,
|
||||
mvals.tile_neatness,
|
||||
0.0, 1.0, 0.10, 0.1, 2,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (scale_data), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
|
||||
|
@ -703,6 +707,7 @@ mosaic_dialog (void)
|
|||
scale_data = gimp_scale_entry_new (GTK_TABLE (table), 0, 4,
|
||||
_("Light Direction:"), SCALE_WIDTH, 0,
|
||||
mvals.light_dir, 0.0, 360.0, 1.0, 15.0, 1,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (scale_data), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
|
||||
|
@ -712,6 +717,7 @@ mosaic_dialog (void)
|
|||
_("Color Variation:"), SCALE_WIDTH, 0,
|
||||
mvals.color_variation,
|
||||
0.0, 1.0, 0.01, 0.1, 2,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (scale_data), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
|
||||
|
|
|
@ -820,6 +820,7 @@ sinus_dialog (void)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
|
||||
_("X Scale:"), 140, 0,
|
||||
svals.scalex, 0.0001, 100.0, 0.0001, 5, 4,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (sinus_double_adjustment_update),
|
||||
|
@ -828,6 +829,7 @@ sinus_dialog (void)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
|
||||
_("Y Scale:"), 140, 0,
|
||||
svals.scaley, 0.0001, 100.0, 0.0001, 5, 4,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (sinus_double_adjustment_update),
|
||||
|
@ -836,6 +838,7 @@ sinus_dialog (void)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 2,
|
||||
_("Complexity:"), 140, 0,
|
||||
svals.cmplx, 0.0, 15.0, 0.01, 5, 2,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (sinus_double_adjustment_update),
|
||||
|
@ -972,6 +975,7 @@ sinus_dialog (void)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
|
||||
_("First Color:"), 0, 0,
|
||||
svals.col1[3] / 255.0, 0.0, 1.0, 0.01, 0.1, 2,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
|
||||
gtk_object_set_user_data (GTK_OBJECT (adj), push_col1);
|
||||
|
@ -990,6 +994,7 @@ sinus_dialog (void)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
|
||||
_("Second Color:"), 0, 0,
|
||||
svals.col2[3] / 255.0, 0.0, 1.0, 0.01, 0.1, 2,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
|
||||
gtk_object_set_user_data (GTK_OBJECT (adj), push_col2);
|
||||
|
@ -1048,6 +1053,7 @@ sinus_dialog (void)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
|
||||
_("Exponent:"), 0, 0,
|
||||
svals.blend_power, -7.5, 7.5, 0.01, 5.0, 2,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
|
||||
GTK_SIGNAL_FUNC (sinus_double_adjustment_update),
|
||||
|
|
|
@ -299,6 +299,7 @@ struc_dialog (void)
|
|||
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
|
||||
_("Depth:"), 100, 0,
|
||||
svals.depth, 1, 50, 1, 5, 0,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (adj, "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_int_adjustment_update),
|
||||
|
|
|
@ -789,6 +789,7 @@ save_dialog (void)
|
|||
scale_data = gimp_scale_entry_new (GTK_TABLE (table), 0, 2,
|
||||
_("Quality:"), SCALE_WIDTH, 0,
|
||||
jsvals.quality, 0.0, 1.0, 0.01, 0.11, 2,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (scale_data), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
|
||||
|
@ -797,6 +798,7 @@ save_dialog (void)
|
|||
scale_data = gimp_scale_entry_new (GTK_TABLE (table), 0, 3,
|
||||
_("Smoothing:"), SCALE_WIDTH, 0,
|
||||
jsvals.smoothing, 0.0, 1.0, 0.01, 0.1, 2,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (scale_data), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
|
||||
|
|
|
@ -46,8 +46,8 @@ echo "mkdir $2/curves"
|
|||
mkdir $2/curves
|
||||
echo "mkdir $2/gfig"
|
||||
mkdir $2/gfig
|
||||
echo "mkdir $2/gflares"
|
||||
mkdir $2/gflares
|
||||
echo "mkdir $2/gflare"
|
||||
mkdir $2/gflare
|
||||
echo "mkdir $2/fractalexplorer"
|
||||
mkdir $2/fractalexplorer
|
||||
echo "mkdir $2/gimpressionist"
|
||||
|
|
|
@ -13,7 +13,7 @@ mkdir %2\plug-ins
|
|||
mkdir %2\modules
|
||||
mkdir %2\scripts
|
||||
mkdir %2\gfig
|
||||
mkdir %2\gflares
|
||||
mkdir %2\gflare
|
||||
mkdir %2\fractalexplorer
|
||||
mkdir %2\gimpressionist
|
||||
mkdir %2\gimpressionist\Brushes
|
||||
|
|
Loading…
Reference in New Issue