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);
|
||||
|
||||
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
|
||||
|
@ -475,14 +526,16 @@ gimp_random_seed_toggle_update (GtkWidget *widget,
|
|||
|
||||
GtkWidget *
|
||||
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,
|
||||
gtk_container_add (GTK_CONTAINER (alignment), widget);
|
||||
gtk_widget_show (widget);
|
||||
|
||||
widget = alignment;
|
||||
}
|
||||
|
||||
gtk_table_attach (table, widget,
|
||||
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);
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_table_attach_defaults (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);
|
||||
|
||||
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
|
||||
|
@ -475,14 +526,16 @@ gimp_random_seed_toggle_update (GtkWidget *widget,
|
|||
|
||||
GtkWidget *
|
||||
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,
|
||||
gtk_container_add (GTK_CONTAINER (alignment), widget);
|
||||
gtk_widget_show (widget);
|
||||
|
||||
widget = alignment;
|
||||
}
|
||||
|
||||
gtk_table_attach (table, widget,
|
||||
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);
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_table_attach_defaults (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,15 +900,21 @@ 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,
|
||||
|
@ -915,61 +923,81 @@ bumpmap_dialog (void)
|
|||
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,36 +58,31 @@ 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,
|
||||
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 (char *compose_type,
|
||||
static gint compose_dialog (gchar *compose_type,
|
||||
gint32 drawable_ID);
|
||||
|
||||
static gint check_gray (gint32 image_id,
|
||||
|
@ -106,43 +102,56 @@ 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 */
|
||||
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)(unsigned char **src, int *incr_src, int numpix,
|
||||
unsigned char *dst);
|
||||
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 */
|
||||
|
@ -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,9 +317,10 @@ run (char *name,
|
|||
case RUN_NONINTERACTIVE:
|
||||
/* Make sure all the arguments are there! */
|
||||
if (nparams != 7)
|
||||
{
|
||||
status = STATUS_CALLING_ERROR;
|
||||
|
||||
if (status == STATUS_SUCCESS)
|
||||
}
|
||||
else
|
||||
{
|
||||
composevals.compose_ID[0] =
|
||||
compose_by_drawable ? param[2].data.d_int32 : param[1].data.d_int32;
|
||||
|
@ -352,7 +347,8 @@ 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)
|
||||
|
@ -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,24 +427,25 @@ 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);
|
||||
g_message (_("Compose: Error in getting layer IDs"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Get drawable for layer */
|
||||
|
@ -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)"),
|
||||
g_message (_("Compose: Image is not a gray image (bpp=%d)"),
|
||||
incr_src[j]);
|
||||
show_message (msg);
|
||||
g_free (msg);
|
||||
return (-1);
|
||||
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,7 +480,7 @@ 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;
|
||||
|
@ -509,7 +502,7 @@ compose (char *compose_type,
|
|||
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++)
|
||||
|
@ -528,7 +521,7 @@ 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,
|
||||
|
@ -557,40 +550,21 @@ create_new_image (char *filename,
|
|||
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,18 +653,19 @@ 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))
|
||||
{
|
||||
|
@ -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 = (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;
|
||||
|
||||
*(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;
|
||||
|
@ -776,13 +755,13 @@ compose_dialog (char *compose_type,
|
|||
GSList *group;
|
||||
gchar **argv;
|
||||
gint argc;
|
||||
int j, compose_idx, sensitive;
|
||||
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)
|
||||
if (g_strcasecmp (compose_type, compose_dsc[j].compose_type) == 0)
|
||||
compose_idx = j;
|
||||
}
|
||||
if (compose_idx < 0) compose_idx = 0;
|
||||
|
@ -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));
|
||||
}
|
||||
|
||||
|
||||
|
@ -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));
|
||||
|
@ -959,7 +938,7 @@ compose_type_toggle_update (GtkWidget *widget,
|
|||
{
|
||||
gint *toggle_val;
|
||||
gint compose_idx, j;
|
||||
int sensitive;
|
||||
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,114 +50,103 @@ 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,
|
||||
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 (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 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 gint decompose_dialog (void);
|
||||
|
||||
static void decompose_ok_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
static void decompose_toggle_update (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 */
|
||||
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 */
|
||||
int num_images; /* Number of images to create */
|
||||
char *channel_name[MAX_EXTRACT_IMAGES]; /* Names of channels to extract */
|
||||
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)(unsigned char *src, int bpp, int numpix,
|
||||
unsigned char **dst);
|
||||
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"),
|
||||
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"), 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 }
|
||||
{ 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]))
|
||||
|
||||
|
||||
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;
|
||||
|
@ -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)
|
||||
}
|
||||
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)
|
||||
{
|
||||
|
@ -885,11 +844,11 @@ decompose_dialog (void)
|
|||
GSList *group;
|
||||
gchar **argv;
|
||||
gint argc;
|
||||
int j;
|
||||
gint j;
|
||||
|
||||
argc = 1;
|
||||
argv = g_new (gchar *, 1);
|
||||
argv[0] = g_strdup (_("Decompose"));
|
||||
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),
|
||||
|
|
|
@ -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,12 +678,11 @@ 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_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",
|
||||
(GtkSignalFunc)dialog_recursive_callback,
|
||||
GTK_SIGNAL_FUNC (dialog_recursive_callback),
|
||||
NULL);
|
||||
gtk_widget_show (button);*/
|
||||
|
||||
|
@ -679,9 +690,10 @@ destripe_dialog (void)
|
|||
* 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,10 +56,10 @@ 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 =
|
||||
|
@ -72,9 +72,8 @@ GPlugInInfo PLUG_IN_INFO =
|
|||
|
||||
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];
|
||||
|
@ -124,11 +122,12 @@ run (char *name,
|
|||
drawable = gimp_drawable_get (param[2].data.d_drawable);
|
||||
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) ) {
|
||||
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",
|
||||
|
|
|
@ -1,38 +1,38 @@
|
|||
/*********************************************************************************/
|
||||
/* LIC 0.14 -- image filter plug-in for The Gimp program */
|
||||
/* Copyright (C) 1996 Tom Bech */
|
||||
/*===============================================================================*/
|
||||
/* E-mail: tomb@gimp.org */
|
||||
/* You can contact the original The Gimp authors at gimp@xcf.berkeley.edu */
|
||||
/*===============================================================================*/
|
||||
/* This program is free software; you can redistribute it and/or modify it under */
|
||||
/* the terms of the GNU General Public License as published by the Free Software */
|
||||
/* Foundation; either version 2 of the License, or (at your option) any later */
|
||||
/* version. */
|
||||
/*===============================================================================*/
|
||||
/* This program is distributed in the hope that it will be useful, but WITHOUT */
|
||||
/* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS */
|
||||
/* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.*/
|
||||
/*===============================================================================*/
|
||||
/* You should have received a copy of the GNU General Public License along with */
|
||||
/* this program; if not, write to the Free Software Foundation, Inc., 675 Mass */
|
||||
/* Ave, Cambridge, MA 02139, USA. */
|
||||
/*===============================================================================*/
|
||||
/* In other words, you can't sue me for whatever happens while using this ;) */
|
||||
/*********************************************************************************/
|
||||
/* Changes (post 0.10): */
|
||||
/* -> 0.11: Fixed a bug in the convolution kernels (Tom). */
|
||||
/* -> 0.12: Added Quartic's bilinear interpolation stuff (Tom). */
|
||||
/* -> 0.13 Changed some UI stuff causing trouble with the 0.60 release, added */
|
||||
/* the (GIMP) tags and changed random() calls to rand() (Tom) */
|
||||
/* -> 0.14 Ported to 0.99.11 (Tom) */
|
||||
/*********************************************************************************/
|
||||
/* This plug-in implements the Line Integral Convolution (LIC) as described in */
|
||||
/* Cabral et al. "Imaging vector fields using line integral convolution" in the */
|
||||
/* Proceedings of ACM SIGGRAPH 93. Publ. by ACM, New York, NY, USA. p. 263-270. */
|
||||
/* Some of the code is based on code by Steinar Haugen (thanks!), the Perlin */
|
||||
/* noise function is practically ripped as is :) */
|
||||
/*********************************************************************************/
|
||||
/* LIC 0.14 -- image filter plug-in for The Gimp program
|
||||
* Copyright (C) 1996 Tom Bech
|
||||
*
|
||||
* E-mail: tomb@gimp.org
|
||||
* You can contact the original The Gimp authors at gimp@xcf.berkeley.edu
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* In other words, you can't sue me for whatever happens while using this ;)
|
||||
*
|
||||
* Changes (post 0.10):
|
||||
* -> 0.11: Fixed a bug in the convolution kernels (Tom).
|
||||
* -> 0.12: Added Quartic's bilinear interpolation stuff (Tom).
|
||||
* -> 0.13 Changed some UI stuff causing trouble with the 0.60 release, added
|
||||
* the (GIMP) tags and changed random() calls to rand() (Tom)
|
||||
* -> 0.14 Ported to 0.99.11 (Tom)
|
||||
*
|
||||
* This plug-in implements the Line Integral Convolution (LIC) as described in
|
||||
* Cabral et al. "Imaging vector fields using line integral convolution" in the
|
||||
* Proceedings of ACM SIGGRAPH 93. Publ. by ACM, New York, NY, USA. p. 263-270.
|
||||
* Some of the code is based on code by Steinar Haugen (thanks!), the Perlin
|
||||
* noise function is practically ripped as is :)
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
|
@ -77,11 +77,9 @@ typedef struct
|
|||
/* Global variables and such */
|
||||
/*****************************/
|
||||
|
||||
rgbpixel white = {1.0,1.0,1.0};
|
||||
rgbpixel black = {0.0,0.0,0.0};
|
||||
rgbpixel background;
|
||||
static rgbpixel black = { 0.0, 0.0, 0.0 };
|
||||
|
||||
gdouble G[numx][numy][2];
|
||||
static gdouble G[numx][numy][2];
|
||||
|
||||
typedef struct
|
||||
{
|
||||
|
@ -97,19 +95,24 @@ typedef struct
|
|||
gint32 effect_image_id;
|
||||
} LicValues;
|
||||
|
||||
LicValues licvals;
|
||||
static LicValues licvals;
|
||||
|
||||
gdouble l=10.0,dx=2.0,dy=2.0,minv=-2.5,maxv=2.5,isteps=20.0;
|
||||
static gdouble l = 10.0;
|
||||
static gdouble dx = 2.0;
|
||||
static gdouble dy = 2.0;
|
||||
static gdouble minv = -2.5;
|
||||
static gdouble maxv = 2.5;
|
||||
static gdouble isteps = 20.0;
|
||||
|
||||
GDrawable *input_drawable;
|
||||
GDrawable *output_drawable;
|
||||
GPixelRgn source_region;
|
||||
GPixelRgn dest_region;
|
||||
static GDrawable *input_drawable;
|
||||
static GDrawable *output_drawable;
|
||||
static GPixelRgn source_region;
|
||||
static GPixelRgn dest_region;
|
||||
|
||||
gint imgtype,width,height,in_channels,out_channels;
|
||||
gint border_x1,border_y1,border_x2,border_y2;
|
||||
glong maxcounter;
|
||||
guchar *scalarfield;
|
||||
static gint width, height, in_channels;
|
||||
static gint border_x1, border_y1, border_x2, border_y2;
|
||||
static glong maxcounter;
|
||||
static guchar *scalarfield;
|
||||
|
||||
GtkWidget *dialog;
|
||||
|
||||
|
@ -138,23 +141,9 @@ rgb_mul (rgbpixel *a,
|
|||
static void
|
||||
rgb_clamp (rgbpixel *a)
|
||||
{
|
||||
if (a->r>1.0)
|
||||
a->r=1.0;
|
||||
|
||||
if (a->g>1.0)
|
||||
a->g=1.0;
|
||||
|
||||
if (a->b>1.0)
|
||||
a->b=1.0;
|
||||
|
||||
if (a->r<0.0)
|
||||
a->r=0.0;
|
||||
|
||||
if (a->g<0.0)
|
||||
a->g=0.0;
|
||||
|
||||
if (a->b<0.0)
|
||||
a->b=0.0;
|
||||
a->r = CLAMP (a->r, 0.0, 1.0);
|
||||
a->g = CLAMP (a->g, 0.0, 1.0);
|
||||
a->b = CLAMP (a->b, 0.0, 1.0);
|
||||
}
|
||||
|
||||
static rgbpixel
|
||||
|
@ -166,21 +155,21 @@ peek (gint x,
|
|||
|
||||
gimp_pixel_rgn_get_pixel (&source_region, data, x, y);
|
||||
|
||||
color.r=(gdouble)(data[0])/255.0;
|
||||
color.g=(gdouble)(data[1])/255.0;
|
||||
color.b=(gdouble)(data[2])/255.0;
|
||||
color.r = (gdouble) data[0] / 255.0;
|
||||
color.g = (gdouble) data[1] / 255.0;
|
||||
color.b = (gdouble) data[2] / 255.0;
|
||||
|
||||
if (input_drawable->bpp == 4)
|
||||
{
|
||||
if (in_channels == 4)
|
||||
color.a=(gdouble)(data[3])/255.0;
|
||||
color.a = (gdouble) data[3] / 255.0;
|
||||
else
|
||||
color.a = 1.0;
|
||||
}
|
||||
else
|
||||
color.a = 1.0;
|
||||
|
||||
return(color);
|
||||
return color;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -212,12 +201,14 @@ image_setup (GDrawable *drawable,
|
|||
input_drawable = drawable;
|
||||
output_drawable = drawable;
|
||||
|
||||
gimp_drawable_mask_bounds (drawable->id, &border_x1, &border_y1, &border_x2, &border_y2);
|
||||
gimp_drawable_mask_bounds (drawable->id,
|
||||
&border_x1, &border_y1, &border_x2, &border_y2);
|
||||
|
||||
width = input_drawable->width;
|
||||
height = input_drawable->height;
|
||||
|
||||
gimp_pixel_rgn_init (&source_region, input_drawable, 0, 0, width, height, FALSE, FALSE);
|
||||
gimp_pixel_rgn_init (&source_region, input_drawable,
|
||||
0, 0, width, height, FALSE, FALSE);
|
||||
|
||||
maxcounter = (glong) width * (glong) height;
|
||||
|
||||
|
@ -225,16 +216,16 @@ image_setup (GDrawable *drawable,
|
|||
/* =================== */
|
||||
|
||||
in_channels = 3;
|
||||
if (gimp_drawable_has_alpha(input_drawable->id)==TRUE)
|
||||
if (gimp_drawable_has_alpha (input_drawable->id))
|
||||
in_channels++;
|
||||
|
||||
if (interactive==TRUE)
|
||||
if (interactive)
|
||||
{
|
||||
/* Allocate memory for temp. images */
|
||||
/* ================================ */
|
||||
}
|
||||
|
||||
return(TRUE);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static guchar
|
||||
|
@ -246,7 +237,7 @@ peekmap (guchar *image,
|
|||
|
||||
index = (glong) x + (glong) width * (glong) y;
|
||||
|
||||
return(image[index]);
|
||||
return image[index] ;
|
||||
}
|
||||
|
||||
/*************/
|
||||
|
@ -269,22 +260,22 @@ gradx (guchar *image,
|
|||
{
|
||||
gint val=0;
|
||||
|
||||
if (CHECKBOUNDS(x-1,y-1)==TRUE)
|
||||
if (CHECKBOUNDS (x-1, y-1))
|
||||
val = val + (gint) peekmap (image, x-1, y-1);
|
||||
if (CHECKBOUNDS(x+1,y-1)==TRUE)
|
||||
if (CHECKBOUNDS (x+1, y-1))
|
||||
val = val - (gint) peekmap (image, x+1, y-1);
|
||||
|
||||
if (CHECKBOUNDS(x-1,y)==TRUE)
|
||||
if (CHECKBOUNDS (x-1, y))
|
||||
val = val + 2 * (gint) peekmap (image, x-1, y);
|
||||
if (CHECKBOUNDS(x+1,y)==TRUE)
|
||||
if (CHECKBOUNDS (x+1, y))
|
||||
val = val - 2 * (gint) peekmap (image, x+1, y);
|
||||
|
||||
if (CHECKBOUNDS(x-1,y+1)==TRUE)
|
||||
if (CHECKBOUNDS (x-1, y+1))
|
||||
val = val + (gint) peekmap (image, x-1, y+1);
|
||||
if (CHECKBOUNDS(x+1,y+1)==TRUE)
|
||||
if (CHECKBOUNDS (x+1, y+1))
|
||||
val = val - (gint) peekmap (image, x+1, y+1);
|
||||
|
||||
return(val);
|
||||
return val;
|
||||
}
|
||||
|
||||
static gint
|
||||
|
@ -294,21 +285,21 @@ grady (guchar *image,
|
|||
{
|
||||
gint val = 0;
|
||||
|
||||
if (CHECKBOUNDS(x-1,y-1)==TRUE)
|
||||
if (CHECKBOUNDS (x-1, y-1))
|
||||
val = val + (gint) peekmap (image, x-1, y-1);
|
||||
if (CHECKBOUNDS(x,y-1)==TRUE)
|
||||
if (CHECKBOUNDS (x, y-1))
|
||||
val = val + 2 * (gint) peekmap (image, x, y-1);
|
||||
if (CHECKBOUNDS(x+1,y-1)==TRUE)
|
||||
if (CHECKBOUNDS (x+1, y-1))
|
||||
val = val + (gint) peekmap (image, x+1, y-1);
|
||||
|
||||
if (CHECKBOUNDS(x-1,y+1)==TRUE)
|
||||
if (CHECKBOUNDS (x-1, y+1))
|
||||
val = val - (gint) peekmap (image, x-1, y+1);
|
||||
if (CHECKBOUNDS(x,y+1)==TRUE)
|
||||
if (CHECKBOUNDS (x, y+1))
|
||||
val = val - 2 * (gint) peekmap (image, x, y+1);
|
||||
if (CHECKBOUNDS(x+1,y+1)==TRUE)
|
||||
if (CHECKBOUNDS (x+1, y+1))
|
||||
val = val - (gint) peekmap (image, x+1, y+1);
|
||||
|
||||
return(val);
|
||||
return val;
|
||||
}
|
||||
|
||||
/************************************/
|
||||
|
@ -321,9 +312,9 @@ cubic (gdouble t)
|
|||
gdouble at = fabs (t);
|
||||
|
||||
if (at<1.0)
|
||||
return(2.0*at*at*at-3.0*at*at+1.0);
|
||||
return 2.0 * at*at*at - 3.0 * at*at + 1.0;
|
||||
|
||||
return(0.0);
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
static gdouble
|
||||
|
@ -341,7 +332,7 @@ omega (gdouble u,
|
|||
i %= numx;
|
||||
j %= numy;
|
||||
|
||||
return(cubic(u)*cubic(v)*(G[i][j][0]*u+G[i][j][1]*v));
|
||||
return cubic (u) * cubic (v) * (G[i][j][0]*u + G[i][j][1]*v);
|
||||
}
|
||||
|
||||
/*************************************************************/
|
||||
|
@ -363,10 +354,12 @@ noise (gdouble x,
|
|||
for (i = sti; i <= sti + 1; i++)
|
||||
{
|
||||
for (j = stj; j <= stj + 1; j++)
|
||||
sum+=omega((x-(gdouble)i*dx)/dx,(y-(gdouble)j*dy)/dy,i,j);
|
||||
sum += omega ((x - (gdouble) i * dx) / dx,
|
||||
(y - (gdouble) j * dy) / dy,
|
||||
i, j);
|
||||
}
|
||||
|
||||
return(sum);
|
||||
return sum;
|
||||
}
|
||||
|
||||
/*************************************************/
|
||||
|
@ -401,7 +394,7 @@ filter (gdouble u)
|
|||
if (f < 0.0)
|
||||
f = 0.0;
|
||||
|
||||
return(f);
|
||||
return f;
|
||||
}
|
||||
|
||||
/******************************************************/
|
||||
|
@ -448,7 +441,7 @@ lic_noise (gint x,
|
|||
|
||||
i = (i / 2.0) + 0.5;
|
||||
|
||||
return(i);
|
||||
return i;
|
||||
}
|
||||
|
||||
static rgbpixel
|
||||
|
@ -496,8 +489,8 @@ bilinear (gdouble x,
|
|||
|
||||
v.b = iy * m0 + y * m1;
|
||||
|
||||
return(v);
|
||||
} /* bilinear */
|
||||
return v;
|
||||
}
|
||||
|
||||
static void
|
||||
getpixel (rgbpixel *p,
|
||||
|
@ -587,7 +580,7 @@ maximum (gdouble a,
|
|||
if (c > max)
|
||||
max = c;
|
||||
|
||||
return(max);
|
||||
return max;
|
||||
}
|
||||
|
||||
static gdouble
|
||||
|
@ -602,7 +595,7 @@ minimum (gdouble a,
|
|||
if (c < min)
|
||||
min = c;
|
||||
|
||||
return(min);
|
||||
return min;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -614,7 +607,10 @@ get_hue (rgbpixel *col,
|
|||
max = maximum (col->r, col->g, col->b);
|
||||
min = minimum (col->r, col->g, col->b);
|
||||
|
||||
if (max==min) *hue=-1.0;
|
||||
if (max == min)
|
||||
{
|
||||
*hue = -1.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
delta = max-min;
|
||||
|
@ -641,7 +637,9 @@ get_saturation (rgbpixel *col,
|
|||
min = minimum (col->r, col->g, col->b);
|
||||
|
||||
if (max == min)
|
||||
{
|
||||
*sat = 0.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
l = (max + min) / 2.0;
|
||||
|
@ -679,11 +677,12 @@ rgb_to_hue (GDrawable *image,
|
|||
h = image->height;
|
||||
maxc = (glong) w * (glong) h;
|
||||
|
||||
/* gimp_drawable_mask_bounds (drawable->id, &border_x1, &border_y1, &border_x2, &border_y2); */
|
||||
/* gimp_drawable_mask_bounds (drawable->id,
|
||||
&border_x1, &border_y1, &border_x2, &border_y2); */
|
||||
|
||||
gimp_pixel_rgn_init (®ion, image, 0, 0, w, h, FALSE, FALSE);
|
||||
|
||||
themap=(guchar *)malloc((size_t)maxc*sizeof(guchar));
|
||||
themap = g_new (guchar, maxc);
|
||||
|
||||
for (y = 0; y < h; y++)
|
||||
{
|
||||
|
@ -719,11 +718,12 @@ rgb_to_saturation (GDrawable *image,
|
|||
h = image->height;
|
||||
maxc = (glong) w * (glong) h;
|
||||
|
||||
/* gimp_drawable_mask_bounds (drawable->id, &border_x1, &border_y1, &border_x2, &border_y2); */
|
||||
/* gimp_drawable_mask_bounds (drawable->id,
|
||||
&border_x1, &border_y1, &border_x2, &border_y2); */
|
||||
|
||||
gimp_pixel_rgn_init (®ion, image, 0, 0, w, h, FALSE, FALSE);
|
||||
|
||||
themap=(guchar *)malloc((size_t)maxc*sizeof(guchar));
|
||||
themap = g_new (guchar, maxc);
|
||||
|
||||
for (y = 0; y < h; y++)
|
||||
{
|
||||
|
@ -759,11 +759,12 @@ rgb_to_brightness (GDrawable *image,
|
|||
h = image->height;
|
||||
maxc = (glong) w * (glong) h;
|
||||
|
||||
/* gimp_drawable_mask_bounds (drawable->id, &border_x1, &border_y1, &border_x2, &border_y2); */
|
||||
/* gimp_drawable_mask_bounds (drawable->id,
|
||||
&border_x1, &border_y1, &border_x2, &border_y2); */
|
||||
|
||||
gimp_pixel_rgn_init (®ion, image, 0, 0, w, h, FALSE, FALSE);
|
||||
|
||||
themap=(guchar *)malloc((size_t)maxc*sizeof(guchar));
|
||||
themap = g_new (guchar, maxc);
|
||||
|
||||
for (y = 0; y < h; y++)
|
||||
{
|
||||
|
@ -806,7 +807,8 @@ compute_lic_derivative (void)
|
|||
if (tmp != 0.0)
|
||||
{
|
||||
tmp = 1.0 / tmp;
|
||||
vx*=tmp; vy*=tmp;
|
||||
vx *= tmp;
|
||||
vy *= tmp;
|
||||
}
|
||||
|
||||
/* Convolve with the LIC at (x,y) */
|
||||
|
@ -855,7 +857,8 @@ compute_lic_gradient (void)
|
|||
if (tmp != 0.0)
|
||||
{
|
||||
tmp = 1.0 / tmp;
|
||||
vx*=tmp; vy*=tmp;
|
||||
vx *= tmp;
|
||||
vy *= tmp;
|
||||
}
|
||||
|
||||
/* Convolve with the LIC at (x,y) */
|
||||
|
@ -886,7 +889,7 @@ compute_image (void)
|
|||
gint32 new_image_id = -1, new_layer_id = -1;
|
||||
GDrawable *effect;
|
||||
|
||||
if (licvals.create_new_image==TRUE)
|
||||
if (licvals.create_new_image)
|
||||
{
|
||||
/* Create a new image */
|
||||
/* ================== */
|
||||
|
@ -898,13 +901,14 @@ compute_image (void)
|
|||
/* ======================= */
|
||||
|
||||
new_layer_id = gimp_layer_new (new_image_id, _("Background"),
|
||||
width, height, RGB_IMAGE, 100.0, NORMAL_MODE);
|
||||
|
||||
width, height, RGB_IMAGE,
|
||||
100.0, NORMAL_MODE);
|
||||
gimp_image_add_layer (new_image_id, new_layer_id, 0);
|
||||
output_drawable = gimp_drawable_get (new_layer_id);
|
||||
}
|
||||
|
||||
gimp_pixel_rgn_init (&dest_region, output_drawable, 0,0, width,height, TRUE,TRUE);
|
||||
gimp_pixel_rgn_init (&dest_region, output_drawable,
|
||||
0, 0, width, height, TRUE, TRUE);
|
||||
|
||||
gimp_progress_init (_("Van Gogh (LIC)"));
|
||||
|
||||
|
@ -934,7 +938,7 @@ compute_image (void)
|
|||
|
||||
if (scalarfield == NULL)
|
||||
{
|
||||
printf( "LIC: Couldn't allocate temporary buffer - out of memory!\n");
|
||||
g_print ("LIC: Couldn't allocate temporary buffer - out of memory!\n");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -943,7 +947,7 @@ compute_image (void)
|
|||
else
|
||||
compute_lic_gradient ();
|
||||
|
||||
free(scalarfield);
|
||||
g_free (scalarfield);
|
||||
|
||||
/* Update image */
|
||||
/* ============ */
|
||||
|
@ -996,15 +1000,17 @@ effect_image_callback (gint32 id,
|
|||
static void
|
||||
create_main_dialog (void)
|
||||
{
|
||||
GtkWidget *main_vbox;
|
||||
GtkWidget *vbox;
|
||||
GtkWidget *sep;
|
||||
GtkWidget *hbox;
|
||||
GtkWidget *vbox2;
|
||||
GtkWidget *frame;
|
||||
GtkWidget *table;
|
||||
GtkWidget *option_menu;
|
||||
GtkWidget *menu;
|
||||
GtkWidget *button;
|
||||
GtkObject *scale_data;
|
||||
gint row;
|
||||
|
||||
dialog = gimp_dialog_new (_("Van Gogh (LIC)"), "lic",
|
||||
gimp_plugin_help_func, "filters/lic.html",
|
||||
|
@ -1018,29 +1024,29 @@ create_main_dialog (void)
|
|||
|
||||
NULL);
|
||||
|
||||
vbox = gtk_vbox_new (FALSE, 4);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (vbox), 6);
|
||||
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), vbox);
|
||||
gtk_widget_show (vbox);
|
||||
main_vbox = gtk_vbox_new (FALSE, 4);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 6);
|
||||
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), main_vbox);
|
||||
gtk_widget_show (main_vbox);
|
||||
|
||||
hbox = gtk_hbox_new (FALSE, 6);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (main_vbox), hbox, FALSE, FALSE, 0);
|
||||
gtk_widget_show (hbox);
|
||||
|
||||
frame = gtk_frame_new (_("Options"));
|
||||
gtk_container_add (GTK_CONTAINER (hbox), frame);
|
||||
gtk_widget_show (frame);
|
||||
|
||||
vbox2 = gtk_vbox_new (FALSE, 1);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (vbox2), 2);
|
||||
gtk_container_add (GTK_CONTAINER (frame), vbox2);
|
||||
gtk_widget_show (vbox2);
|
||||
vbox = gtk_vbox_new (FALSE, 1);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (vbox), 2);
|
||||
gtk_container_add (GTK_CONTAINER (frame), vbox);
|
||||
gtk_widget_show (vbox);
|
||||
|
||||
button = gtk_check_button_new_with_label( _("Create\nNew Image"));
|
||||
gtk_label_set_justify (GTK_LABEL (GTK_BIN (button)->child), GTK_JUSTIFY_LEFT);
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
|
||||
licvals.create_new_image == TRUE);
|
||||
gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
|
||||
gtk_widget_show (button);
|
||||
|
||||
frame = gimp_radio_group_new2 (TRUE, _("Effect Channel"),
|
||||
|
@ -1080,18 +1086,21 @@ create_main_dialog (void)
|
|||
gtk_container_add (GTK_CONTAINER (hbox), frame);
|
||||
gtk_widget_show (frame);
|
||||
|
||||
frame = gtk_frame_new (_("Parameters"));
|
||||
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
|
||||
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 (6, 3, FALSE);
|
||||
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
|
||||
gtk_table_set_row_spacings (GTK_TABLE (table), 2);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (table), 4);
|
||||
gtk_container_add (GTK_CONTAINER (frame), table);
|
||||
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);
|
||||
|
||||
/* Effect image 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 (effect_image_constrain,
|
||||
effect_image_callback,
|
||||
|
@ -1102,41 +1111,58 @@ create_main_dialog (void)
|
|||
_("Effect Image:"), 1.0, 0.5,
|
||||
option_menu, 2, TRUE);
|
||||
|
||||
scale_data = gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
|
||||
_("Filter Length"), 0, 0,
|
||||
sep = gtk_hseparator_new ();
|
||||
gtk_box_pack_start (GTK_BOX (vbox), sep, FALSE, FALSE, 0);
|
||||
gtk_widget_show (sep);
|
||||
|
||||
table = gtk_table_new (5, 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);
|
||||
|
||||
row = 0;
|
||||
|
||||
scale_data = gimp_scale_entry_new (GTK_TABLE (table), 0, row++,
|
||||
_("Filter Length:"), 0, 0,
|
||||
licvals.filtlen, 0, 64, 1.0, 8.0, 1,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT(scale_data), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
|
||||
&licvals.filtlen);
|
||||
|
||||
scale_data = gimp_scale_entry_new (GTK_TABLE (table), 0, 2,
|
||||
scale_data = gimp_scale_entry_new (GTK_TABLE (table), 0, row++,
|
||||
_("Noise Magnitude:"), 0, 0,
|
||||
licvals.noisemag, 1, 5, 0.1, 1.0, 1,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT(scale_data), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
|
||||
&licvals.noisemag);
|
||||
|
||||
scale_data = gimp_scale_entry_new (GTK_TABLE (table), 0, 3,
|
||||
scale_data = gimp_scale_entry_new (GTK_TABLE (table), 0, row++,
|
||||
_("Integration Steps:"), 0, 0,
|
||||
licvals.intsteps, 1, 40, 1.0, 5.0, 1,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT(scale_data), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
|
||||
&licvals.intsteps);
|
||||
|
||||
scale_data = gimp_scale_entry_new (GTK_TABLE (table), 0, 4,
|
||||
scale_data = gimp_scale_entry_new (GTK_TABLE (table), 0, row++,
|
||||
_("Minimum Value:"), 0, 0,
|
||||
licvals.minv, -100, 0, 1, 10, 1,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT(scale_data), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
|
||||
&licvals.minv);
|
||||
|
||||
scale_data = gimp_scale_entry_new (GTK_TABLE (table), 0, 5,
|
||||
scale_data = gimp_scale_entry_new (GTK_TABLE (table), 0, row++,
|
||||
_("Maximum Value:"), 0, 0,
|
||||
licvals.maxv, 0, 100, 1, 10, 1,
|
||||
TRUE, 0, 0,
|
||||
NULL, NULL);
|
||||
gtk_signal_connect (GTK_OBJECT(scale_data), "value_changed",
|
||||
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
|
||||
|
@ -1216,9 +1242,12 @@ run (gchar *name,
|
|||
|
||||
run_mode = param[0].data.d_int32;
|
||||
|
||||
if (run_mode == RUN_INTERACTIVE) {
|
||||
if (run_mode == RUN_INTERACTIVE)
|
||||
{
|
||||
INIT_I18N_UI();
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
INIT_I18N();
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
@ -64,11 +66,13 @@ static void run (gchar *name,
|
|||
GParam **return_vals);
|
||||
|
||||
static void noisify (GDrawable * drawable);
|
||||
static gint noisify_dialog (gint channels);
|
||||
static gdouble gauss (void);
|
||||
|
||||
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,10 +171,12 @@ 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;
|
||||
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;
|
||||
|
@ -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)
|
||||
}
|
||||
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))))
|
||||
|
||||
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",
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
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)
|
||||
}
|
||||
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))
|
||||
|
||||
if (rvals.edges < SMEAR || rvals.edges > BLACK)
|
||||
status = STATUS_CALLING_ERROR;
|
||||
}
|
||||
break;
|
||||
|
||||
case RUN_WITH_LAST_VALS:
|
||||
|
@ -297,7 +297,10 @@ ripple (GDrawable *drawable)
|
|||
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;
|
||||
|
@ -309,8 +312,11 @@ ripple (GDrawable *drawable)
|
|||
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)
|
||||
{
|
||||
|
@ -346,14 +352,18 @@ ripple (GDrawable *drawable)
|
|||
{
|
||||
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];
|
||||
}
|
||||
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];
|
||||
|
@ -361,8 +371,12 @@ ripple (GDrawable *drawable)
|
|||
|
||||
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++)
|
||||
{
|
||||
|
@ -371,14 +385,22 @@ ripple (GDrawable *drawable)
|
|||
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++)
|
||||
{
|
||||
|
@ -390,13 +412,14 @@ ripple (GDrawable *drawable)
|
|||
val = averagefour (needy, values);
|
||||
|
||||
*otherdest++ = val;
|
||||
} /* for */
|
||||
} /* else */
|
||||
}
|
||||
}
|
||||
} /* 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];
|
||||
|
@ -443,14 +466,18 @@ ripple (GDrawable *drawable)
|
|||
{
|
||||
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];
|
||||
}
|
||||
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];
|
||||
|
@ -458,8 +485,12 @@ ripple (GDrawable *drawable)
|
|||
|
||||
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++)
|
||||
{
|
||||
|
@ -468,14 +499,22 @@ ripple (GDrawable *drawable)
|
|||
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++)
|
||||
{
|
||||
|
@ -487,13 +526,15 @@ ripple (GDrawable *drawable)
|
|||
val = averagefour (needx, values);
|
||||
|
||||
*dest++ = val;
|
||||
} /* for */
|
||||
} /* else */
|
||||
}
|
||||
}
|
||||
} /* 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];
|
||||
|
@ -506,7 +547,6 @@ ripple (GDrawable *drawable)
|
|||
progress += dest_rgn.w * dest_rgn.h;
|
||||
gimp_progress_update ((double) progress / (double) max_progress);
|
||||
}
|
||||
|
||||
} /* for */
|
||||
|
||||
if (tile)
|
||||
|
@ -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,
|
||||
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, 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),
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
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))
|
||||
|
||||
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,8 +252,6 @@ 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:
|
||||
|
@ -271,7 +269,8 @@ 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);
|
||||
|
@ -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)
|
||||
}
|
||||
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);
|
||||
|
||||
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)
|
||||
}
|
||||
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)
|
||||
}
|
||||
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)
|
||||
}
|
||||
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,22 +186,21 @@ 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;
|
||||
}
|
||||
break;
|
||||
|
||||
case RUN_INTERACTIVE:
|
||||
|
@ -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,10 +56,10 @@ 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 =
|
||||
|
@ -72,9 +72,8 @@ GPlugInInfo PLUG_IN_INFO =
|
|||
|
||||
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];
|
||||
|
@ -124,11 +122,12 @@ run (char *name,
|
|||
drawable = gimp_drawable_get (param[2].data.d_drawable);
|
||||
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) ) {
|
||||
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