Fixes for non-interactive operation of plugins including
holes, exchange, grid, deinterlace -adrian
This commit is contained in:
@ -1,3 +1,10 @@
|
|||||||
|
Thu Jan 29 19:25:52 EST 1998 Adrian Likins <adrian@gimp.org>
|
||||||
|
|
||||||
|
* fixed the non-iteractive modes for plugins:
|
||||||
|
exchange, holes, grid, deinterlace
|
||||||
|
(mainly expecting wrong number of arguments or just ingome
|
||||||
|
non-interactive mood entirely)
|
||||||
|
|
||||||
Thu Jan 29 01:05:10 PST 1998 Manish Singh <yosh@gimp.org>
|
Thu Jan 29 01:05:10 PST 1998 Manish Singh <yosh@gimp.org>
|
||||||
|
|
||||||
* updated refract and warp plugins
|
* updated refract and warp plugins
|
||||||
|
@ -108,10 +108,11 @@ run (char *name,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case RUN_NONINTERACTIVE:
|
case RUN_NONINTERACTIVE:
|
||||||
if (nparams != 1)
|
if (nparams != 4)
|
||||||
status = STATUS_CALLING_ERROR;
|
status = STATUS_CALLING_ERROR;
|
||||||
if (status == STATUS_SUCCESS)
|
if (status == STATUS_SUCCESS)
|
||||||
DeinterlaceValue = param[3].data.d_int32;
|
DeinterlaceValue = param[3].data.d_int32;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RUN_WITH_LAST_VALS:
|
case RUN_WITH_LAST_VALS:
|
||||||
|
@ -150,8 +150,20 @@ void run(char *name, int nparams, GParam *param, int *nreturn_vals, GParam **ret
|
|||||||
gimp_palette_get_foreground(&xargs.fromred, &xargs.fromgreen, &xargs.fromblue);
|
gimp_palette_get_foreground(&xargs.fromred, &xargs.fromgreen, &xargs.fromblue);
|
||||||
break;
|
break;
|
||||||
case RUN_NONINTERACTIVE:
|
case RUN_NONINTERACTIVE:
|
||||||
status = STATUS_EXECUTION_ERROR;
|
if(nparams != 10)
|
||||||
return;
|
status = STATUS_EXECUTION_ERROR;
|
||||||
|
if (status == STATUS_SUCCESS)
|
||||||
|
{
|
||||||
|
xargs.fromred = param[3].data.d_int8;
|
||||||
|
xargs.fromgreen = param[4].data.d_int8;
|
||||||
|
xargs.fromblue = param[5].data.d_int8;
|
||||||
|
xargs.tored = param[6].data.d_int8;
|
||||||
|
xargs.togreen = param[7].data.d_int8;
|
||||||
|
xargs.toblue = param[8].data.d_int8;
|
||||||
|
xargs.threshold = param[9].data.d_int32;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -17,363 +17,395 @@
|
|||||||
#include "gtk/gtk.h"
|
#include "gtk/gtk.h"
|
||||||
|
|
||||||
/* Declare local functions. */
|
/* Declare local functions. */
|
||||||
static void query(void);
|
static void query (void);
|
||||||
static void run(char *name,
|
static void run (char *name,
|
||||||
int nparams,
|
int nparams,
|
||||||
GParam * param,
|
GParam * param,
|
||||||
int *nreturn_vals,
|
int *nreturn_vals,
|
||||||
GParam ** return_vals);
|
GParam ** return_vals);
|
||||||
static gint dialog();
|
static gint dialog ();
|
||||||
|
|
||||||
static void doit(GDrawable * drawable);
|
static void doit (GDrawable * drawable);
|
||||||
|
|
||||||
GPlugInInfo PLUG_IN_INFO =
|
GPlugInInfo PLUG_IN_INFO =
|
||||||
{
|
{
|
||||||
NULL, /* init_proc */
|
NULL, /* init_proc */
|
||||||
NULL, /* quit_proc */
|
NULL, /* quit_proc */
|
||||||
query, /* query_proc */
|
query, /* query_proc */
|
||||||
run, /* run_proc */
|
run, /* run_proc */
|
||||||
};
|
};
|
||||||
|
|
||||||
gint bytes;
|
gint bytes;
|
||||||
gint sx1, sy1, sx2, sy2;
|
gint sx1, sy1, sx2, sy2;
|
||||||
int run_flag = 0;
|
int run_flag = 0;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct
|
||||||
gint width, height;
|
{
|
||||||
gint x_offset, y_offset;
|
gint width, height;
|
||||||
} config;
|
gint x_offset, y_offset;
|
||||||
|
}
|
||||||
|
config;
|
||||||
|
|
||||||
config my_config =
|
config my_config =
|
||||||
{
|
{
|
||||||
16, 16, /* width, height */
|
16, 16, /* width, height */
|
||||||
0, 0, /* x_offset, y_offset */
|
0, 0, /* x_offset, y_offset */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
MAIN()
|
MAIN ()
|
||||||
|
|
||||||
static void query()
|
static void query ()
|
||||||
{
|
{
|
||||||
static GParamDef args[] =
|
static GParamDef args[] =
|
||||||
|
{
|
||||||
|
{PARAM_INT32, "run_mode", "Interactive, non-interactive"},
|
||||||
|
{PARAM_IMAGE, "image", "Input image (unused)"},
|
||||||
|
{PARAM_DRAWABLE, "drawable", "Input drawable"},
|
||||||
|
{PARAM_INT32, "width", "Width"},
|
||||||
|
{PARAM_INT32, "height", "Height"},
|
||||||
|
{PARAM_INT32, "x_offset", "X Offset"},
|
||||||
|
{PARAM_INT32, "y_offset", "Y Offset"},
|
||||||
|
};
|
||||||
|
static GParamDef *return_vals = NULL;
|
||||||
|
static int nargs = sizeof (args) / sizeof (args[0]);
|
||||||
|
static int nreturn_vals = 0;
|
||||||
|
|
||||||
|
gimp_install_procedure ("plug_in_grid",
|
||||||
|
"Draws a grid.",
|
||||||
|
"",
|
||||||
|
"Tim Newsome",
|
||||||
|
"Tim Newsome",
|
||||||
|
"1997",
|
||||||
|
"<Image>/Filters/Render/Grid",
|
||||||
|
"RGB*, GRAY*",
|
||||||
|
PROC_PLUG_IN,
|
||||||
|
nargs, nreturn_vals,
|
||||||
|
args, return_vals);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
run (char *name, int n_params, GParam * param, int *nreturn_vals,
|
||||||
|
GParam ** return_vals)
|
||||||
|
{
|
||||||
|
static GParam values[1];
|
||||||
|
GDrawable *drawable;
|
||||||
|
GRunModeType run_mode;
|
||||||
|
GStatusType status = STATUS_SUCCESS;
|
||||||
|
|
||||||
|
*nreturn_vals = 1;
|
||||||
|
*return_vals = values;
|
||||||
|
|
||||||
|
run_mode = param[0].data.d_int32;
|
||||||
|
|
||||||
|
if (run_mode == RUN_NONINTERACTIVE)
|
||||||
|
{
|
||||||
|
if (n_params != 7)
|
||||||
{
|
{
|
||||||
{PARAM_INT32, "run_mode", "Interactive, non-interactive"},
|
status = STATUS_CALLING_ERROR;
|
||||||
{PARAM_IMAGE, "image", "Input image (unused)"},
|
}
|
||||||
{PARAM_DRAWABLE, "drawable", "Input drawable"},
|
if( status == STATUS_SUCCESS)
|
||||||
{PARAM_INT32, "width", "Width"},
|
{
|
||||||
{PARAM_INT32, "height", "Height"},
|
my_config.width = param[3].data.d_int32;
|
||||||
{PARAM_INT32, "x_offset", "X Offset"},
|
my_config.height = param[4].data.d_int32;
|
||||||
{PARAM_INT32, "y_offset", "Y Offset"},
|
my_config.x_offset = param[5].data.d_int32;
|
||||||
};
|
my_config.y_offset = param[6].data.d_int32;
|
||||||
static GParamDef *return_vals = NULL;
|
}
|
||||||
static int nargs = sizeof(args) / sizeof(args[0]);
|
}
|
||||||
static int nreturn_vals = 0;
|
else
|
||||||
|
{
|
||||||
|
/* Possibly retrieve data */
|
||||||
|
gimp_get_data ("plug_in_grid", &my_config);
|
||||||
|
|
||||||
gimp_install_procedure("plug_in_grid",
|
if (run_mode == RUN_INTERACTIVE)
|
||||||
"Draws a grid.",
|
{
|
||||||
"",
|
/* Oh boy. We get to do a dialog box, because we can't really expect the
|
||||||
"Tim Newsome",
|
* user to set us up with the right values using gdb.
|
||||||
"Tim Newsome",
|
*/
|
||||||
"1997",
|
if (!dialog ())
|
||||||
"<Image>/Filters/Render/Grid",
|
{
|
||||||
"RGB, GRAY",
|
/* The dialog was closed, or something similarly evil happened. */
|
||||||
PROC_PLUG_IN,
|
status = STATUS_EXECUTION_ERROR;
|
||||||
nargs, nreturn_vals,
|
}
|
||||||
args, return_vals);
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (my_config.width <= 0 || my_config.height <= 0)
|
||||||
|
{
|
||||||
|
status = STATUS_EXECUTION_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (status == STATUS_SUCCESS)
|
||||||
|
{
|
||||||
|
/* Get the specified drawable */
|
||||||
|
drawable = gimp_drawable_get (param[2].data.d_drawable);
|
||||||
|
|
||||||
|
/* Make sure that the drawable is gray or RGB color */
|
||||||
|
if (gimp_drawable_color (drawable->id) || gimp_drawable_gray (drawable->id))
|
||||||
|
{
|
||||||
|
gimp_progress_init ("Drawing Grid...");
|
||||||
|
gimp_tile_cache_ntiles (2 * (drawable->width / gimp_tile_width () + 1));
|
||||||
|
|
||||||
|
srand (time (NULL));
|
||||||
|
doit (drawable);
|
||||||
|
|
||||||
|
if (run_mode != RUN_NONINTERACTIVE)
|
||||||
|
gimp_displays_flush ();
|
||||||
|
|
||||||
|
if (run_mode == RUN_INTERACTIVE)
|
||||||
|
gimp_set_data ("plug_in_grid", &my_config, sizeof (my_config));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
status = STATUS_EXECUTION_ERROR;
|
||||||
|
}
|
||||||
|
gimp_drawable_detach (drawable);
|
||||||
|
}
|
||||||
|
|
||||||
|
values[0].type = PARAM_STATUS;
|
||||||
|
values[0].data.d_status = status;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void run(char *name, int n_params, GParam * param, int *nreturn_vals,
|
static void
|
||||||
GParam ** return_vals)
|
doit (GDrawable * drawable)
|
||||||
{
|
{
|
||||||
static GParam values[1];
|
GPixelRgn srcPR, destPR;
|
||||||
GDrawable *drawable;
|
gint width, height;
|
||||||
GRunModeType run_mode;
|
int w, h, b;
|
||||||
GStatusType status = STATUS_SUCCESS;
|
guchar *copybuf;
|
||||||
|
guchar color[4] =
|
||||||
|
{0, 0, 0, 0};
|
||||||
|
|
||||||
*nreturn_vals = 1;
|
/* Get the input area. This is the bounding box of the selection in
|
||||||
*return_vals = values;
|
* the image (or the entire image if there is no selection). Only
|
||||||
|
* operating on the input area is simply an optimization. It doesn't
|
||||||
|
* need to be done for correct operation. (It simply makes it go
|
||||||
|
* faster, since fewer pixels need to be operated on).
|
||||||
|
*/
|
||||||
|
gimp_drawable_mask_bounds (drawable->id, &sx1, &sy1, &sx2, &sy2);
|
||||||
|
|
||||||
run_mode = param[0].data.d_int32;
|
/* Get the size of the input image. (This will/must be the same
|
||||||
|
* as the size of the output image.
|
||||||
|
*/
|
||||||
|
width = drawable->width;
|
||||||
|
height = drawable->height;
|
||||||
|
bytes = drawable->bpp;
|
||||||
|
|
||||||
if (run_mode == RUN_NONINTERACTIVE) {
|
if (gimp_drawable_has_alpha (drawable->id))
|
||||||
if (n_params != 7) {
|
{
|
||||||
status = STATUS_CALLING_ERROR;
|
color[bytes - 1] = 0xff;
|
||||||
} else {
|
}
|
||||||
my_config.width = param[4].data.d_int32;
|
|
||||||
my_config.height = param[5].data.d_int32;
|
/* initialize the pixel regions */
|
||||||
my_config.x_offset = param[6].data.d_int32;
|
gimp_pixel_rgn_init (&srcPR, drawable, 0, 0, width, height, FALSE, FALSE);
|
||||||
my_config.y_offset = param[7].data.d_int32;
|
gimp_pixel_rgn_init (&destPR, drawable, 0, 0, width, height, TRUE, TRUE);
|
||||||
|
|
||||||
|
/* First off, copy the old one to the new one. */
|
||||||
|
copybuf = malloc (width * bytes);
|
||||||
|
for (h = sy1; h < sy2; h++)
|
||||||
|
{
|
||||||
|
gimp_pixel_rgn_get_row (&srcPR, copybuf, sx1, h, width);
|
||||||
|
if ((h - my_config.y_offset) % my_config.height == 0)
|
||||||
|
{
|
||||||
|
for (w = sx1; w < sx2; w++)
|
||||||
|
{
|
||||||
|
for (b = 0; b < bytes; b++)
|
||||||
|
{
|
||||||
|
copybuf[w * bytes + b] = color[b];
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
/* Possibly retrieve data */
|
}
|
||||||
gimp_get_data("plug_in_grid", &my_config);
|
else
|
||||||
|
{
|
||||||
if (run_mode == RUN_INTERACTIVE) {
|
for (w = sx1; w < sx2; w++)
|
||||||
/* Oh boy. We get to do a dialog box, because we can't really expect the
|
{
|
||||||
* user to set us up with the right values using gdb.
|
if ((w - my_config.x_offset) % my_config.width == 0)
|
||||||
*/
|
{
|
||||||
if (!dialog()) {
|
for (b = 0; b < bytes; b++)
|
||||||
/* The dialog was closed, or something similarly evil happened. */
|
{
|
||||||
status = STATUS_EXECUTION_ERROR;
|
copybuf[w * bytes + b] = color[b];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
gimp_pixel_rgn_set_row (&destPR, copybuf, sx1, h, width);
|
||||||
|
gimp_progress_update ((double) h / (double) (sy2 - sy1));
|
||||||
|
}
|
||||||
|
free (copybuf);
|
||||||
|
|
||||||
if (my_config.width <= 0 || my_config.height <= 0) {
|
/* update the timred region */
|
||||||
status = STATUS_EXECUTION_ERROR;
|
gimp_drawable_flush (drawable);
|
||||||
}
|
gimp_drawable_merge_shadow (drawable->id, TRUE);
|
||||||
|
gimp_drawable_update (drawable->id, sx1, sy1, sx2 - sx1, sy2 - sy1);
|
||||||
if (status == STATUS_SUCCESS) {
|
|
||||||
/* Get the specified drawable */
|
|
||||||
drawable = gimp_drawable_get(param[2].data.d_drawable);
|
|
||||||
|
|
||||||
/* Make sure that the drawable is gray or RGB color */
|
|
||||||
if (gimp_drawable_color(drawable->id) || gimp_drawable_gray(drawable->id)) {
|
|
||||||
gimp_progress_init("Drawing Grid...");
|
|
||||||
gimp_tile_cache_ntiles(2 * (drawable->width / gimp_tile_width() + 1));
|
|
||||||
|
|
||||||
srand(time(NULL));
|
|
||||||
doit(drawable);
|
|
||||||
|
|
||||||
if (run_mode != RUN_NONINTERACTIVE)
|
|
||||||
gimp_displays_flush();
|
|
||||||
|
|
||||||
if (run_mode == RUN_INTERACTIVE)
|
|
||||||
gimp_set_data("plug_in_grid", &my_config, sizeof(my_config));
|
|
||||||
} else {
|
|
||||||
status = STATUS_EXECUTION_ERROR;
|
|
||||||
}
|
|
||||||
gimp_drawable_detach(drawable);
|
|
||||||
}
|
|
||||||
|
|
||||||
values[0].type = PARAM_STATUS;
|
|
||||||
values[0].data.d_status = status;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void doit(GDrawable * drawable)
|
|
||||||
{
|
|
||||||
GPixelRgn srcPR, destPR;
|
|
||||||
gint width, height;
|
|
||||||
int w, h, b;
|
|
||||||
guchar *copybuf;
|
|
||||||
guchar color[4] = {0, 0, 0, 0};
|
|
||||||
|
|
||||||
/* Get the input area. This is the bounding box of the selection in
|
|
||||||
* the image (or the entire image if there is no selection). Only
|
|
||||||
* operating on the input area is simply an optimization. It doesn't
|
|
||||||
* need to be done for correct operation. (It simply makes it go
|
|
||||||
* faster, since fewer pixels need to be operated on).
|
|
||||||
*/
|
|
||||||
gimp_drawable_mask_bounds(drawable->id, &sx1, &sy1, &sx2, &sy2);
|
|
||||||
|
|
||||||
/* Get the size of the input image. (This will/must be the same
|
|
||||||
* as the size of the output image.
|
|
||||||
*/
|
|
||||||
width = drawable->width;
|
|
||||||
height = drawable->height;
|
|
||||||
bytes = drawable->bpp;
|
|
||||||
|
|
||||||
if (gimp_drawable_has_alpha(drawable->id)) {
|
|
||||||
color[bytes - 1] = 0xff;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* initialize the pixel regions */
|
|
||||||
gimp_pixel_rgn_init(&srcPR, drawable, 0, 0, width, height, FALSE, FALSE);
|
|
||||||
gimp_pixel_rgn_init(&destPR, drawable, 0, 0, width, height, TRUE, TRUE);
|
|
||||||
|
|
||||||
/* First off, copy the old one to the new one. */
|
|
||||||
copybuf = malloc(width * bytes);
|
|
||||||
for (h = sy1; h < sy2; h++) {
|
|
||||||
gimp_pixel_rgn_get_row(&srcPR, copybuf, sx1, h, width);
|
|
||||||
if ((h - my_config.y_offset) % my_config.height == 0) {
|
|
||||||
for (w = sx1; w < sx2; w++) {
|
|
||||||
for (b = 0; b < bytes; b++) {
|
|
||||||
copybuf[w * bytes + b] = color[b];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
for (w = sx1; w < sx2; w++) {
|
|
||||||
if ((w - my_config.x_offset) % my_config.width == 0) {
|
|
||||||
for (b = 0; b < bytes; b++) {
|
|
||||||
copybuf[w * bytes + b] = color[b];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
gimp_pixel_rgn_set_row(&destPR, copybuf, sx1, h, width);
|
|
||||||
gimp_progress_update((double) h / (double) (sy2 - sy1));
|
|
||||||
}
|
|
||||||
free(copybuf);
|
|
||||||
|
|
||||||
/* update the timred region */
|
|
||||||
gimp_drawable_flush(drawable);
|
|
||||||
gimp_drawable_merge_shadow(drawable->id, TRUE);
|
|
||||||
gimp_drawable_update(drawable->id, sx1, sy1, sx2 - sx1, sy2 - sy1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/***************************************************
|
/***************************************************
|
||||||
* GUI stuff
|
* GUI stuff
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static void close_callback(GtkWidget * widget, gpointer data)
|
static void
|
||||||
|
close_callback (GtkWidget * widget, gpointer data)
|
||||||
{
|
{
|
||||||
gtk_main_quit();
|
gtk_main_quit ();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ok_callback(GtkWidget * widget, gpointer data)
|
static void
|
||||||
|
ok_callback (GtkWidget * widget, gpointer data)
|
||||||
{
|
{
|
||||||
run_flag = 1;
|
run_flag = 1;
|
||||||
gtk_widget_destroy(GTK_WIDGET(data));
|
gtk_widget_destroy (GTK_WIDGET (data));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void entry_callback(GtkWidget * widget, gpointer data)
|
static void
|
||||||
|
entry_callback (GtkWidget * widget, gpointer data)
|
||||||
{
|
{
|
||||||
if (data == &my_config.width)
|
if (data == &my_config.width)
|
||||||
my_config.width = atof(gtk_entry_get_text(GTK_ENTRY(widget)));
|
my_config.width = atof (gtk_entry_get_text (GTK_ENTRY (widget)));
|
||||||
else if (data == &my_config.height)
|
else if (data == &my_config.height)
|
||||||
my_config.height = atoi(gtk_entry_get_text(GTK_ENTRY(widget)));
|
my_config.height = atoi (gtk_entry_get_text (GTK_ENTRY (widget)));
|
||||||
else if (data == &my_config.x_offset)
|
else if (data == &my_config.x_offset)
|
||||||
my_config.x_offset = atoi(gtk_entry_get_text(GTK_ENTRY(widget)));
|
my_config.x_offset = atoi (gtk_entry_get_text (GTK_ENTRY (widget)));
|
||||||
else if (data == &my_config.y_offset)
|
else if (data == &my_config.y_offset)
|
||||||
my_config.y_offset = atoi(gtk_entry_get_text(GTK_ENTRY(widget)));
|
my_config.y_offset = atoi (gtk_entry_get_text (GTK_ENTRY (widget)));
|
||||||
}
|
}
|
||||||
|
|
||||||
static gint dialog()
|
static gint
|
||||||
|
dialog ()
|
||||||
{
|
{
|
||||||
GtkWidget *dlg;
|
GtkWidget *dlg;
|
||||||
GtkWidget *button;
|
GtkWidget *button;
|
||||||
GtkWidget *label;
|
GtkWidget *label;
|
||||||
GtkWidget *entry;
|
GtkWidget *entry;
|
||||||
GtkWidget *table;
|
GtkWidget *table;
|
||||||
gchar buffer[12];
|
gchar buffer[12];
|
||||||
gchar **argv;
|
gchar **argv;
|
||||||
gint argc;
|
gint argc;
|
||||||
|
|
||||||
argc = 1;
|
argc = 1;
|
||||||
argv = g_new(gchar *, 1);
|
argv = g_new (gchar *, 1);
|
||||||
argv[0] = g_strdup("plasma");
|
argv[0] = g_strdup ("plasma");
|
||||||
|
|
||||||
gtk_init(&argc, &argv);
|
gtk_init (&argc, &argv);
|
||||||
|
|
||||||
dlg = gtk_dialog_new();
|
dlg = gtk_dialog_new ();
|
||||||
gtk_window_set_title(GTK_WINDOW(dlg), "Grid");
|
gtk_window_set_title (GTK_WINDOW (dlg), "Grid");
|
||||||
gtk_window_position(GTK_WINDOW(dlg), GTK_WIN_POS_MOUSE);
|
gtk_window_position (GTK_WINDOW (dlg), GTK_WIN_POS_MOUSE);
|
||||||
gtk_signal_connect(GTK_OBJECT(dlg), "destroy",
|
gtk_signal_connect (GTK_OBJECT (dlg), "destroy",
|
||||||
(GtkSignalFunc) close_callback, NULL);
|
(GtkSignalFunc) close_callback, NULL);
|
||||||
|
|
||||||
/* Action area */
|
/* Action area */
|
||||||
button = gtk_button_new_with_label("OK");
|
button = gtk_button_new_with_label ("OK");
|
||||||
GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT);
|
GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
|
||||||
gtk_signal_connect(GTK_OBJECT(button), "clicked",
|
gtk_signal_connect (GTK_OBJECT (button), "clicked",
|
||||||
(GtkSignalFunc) ok_callback,
|
(GtkSignalFunc) ok_callback,
|
||||||
dlg);
|
dlg);
|
||||||
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dlg)->action_area), button, TRUE, TRUE, 0);
|
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->action_area), button, TRUE, TRUE, 0);
|
||||||
gtk_widget_grab_default(button);
|
gtk_widget_grab_default (button);
|
||||||
gtk_widget_show(button);
|
gtk_widget_show (button);
|
||||||
|
|
||||||
button = gtk_button_new_with_label("Cancel");
|
button = gtk_button_new_with_label ("Cancel");
|
||||||
GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT);
|
GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
|
||||||
gtk_signal_connect_object(GTK_OBJECT(button), "clicked",
|
gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
|
||||||
(GtkSignalFunc) gtk_widget_destroy,
|
(GtkSignalFunc) gtk_widget_destroy,
|
||||||
GTK_OBJECT(dlg));
|
GTK_OBJECT (dlg));
|
||||||
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dlg)->action_area), button, TRUE, TRUE, 0);
|
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->action_area), button, TRUE, TRUE, 0);
|
||||||
gtk_widget_show(button);
|
gtk_widget_show (button);
|
||||||
|
|
||||||
/* The main table */
|
/* The main table */
|
||||||
/* Set its size (y, x) */
|
/* Set its size (y, x) */
|
||||||
table = gtk_table_new(4, 3, FALSE);
|
table = gtk_table_new (4, 3, FALSE);
|
||||||
gtk_container_border_width(GTK_CONTAINER(table), 10);
|
gtk_container_border_width (GTK_CONTAINER (table), 10);
|
||||||
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dlg)->vbox), table, TRUE, TRUE, 0);
|
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox), table, TRUE, TRUE, 0);
|
||||||
gtk_widget_show(table);
|
gtk_widget_show (table);
|
||||||
|
|
||||||
gtk_table_set_row_spacings(GTK_TABLE(table), 10);
|
gtk_table_set_row_spacings (GTK_TABLE (table), 10);
|
||||||
gtk_table_set_col_spacings(GTK_TABLE(table), 10);
|
gtk_table_set_col_spacings (GTK_TABLE (table), 10);
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
* The X/Y labels *
|
* The X/Y labels *
|
||||||
**********************/
|
**********************/
|
||||||
label = gtk_label_new("X");
|
label = gtk_label_new ("X");
|
||||||
gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
|
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
|
||||||
gtk_table_attach(GTK_TABLE(table), label, 1, 2, 1, 2, GTK_FILL, GTK_FILL, 0,
|
gtk_table_attach (GTK_TABLE (table), label, 1, 2, 1, 2, GTK_FILL, GTK_FILL, 0,
|
||||||
0);
|
0);
|
||||||
gtk_widget_show(label);
|
gtk_widget_show (label);
|
||||||
|
|
||||||
label = gtk_label_new("Y");
|
label = gtk_label_new ("Y");
|
||||||
gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
|
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
|
||||||
gtk_table_attach(GTK_TABLE(table), label, 2, 3, 1, 2, GTK_FILL, GTK_FILL, 0,
|
gtk_table_attach (GTK_TABLE (table), label, 2, 3, 1, 2, GTK_FILL, GTK_FILL, 0,
|
||||||
0);
|
0);
|
||||||
gtk_widget_show(label);
|
gtk_widget_show (label);
|
||||||
|
|
||||||
/************************
|
/************************
|
||||||
* The width entry: *
|
* The width entry: *
|
||||||
************************/
|
************************/
|
||||||
label = gtk_label_new("Size:");
|
label = gtk_label_new ("Size:");
|
||||||
gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
|
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
|
||||||
gtk_table_attach(GTK_TABLE(table), label, 0, 1, 2, 3, GTK_FILL, GTK_FILL, 0,
|
gtk_table_attach (GTK_TABLE (table), label, 0, 1, 2, 3, GTK_FILL, GTK_FILL, 0,
|
||||||
0);
|
0);
|
||||||
gtk_widget_show(label);
|
gtk_widget_show (label);
|
||||||
|
|
||||||
entry = gtk_entry_new();
|
entry = gtk_entry_new ();
|
||||||
gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 2, 3, GTK_EXPAND | GTK_FILL,
|
gtk_table_attach (GTK_TABLE (table), entry, 1, 2, 2, 3, GTK_EXPAND | GTK_FILL,
|
||||||
GTK_EXPAND | GTK_FILL, 0, 0);
|
GTK_EXPAND | GTK_FILL, 0, 0);
|
||||||
gtk_widget_set_usize(entry, 50, 0);
|
gtk_widget_set_usize (entry, 50, 0);
|
||||||
sprintf(buffer, "%i", my_config.width);
|
sprintf (buffer, "%i", my_config.width);
|
||||||
gtk_entry_set_text(GTK_ENTRY(entry), buffer);
|
gtk_entry_set_text (GTK_ENTRY (entry), buffer);
|
||||||
gtk_signal_connect(GTK_OBJECT(entry), "changed",
|
gtk_signal_connect (GTK_OBJECT (entry), "changed",
|
||||||
(GtkSignalFunc) entry_callback, &my_config.width);
|
(GtkSignalFunc) entry_callback, &my_config.width);
|
||||||
gtk_widget_show(entry);
|
gtk_widget_show (entry);
|
||||||
|
|
||||||
/************************
|
/************************
|
||||||
* The height entry: *
|
* The height entry: *
|
||||||
************************/
|
************************/
|
||||||
entry = gtk_entry_new();
|
entry = gtk_entry_new ();
|
||||||
gtk_table_attach(GTK_TABLE(table), entry, 2, 3, 2, 3, GTK_EXPAND | GTK_FILL,
|
gtk_table_attach (GTK_TABLE (table), entry, 2, 3, 2, 3, GTK_EXPAND | GTK_FILL,
|
||||||
GTK_EXPAND | GTK_FILL, 0, 0);
|
GTK_EXPAND | GTK_FILL, 0, 0);
|
||||||
gtk_widget_set_usize(entry, 50, 0);
|
gtk_widget_set_usize (entry, 50, 0);
|
||||||
sprintf(buffer, "%i", my_config.height);
|
sprintf (buffer, "%i", my_config.height);
|
||||||
gtk_entry_set_text(GTK_ENTRY(entry), buffer);
|
gtk_entry_set_text (GTK_ENTRY (entry), buffer);
|
||||||
gtk_signal_connect(GTK_OBJECT(entry), "changed",
|
gtk_signal_connect (GTK_OBJECT (entry), "changed",
|
||||||
(GtkSignalFunc) entry_callback, &my_config.height);
|
(GtkSignalFunc) entry_callback, &my_config.height);
|
||||||
gtk_widget_show(entry);
|
gtk_widget_show (entry);
|
||||||
|
|
||||||
gtk_widget_show(dlg);
|
gtk_widget_show (dlg);
|
||||||
|
|
||||||
/************************
|
/************************
|
||||||
* The x_offset entry: *
|
* The x_offset entry: *
|
||||||
************************/
|
************************/
|
||||||
label = gtk_label_new("Offset:");
|
label = gtk_label_new ("Offset:");
|
||||||
gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
|
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
|
||||||
gtk_table_attach(GTK_TABLE(table), label, 0, 1, 3, 4, GTK_FILL, GTK_FILL, 0,
|
gtk_table_attach (GTK_TABLE (table), label, 0, 1, 3, 4, GTK_FILL, GTK_FILL, 0,
|
||||||
0);
|
0);
|
||||||
gtk_widget_show(label);
|
gtk_widget_show (label);
|
||||||
|
|
||||||
entry = gtk_entry_new();
|
entry = gtk_entry_new ();
|
||||||
gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 3, 4, GTK_EXPAND | GTK_FILL,
|
gtk_table_attach (GTK_TABLE (table), entry, 1, 2, 3, 4, GTK_EXPAND | GTK_FILL,
|
||||||
GTK_EXPAND | GTK_FILL, 0, 0);
|
GTK_EXPAND | GTK_FILL, 0, 0);
|
||||||
gtk_widget_set_usize(entry, 50, 0);
|
gtk_widget_set_usize (entry, 50, 0);
|
||||||
sprintf(buffer, "%i", my_config.x_offset);
|
sprintf (buffer, "%i", my_config.x_offset);
|
||||||
gtk_entry_set_text(GTK_ENTRY(entry), buffer);
|
gtk_entry_set_text (GTK_ENTRY (entry), buffer);
|
||||||
gtk_signal_connect(GTK_OBJECT(entry), "changed",
|
gtk_signal_connect (GTK_OBJECT (entry), "changed",
|
||||||
(GtkSignalFunc) entry_callback, &my_config.x_offset);
|
(GtkSignalFunc) entry_callback, &my_config.x_offset);
|
||||||
gtk_widget_show(entry);
|
gtk_widget_show (entry);
|
||||||
|
|
||||||
/************************
|
/************************
|
||||||
* The y_offset entry: *
|
* The y_offset entry: *
|
||||||
************************/
|
************************/
|
||||||
entry = gtk_entry_new();
|
entry = gtk_entry_new ();
|
||||||
gtk_table_attach(GTK_TABLE(table), entry, 2, 3, 3, 4, GTK_EXPAND | GTK_FILL,
|
gtk_table_attach (GTK_TABLE (table), entry, 2, 3, 3, 4, GTK_EXPAND | GTK_FILL,
|
||||||
GTK_EXPAND | GTK_FILL, 0, 0);
|
GTK_EXPAND | GTK_FILL, 0, 0);
|
||||||
gtk_widget_set_usize(entry, 50, 0);
|
gtk_widget_set_usize (entry, 50, 0);
|
||||||
sprintf(buffer, "%i", my_config.y_offset);
|
sprintf (buffer, "%i", my_config.y_offset);
|
||||||
gtk_entry_set_text(GTK_ENTRY(entry), buffer);
|
gtk_entry_set_text (GTK_ENTRY (entry), buffer);
|
||||||
gtk_signal_connect(GTK_OBJECT(entry), "changed",
|
gtk_signal_connect (GTK_OBJECT (entry), "changed",
|
||||||
(GtkSignalFunc) entry_callback, &my_config.y_offset);
|
(GtkSignalFunc) entry_callback, &my_config.y_offset);
|
||||||
gtk_widget_show(entry);
|
gtk_widget_show (entry);
|
||||||
|
|
||||||
gtk_widget_show(dlg);
|
gtk_widget_show (dlg);
|
||||||
|
|
||||||
gtk_main();
|
gtk_main ();
|
||||||
gdk_flush();
|
gdk_flush ();
|
||||||
|
|
||||||
return run_flag;
|
return run_flag;
|
||||||
}
|
}
|
||||||
|
@ -108,10 +108,11 @@ run (char *name,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case RUN_NONINTERACTIVE:
|
case RUN_NONINTERACTIVE:
|
||||||
if (nparams != 1)
|
if (nparams != 4)
|
||||||
status = STATUS_CALLING_ERROR;
|
status = STATUS_CALLING_ERROR;
|
||||||
if (status == STATUS_SUCCESS)
|
if (status == STATUS_SUCCESS)
|
||||||
DeinterlaceValue = param[3].data.d_int32;
|
DeinterlaceValue = param[3].data.d_int32;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RUN_WITH_LAST_VALS:
|
case RUN_WITH_LAST_VALS:
|
||||||
|
@ -150,8 +150,20 @@ void run(char *name, int nparams, GParam *param, int *nreturn_vals, GParam **ret
|
|||||||
gimp_palette_get_foreground(&xargs.fromred, &xargs.fromgreen, &xargs.fromblue);
|
gimp_palette_get_foreground(&xargs.fromred, &xargs.fromgreen, &xargs.fromblue);
|
||||||
break;
|
break;
|
||||||
case RUN_NONINTERACTIVE:
|
case RUN_NONINTERACTIVE:
|
||||||
status = STATUS_EXECUTION_ERROR;
|
if(nparams != 10)
|
||||||
return;
|
status = STATUS_EXECUTION_ERROR;
|
||||||
|
if (status == STATUS_SUCCESS)
|
||||||
|
{
|
||||||
|
xargs.fromred = param[3].data.d_int8;
|
||||||
|
xargs.fromgreen = param[4].data.d_int8;
|
||||||
|
xargs.fromblue = param[5].data.d_int8;
|
||||||
|
xargs.tored = param[6].data.d_int8;
|
||||||
|
xargs.togreen = param[7].data.d_int8;
|
||||||
|
xargs.toblue = param[8].data.d_int8;
|
||||||
|
xargs.threshold = param[9].data.d_int32;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -17,363 +17,395 @@
|
|||||||
#include "gtk/gtk.h"
|
#include "gtk/gtk.h"
|
||||||
|
|
||||||
/* Declare local functions. */
|
/* Declare local functions. */
|
||||||
static void query(void);
|
static void query (void);
|
||||||
static void run(char *name,
|
static void run (char *name,
|
||||||
int nparams,
|
int nparams,
|
||||||
GParam * param,
|
GParam * param,
|
||||||
int *nreturn_vals,
|
int *nreturn_vals,
|
||||||
GParam ** return_vals);
|
GParam ** return_vals);
|
||||||
static gint dialog();
|
static gint dialog ();
|
||||||
|
|
||||||
static void doit(GDrawable * drawable);
|
static void doit (GDrawable * drawable);
|
||||||
|
|
||||||
GPlugInInfo PLUG_IN_INFO =
|
GPlugInInfo PLUG_IN_INFO =
|
||||||
{
|
{
|
||||||
NULL, /* init_proc */
|
NULL, /* init_proc */
|
||||||
NULL, /* quit_proc */
|
NULL, /* quit_proc */
|
||||||
query, /* query_proc */
|
query, /* query_proc */
|
||||||
run, /* run_proc */
|
run, /* run_proc */
|
||||||
};
|
};
|
||||||
|
|
||||||
gint bytes;
|
gint bytes;
|
||||||
gint sx1, sy1, sx2, sy2;
|
gint sx1, sy1, sx2, sy2;
|
||||||
int run_flag = 0;
|
int run_flag = 0;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct
|
||||||
gint width, height;
|
{
|
||||||
gint x_offset, y_offset;
|
gint width, height;
|
||||||
} config;
|
gint x_offset, y_offset;
|
||||||
|
}
|
||||||
|
config;
|
||||||
|
|
||||||
config my_config =
|
config my_config =
|
||||||
{
|
{
|
||||||
16, 16, /* width, height */
|
16, 16, /* width, height */
|
||||||
0, 0, /* x_offset, y_offset */
|
0, 0, /* x_offset, y_offset */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
MAIN()
|
MAIN ()
|
||||||
|
|
||||||
static void query()
|
static void query ()
|
||||||
{
|
{
|
||||||
static GParamDef args[] =
|
static GParamDef args[] =
|
||||||
|
{
|
||||||
|
{PARAM_INT32, "run_mode", "Interactive, non-interactive"},
|
||||||
|
{PARAM_IMAGE, "image", "Input image (unused)"},
|
||||||
|
{PARAM_DRAWABLE, "drawable", "Input drawable"},
|
||||||
|
{PARAM_INT32, "width", "Width"},
|
||||||
|
{PARAM_INT32, "height", "Height"},
|
||||||
|
{PARAM_INT32, "x_offset", "X Offset"},
|
||||||
|
{PARAM_INT32, "y_offset", "Y Offset"},
|
||||||
|
};
|
||||||
|
static GParamDef *return_vals = NULL;
|
||||||
|
static int nargs = sizeof (args) / sizeof (args[0]);
|
||||||
|
static int nreturn_vals = 0;
|
||||||
|
|
||||||
|
gimp_install_procedure ("plug_in_grid",
|
||||||
|
"Draws a grid.",
|
||||||
|
"",
|
||||||
|
"Tim Newsome",
|
||||||
|
"Tim Newsome",
|
||||||
|
"1997",
|
||||||
|
"<Image>/Filters/Render/Grid",
|
||||||
|
"RGB*, GRAY*",
|
||||||
|
PROC_PLUG_IN,
|
||||||
|
nargs, nreturn_vals,
|
||||||
|
args, return_vals);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
run (char *name, int n_params, GParam * param, int *nreturn_vals,
|
||||||
|
GParam ** return_vals)
|
||||||
|
{
|
||||||
|
static GParam values[1];
|
||||||
|
GDrawable *drawable;
|
||||||
|
GRunModeType run_mode;
|
||||||
|
GStatusType status = STATUS_SUCCESS;
|
||||||
|
|
||||||
|
*nreturn_vals = 1;
|
||||||
|
*return_vals = values;
|
||||||
|
|
||||||
|
run_mode = param[0].data.d_int32;
|
||||||
|
|
||||||
|
if (run_mode == RUN_NONINTERACTIVE)
|
||||||
|
{
|
||||||
|
if (n_params != 7)
|
||||||
{
|
{
|
||||||
{PARAM_INT32, "run_mode", "Interactive, non-interactive"},
|
status = STATUS_CALLING_ERROR;
|
||||||
{PARAM_IMAGE, "image", "Input image (unused)"},
|
}
|
||||||
{PARAM_DRAWABLE, "drawable", "Input drawable"},
|
if( status == STATUS_SUCCESS)
|
||||||
{PARAM_INT32, "width", "Width"},
|
{
|
||||||
{PARAM_INT32, "height", "Height"},
|
my_config.width = param[3].data.d_int32;
|
||||||
{PARAM_INT32, "x_offset", "X Offset"},
|
my_config.height = param[4].data.d_int32;
|
||||||
{PARAM_INT32, "y_offset", "Y Offset"},
|
my_config.x_offset = param[5].data.d_int32;
|
||||||
};
|
my_config.y_offset = param[6].data.d_int32;
|
||||||
static GParamDef *return_vals = NULL;
|
}
|
||||||
static int nargs = sizeof(args) / sizeof(args[0]);
|
}
|
||||||
static int nreturn_vals = 0;
|
else
|
||||||
|
{
|
||||||
|
/* Possibly retrieve data */
|
||||||
|
gimp_get_data ("plug_in_grid", &my_config);
|
||||||
|
|
||||||
gimp_install_procedure("plug_in_grid",
|
if (run_mode == RUN_INTERACTIVE)
|
||||||
"Draws a grid.",
|
{
|
||||||
"",
|
/* Oh boy. We get to do a dialog box, because we can't really expect the
|
||||||
"Tim Newsome",
|
* user to set us up with the right values using gdb.
|
||||||
"Tim Newsome",
|
*/
|
||||||
"1997",
|
if (!dialog ())
|
||||||
"<Image>/Filters/Render/Grid",
|
{
|
||||||
"RGB, GRAY",
|
/* The dialog was closed, or something similarly evil happened. */
|
||||||
PROC_PLUG_IN,
|
status = STATUS_EXECUTION_ERROR;
|
||||||
nargs, nreturn_vals,
|
}
|
||||||
args, return_vals);
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (my_config.width <= 0 || my_config.height <= 0)
|
||||||
|
{
|
||||||
|
status = STATUS_EXECUTION_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (status == STATUS_SUCCESS)
|
||||||
|
{
|
||||||
|
/* Get the specified drawable */
|
||||||
|
drawable = gimp_drawable_get (param[2].data.d_drawable);
|
||||||
|
|
||||||
|
/* Make sure that the drawable is gray or RGB color */
|
||||||
|
if (gimp_drawable_color (drawable->id) || gimp_drawable_gray (drawable->id))
|
||||||
|
{
|
||||||
|
gimp_progress_init ("Drawing Grid...");
|
||||||
|
gimp_tile_cache_ntiles (2 * (drawable->width / gimp_tile_width () + 1));
|
||||||
|
|
||||||
|
srand (time (NULL));
|
||||||
|
doit (drawable);
|
||||||
|
|
||||||
|
if (run_mode != RUN_NONINTERACTIVE)
|
||||||
|
gimp_displays_flush ();
|
||||||
|
|
||||||
|
if (run_mode == RUN_INTERACTIVE)
|
||||||
|
gimp_set_data ("plug_in_grid", &my_config, sizeof (my_config));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
status = STATUS_EXECUTION_ERROR;
|
||||||
|
}
|
||||||
|
gimp_drawable_detach (drawable);
|
||||||
|
}
|
||||||
|
|
||||||
|
values[0].type = PARAM_STATUS;
|
||||||
|
values[0].data.d_status = status;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void run(char *name, int n_params, GParam * param, int *nreturn_vals,
|
static void
|
||||||
GParam ** return_vals)
|
doit (GDrawable * drawable)
|
||||||
{
|
{
|
||||||
static GParam values[1];
|
GPixelRgn srcPR, destPR;
|
||||||
GDrawable *drawable;
|
gint width, height;
|
||||||
GRunModeType run_mode;
|
int w, h, b;
|
||||||
GStatusType status = STATUS_SUCCESS;
|
guchar *copybuf;
|
||||||
|
guchar color[4] =
|
||||||
|
{0, 0, 0, 0};
|
||||||
|
|
||||||
*nreturn_vals = 1;
|
/* Get the input area. This is the bounding box of the selection in
|
||||||
*return_vals = values;
|
* the image (or the entire image if there is no selection). Only
|
||||||
|
* operating on the input area is simply an optimization. It doesn't
|
||||||
|
* need to be done for correct operation. (It simply makes it go
|
||||||
|
* faster, since fewer pixels need to be operated on).
|
||||||
|
*/
|
||||||
|
gimp_drawable_mask_bounds (drawable->id, &sx1, &sy1, &sx2, &sy2);
|
||||||
|
|
||||||
run_mode = param[0].data.d_int32;
|
/* Get the size of the input image. (This will/must be the same
|
||||||
|
* as the size of the output image.
|
||||||
|
*/
|
||||||
|
width = drawable->width;
|
||||||
|
height = drawable->height;
|
||||||
|
bytes = drawable->bpp;
|
||||||
|
|
||||||
if (run_mode == RUN_NONINTERACTIVE) {
|
if (gimp_drawable_has_alpha (drawable->id))
|
||||||
if (n_params != 7) {
|
{
|
||||||
status = STATUS_CALLING_ERROR;
|
color[bytes - 1] = 0xff;
|
||||||
} else {
|
}
|
||||||
my_config.width = param[4].data.d_int32;
|
|
||||||
my_config.height = param[5].data.d_int32;
|
/* initialize the pixel regions */
|
||||||
my_config.x_offset = param[6].data.d_int32;
|
gimp_pixel_rgn_init (&srcPR, drawable, 0, 0, width, height, FALSE, FALSE);
|
||||||
my_config.y_offset = param[7].data.d_int32;
|
gimp_pixel_rgn_init (&destPR, drawable, 0, 0, width, height, TRUE, TRUE);
|
||||||
|
|
||||||
|
/* First off, copy the old one to the new one. */
|
||||||
|
copybuf = malloc (width * bytes);
|
||||||
|
for (h = sy1; h < sy2; h++)
|
||||||
|
{
|
||||||
|
gimp_pixel_rgn_get_row (&srcPR, copybuf, sx1, h, width);
|
||||||
|
if ((h - my_config.y_offset) % my_config.height == 0)
|
||||||
|
{
|
||||||
|
for (w = sx1; w < sx2; w++)
|
||||||
|
{
|
||||||
|
for (b = 0; b < bytes; b++)
|
||||||
|
{
|
||||||
|
copybuf[w * bytes + b] = color[b];
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
/* Possibly retrieve data */
|
}
|
||||||
gimp_get_data("plug_in_grid", &my_config);
|
else
|
||||||
|
{
|
||||||
if (run_mode == RUN_INTERACTIVE) {
|
for (w = sx1; w < sx2; w++)
|
||||||
/* Oh boy. We get to do a dialog box, because we can't really expect the
|
{
|
||||||
* user to set us up with the right values using gdb.
|
if ((w - my_config.x_offset) % my_config.width == 0)
|
||||||
*/
|
{
|
||||||
if (!dialog()) {
|
for (b = 0; b < bytes; b++)
|
||||||
/* The dialog was closed, or something similarly evil happened. */
|
{
|
||||||
status = STATUS_EXECUTION_ERROR;
|
copybuf[w * bytes + b] = color[b];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
gimp_pixel_rgn_set_row (&destPR, copybuf, sx1, h, width);
|
||||||
|
gimp_progress_update ((double) h / (double) (sy2 - sy1));
|
||||||
|
}
|
||||||
|
free (copybuf);
|
||||||
|
|
||||||
if (my_config.width <= 0 || my_config.height <= 0) {
|
/* update the timred region */
|
||||||
status = STATUS_EXECUTION_ERROR;
|
gimp_drawable_flush (drawable);
|
||||||
}
|
gimp_drawable_merge_shadow (drawable->id, TRUE);
|
||||||
|
gimp_drawable_update (drawable->id, sx1, sy1, sx2 - sx1, sy2 - sy1);
|
||||||
if (status == STATUS_SUCCESS) {
|
|
||||||
/* Get the specified drawable */
|
|
||||||
drawable = gimp_drawable_get(param[2].data.d_drawable);
|
|
||||||
|
|
||||||
/* Make sure that the drawable is gray or RGB color */
|
|
||||||
if (gimp_drawable_color(drawable->id) || gimp_drawable_gray(drawable->id)) {
|
|
||||||
gimp_progress_init("Drawing Grid...");
|
|
||||||
gimp_tile_cache_ntiles(2 * (drawable->width / gimp_tile_width() + 1));
|
|
||||||
|
|
||||||
srand(time(NULL));
|
|
||||||
doit(drawable);
|
|
||||||
|
|
||||||
if (run_mode != RUN_NONINTERACTIVE)
|
|
||||||
gimp_displays_flush();
|
|
||||||
|
|
||||||
if (run_mode == RUN_INTERACTIVE)
|
|
||||||
gimp_set_data("plug_in_grid", &my_config, sizeof(my_config));
|
|
||||||
} else {
|
|
||||||
status = STATUS_EXECUTION_ERROR;
|
|
||||||
}
|
|
||||||
gimp_drawable_detach(drawable);
|
|
||||||
}
|
|
||||||
|
|
||||||
values[0].type = PARAM_STATUS;
|
|
||||||
values[0].data.d_status = status;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void doit(GDrawable * drawable)
|
|
||||||
{
|
|
||||||
GPixelRgn srcPR, destPR;
|
|
||||||
gint width, height;
|
|
||||||
int w, h, b;
|
|
||||||
guchar *copybuf;
|
|
||||||
guchar color[4] = {0, 0, 0, 0};
|
|
||||||
|
|
||||||
/* Get the input area. This is the bounding box of the selection in
|
|
||||||
* the image (or the entire image if there is no selection). Only
|
|
||||||
* operating on the input area is simply an optimization. It doesn't
|
|
||||||
* need to be done for correct operation. (It simply makes it go
|
|
||||||
* faster, since fewer pixels need to be operated on).
|
|
||||||
*/
|
|
||||||
gimp_drawable_mask_bounds(drawable->id, &sx1, &sy1, &sx2, &sy2);
|
|
||||||
|
|
||||||
/* Get the size of the input image. (This will/must be the same
|
|
||||||
* as the size of the output image.
|
|
||||||
*/
|
|
||||||
width = drawable->width;
|
|
||||||
height = drawable->height;
|
|
||||||
bytes = drawable->bpp;
|
|
||||||
|
|
||||||
if (gimp_drawable_has_alpha(drawable->id)) {
|
|
||||||
color[bytes - 1] = 0xff;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* initialize the pixel regions */
|
|
||||||
gimp_pixel_rgn_init(&srcPR, drawable, 0, 0, width, height, FALSE, FALSE);
|
|
||||||
gimp_pixel_rgn_init(&destPR, drawable, 0, 0, width, height, TRUE, TRUE);
|
|
||||||
|
|
||||||
/* First off, copy the old one to the new one. */
|
|
||||||
copybuf = malloc(width * bytes);
|
|
||||||
for (h = sy1; h < sy2; h++) {
|
|
||||||
gimp_pixel_rgn_get_row(&srcPR, copybuf, sx1, h, width);
|
|
||||||
if ((h - my_config.y_offset) % my_config.height == 0) {
|
|
||||||
for (w = sx1; w < sx2; w++) {
|
|
||||||
for (b = 0; b < bytes; b++) {
|
|
||||||
copybuf[w * bytes + b] = color[b];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
for (w = sx1; w < sx2; w++) {
|
|
||||||
if ((w - my_config.x_offset) % my_config.width == 0) {
|
|
||||||
for (b = 0; b < bytes; b++) {
|
|
||||||
copybuf[w * bytes + b] = color[b];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
gimp_pixel_rgn_set_row(&destPR, copybuf, sx1, h, width);
|
|
||||||
gimp_progress_update((double) h / (double) (sy2 - sy1));
|
|
||||||
}
|
|
||||||
free(copybuf);
|
|
||||||
|
|
||||||
/* update the timred region */
|
|
||||||
gimp_drawable_flush(drawable);
|
|
||||||
gimp_drawable_merge_shadow(drawable->id, TRUE);
|
|
||||||
gimp_drawable_update(drawable->id, sx1, sy1, sx2 - sx1, sy2 - sy1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/***************************************************
|
/***************************************************
|
||||||
* GUI stuff
|
* GUI stuff
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static void close_callback(GtkWidget * widget, gpointer data)
|
static void
|
||||||
|
close_callback (GtkWidget * widget, gpointer data)
|
||||||
{
|
{
|
||||||
gtk_main_quit();
|
gtk_main_quit ();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ok_callback(GtkWidget * widget, gpointer data)
|
static void
|
||||||
|
ok_callback (GtkWidget * widget, gpointer data)
|
||||||
{
|
{
|
||||||
run_flag = 1;
|
run_flag = 1;
|
||||||
gtk_widget_destroy(GTK_WIDGET(data));
|
gtk_widget_destroy (GTK_WIDGET (data));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void entry_callback(GtkWidget * widget, gpointer data)
|
static void
|
||||||
|
entry_callback (GtkWidget * widget, gpointer data)
|
||||||
{
|
{
|
||||||
if (data == &my_config.width)
|
if (data == &my_config.width)
|
||||||
my_config.width = atof(gtk_entry_get_text(GTK_ENTRY(widget)));
|
my_config.width = atof (gtk_entry_get_text (GTK_ENTRY (widget)));
|
||||||
else if (data == &my_config.height)
|
else if (data == &my_config.height)
|
||||||
my_config.height = atoi(gtk_entry_get_text(GTK_ENTRY(widget)));
|
my_config.height = atoi (gtk_entry_get_text (GTK_ENTRY (widget)));
|
||||||
else if (data == &my_config.x_offset)
|
else if (data == &my_config.x_offset)
|
||||||
my_config.x_offset = atoi(gtk_entry_get_text(GTK_ENTRY(widget)));
|
my_config.x_offset = atoi (gtk_entry_get_text (GTK_ENTRY (widget)));
|
||||||
else if (data == &my_config.y_offset)
|
else if (data == &my_config.y_offset)
|
||||||
my_config.y_offset = atoi(gtk_entry_get_text(GTK_ENTRY(widget)));
|
my_config.y_offset = atoi (gtk_entry_get_text (GTK_ENTRY (widget)));
|
||||||
}
|
}
|
||||||
|
|
||||||
static gint dialog()
|
static gint
|
||||||
|
dialog ()
|
||||||
{
|
{
|
||||||
GtkWidget *dlg;
|
GtkWidget *dlg;
|
||||||
GtkWidget *button;
|
GtkWidget *button;
|
||||||
GtkWidget *label;
|
GtkWidget *label;
|
||||||
GtkWidget *entry;
|
GtkWidget *entry;
|
||||||
GtkWidget *table;
|
GtkWidget *table;
|
||||||
gchar buffer[12];
|
gchar buffer[12];
|
||||||
gchar **argv;
|
gchar **argv;
|
||||||
gint argc;
|
gint argc;
|
||||||
|
|
||||||
argc = 1;
|
argc = 1;
|
||||||
argv = g_new(gchar *, 1);
|
argv = g_new (gchar *, 1);
|
||||||
argv[0] = g_strdup("plasma");
|
argv[0] = g_strdup ("plasma");
|
||||||
|
|
||||||
gtk_init(&argc, &argv);
|
gtk_init (&argc, &argv);
|
||||||
|
|
||||||
dlg = gtk_dialog_new();
|
dlg = gtk_dialog_new ();
|
||||||
gtk_window_set_title(GTK_WINDOW(dlg), "Grid");
|
gtk_window_set_title (GTK_WINDOW (dlg), "Grid");
|
||||||
gtk_window_position(GTK_WINDOW(dlg), GTK_WIN_POS_MOUSE);
|
gtk_window_position (GTK_WINDOW (dlg), GTK_WIN_POS_MOUSE);
|
||||||
gtk_signal_connect(GTK_OBJECT(dlg), "destroy",
|
gtk_signal_connect (GTK_OBJECT (dlg), "destroy",
|
||||||
(GtkSignalFunc) close_callback, NULL);
|
(GtkSignalFunc) close_callback, NULL);
|
||||||
|
|
||||||
/* Action area */
|
/* Action area */
|
||||||
button = gtk_button_new_with_label("OK");
|
button = gtk_button_new_with_label ("OK");
|
||||||
GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT);
|
GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
|
||||||
gtk_signal_connect(GTK_OBJECT(button), "clicked",
|
gtk_signal_connect (GTK_OBJECT (button), "clicked",
|
||||||
(GtkSignalFunc) ok_callback,
|
(GtkSignalFunc) ok_callback,
|
||||||
dlg);
|
dlg);
|
||||||
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dlg)->action_area), button, TRUE, TRUE, 0);
|
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->action_area), button, TRUE, TRUE, 0);
|
||||||
gtk_widget_grab_default(button);
|
gtk_widget_grab_default (button);
|
||||||
gtk_widget_show(button);
|
gtk_widget_show (button);
|
||||||
|
|
||||||
button = gtk_button_new_with_label("Cancel");
|
button = gtk_button_new_with_label ("Cancel");
|
||||||
GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT);
|
GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
|
||||||
gtk_signal_connect_object(GTK_OBJECT(button), "clicked",
|
gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
|
||||||
(GtkSignalFunc) gtk_widget_destroy,
|
(GtkSignalFunc) gtk_widget_destroy,
|
||||||
GTK_OBJECT(dlg));
|
GTK_OBJECT (dlg));
|
||||||
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dlg)->action_area), button, TRUE, TRUE, 0);
|
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->action_area), button, TRUE, TRUE, 0);
|
||||||
gtk_widget_show(button);
|
gtk_widget_show (button);
|
||||||
|
|
||||||
/* The main table */
|
/* The main table */
|
||||||
/* Set its size (y, x) */
|
/* Set its size (y, x) */
|
||||||
table = gtk_table_new(4, 3, FALSE);
|
table = gtk_table_new (4, 3, FALSE);
|
||||||
gtk_container_border_width(GTK_CONTAINER(table), 10);
|
gtk_container_border_width (GTK_CONTAINER (table), 10);
|
||||||
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dlg)->vbox), table, TRUE, TRUE, 0);
|
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox), table, TRUE, TRUE, 0);
|
||||||
gtk_widget_show(table);
|
gtk_widget_show (table);
|
||||||
|
|
||||||
gtk_table_set_row_spacings(GTK_TABLE(table), 10);
|
gtk_table_set_row_spacings (GTK_TABLE (table), 10);
|
||||||
gtk_table_set_col_spacings(GTK_TABLE(table), 10);
|
gtk_table_set_col_spacings (GTK_TABLE (table), 10);
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
* The X/Y labels *
|
* The X/Y labels *
|
||||||
**********************/
|
**********************/
|
||||||
label = gtk_label_new("X");
|
label = gtk_label_new ("X");
|
||||||
gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
|
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
|
||||||
gtk_table_attach(GTK_TABLE(table), label, 1, 2, 1, 2, GTK_FILL, GTK_FILL, 0,
|
gtk_table_attach (GTK_TABLE (table), label, 1, 2, 1, 2, GTK_FILL, GTK_FILL, 0,
|
||||||
0);
|
0);
|
||||||
gtk_widget_show(label);
|
gtk_widget_show (label);
|
||||||
|
|
||||||
label = gtk_label_new("Y");
|
label = gtk_label_new ("Y");
|
||||||
gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
|
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
|
||||||
gtk_table_attach(GTK_TABLE(table), label, 2, 3, 1, 2, GTK_FILL, GTK_FILL, 0,
|
gtk_table_attach (GTK_TABLE (table), label, 2, 3, 1, 2, GTK_FILL, GTK_FILL, 0,
|
||||||
0);
|
0);
|
||||||
gtk_widget_show(label);
|
gtk_widget_show (label);
|
||||||
|
|
||||||
/************************
|
/************************
|
||||||
* The width entry: *
|
* The width entry: *
|
||||||
************************/
|
************************/
|
||||||
label = gtk_label_new("Size:");
|
label = gtk_label_new ("Size:");
|
||||||
gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
|
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
|
||||||
gtk_table_attach(GTK_TABLE(table), label, 0, 1, 2, 3, GTK_FILL, GTK_FILL, 0,
|
gtk_table_attach (GTK_TABLE (table), label, 0, 1, 2, 3, GTK_FILL, GTK_FILL, 0,
|
||||||
0);
|
0);
|
||||||
gtk_widget_show(label);
|
gtk_widget_show (label);
|
||||||
|
|
||||||
entry = gtk_entry_new();
|
entry = gtk_entry_new ();
|
||||||
gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 2, 3, GTK_EXPAND | GTK_FILL,
|
gtk_table_attach (GTK_TABLE (table), entry, 1, 2, 2, 3, GTK_EXPAND | GTK_FILL,
|
||||||
GTK_EXPAND | GTK_FILL, 0, 0);
|
GTK_EXPAND | GTK_FILL, 0, 0);
|
||||||
gtk_widget_set_usize(entry, 50, 0);
|
gtk_widget_set_usize (entry, 50, 0);
|
||||||
sprintf(buffer, "%i", my_config.width);
|
sprintf (buffer, "%i", my_config.width);
|
||||||
gtk_entry_set_text(GTK_ENTRY(entry), buffer);
|
gtk_entry_set_text (GTK_ENTRY (entry), buffer);
|
||||||
gtk_signal_connect(GTK_OBJECT(entry), "changed",
|
gtk_signal_connect (GTK_OBJECT (entry), "changed",
|
||||||
(GtkSignalFunc) entry_callback, &my_config.width);
|
(GtkSignalFunc) entry_callback, &my_config.width);
|
||||||
gtk_widget_show(entry);
|
gtk_widget_show (entry);
|
||||||
|
|
||||||
/************************
|
/************************
|
||||||
* The height entry: *
|
* The height entry: *
|
||||||
************************/
|
************************/
|
||||||
entry = gtk_entry_new();
|
entry = gtk_entry_new ();
|
||||||
gtk_table_attach(GTK_TABLE(table), entry, 2, 3, 2, 3, GTK_EXPAND | GTK_FILL,
|
gtk_table_attach (GTK_TABLE (table), entry, 2, 3, 2, 3, GTK_EXPAND | GTK_FILL,
|
||||||
GTK_EXPAND | GTK_FILL, 0, 0);
|
GTK_EXPAND | GTK_FILL, 0, 0);
|
||||||
gtk_widget_set_usize(entry, 50, 0);
|
gtk_widget_set_usize (entry, 50, 0);
|
||||||
sprintf(buffer, "%i", my_config.height);
|
sprintf (buffer, "%i", my_config.height);
|
||||||
gtk_entry_set_text(GTK_ENTRY(entry), buffer);
|
gtk_entry_set_text (GTK_ENTRY (entry), buffer);
|
||||||
gtk_signal_connect(GTK_OBJECT(entry), "changed",
|
gtk_signal_connect (GTK_OBJECT (entry), "changed",
|
||||||
(GtkSignalFunc) entry_callback, &my_config.height);
|
(GtkSignalFunc) entry_callback, &my_config.height);
|
||||||
gtk_widget_show(entry);
|
gtk_widget_show (entry);
|
||||||
|
|
||||||
gtk_widget_show(dlg);
|
gtk_widget_show (dlg);
|
||||||
|
|
||||||
/************************
|
/************************
|
||||||
* The x_offset entry: *
|
* The x_offset entry: *
|
||||||
************************/
|
************************/
|
||||||
label = gtk_label_new("Offset:");
|
label = gtk_label_new ("Offset:");
|
||||||
gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
|
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
|
||||||
gtk_table_attach(GTK_TABLE(table), label, 0, 1, 3, 4, GTK_FILL, GTK_FILL, 0,
|
gtk_table_attach (GTK_TABLE (table), label, 0, 1, 3, 4, GTK_FILL, GTK_FILL, 0,
|
||||||
0);
|
0);
|
||||||
gtk_widget_show(label);
|
gtk_widget_show (label);
|
||||||
|
|
||||||
entry = gtk_entry_new();
|
entry = gtk_entry_new ();
|
||||||
gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 3, 4, GTK_EXPAND | GTK_FILL,
|
gtk_table_attach (GTK_TABLE (table), entry, 1, 2, 3, 4, GTK_EXPAND | GTK_FILL,
|
||||||
GTK_EXPAND | GTK_FILL, 0, 0);
|
GTK_EXPAND | GTK_FILL, 0, 0);
|
||||||
gtk_widget_set_usize(entry, 50, 0);
|
gtk_widget_set_usize (entry, 50, 0);
|
||||||
sprintf(buffer, "%i", my_config.x_offset);
|
sprintf (buffer, "%i", my_config.x_offset);
|
||||||
gtk_entry_set_text(GTK_ENTRY(entry), buffer);
|
gtk_entry_set_text (GTK_ENTRY (entry), buffer);
|
||||||
gtk_signal_connect(GTK_OBJECT(entry), "changed",
|
gtk_signal_connect (GTK_OBJECT (entry), "changed",
|
||||||
(GtkSignalFunc) entry_callback, &my_config.x_offset);
|
(GtkSignalFunc) entry_callback, &my_config.x_offset);
|
||||||
gtk_widget_show(entry);
|
gtk_widget_show (entry);
|
||||||
|
|
||||||
/************************
|
/************************
|
||||||
* The y_offset entry: *
|
* The y_offset entry: *
|
||||||
************************/
|
************************/
|
||||||
entry = gtk_entry_new();
|
entry = gtk_entry_new ();
|
||||||
gtk_table_attach(GTK_TABLE(table), entry, 2, 3, 3, 4, GTK_EXPAND | GTK_FILL,
|
gtk_table_attach (GTK_TABLE (table), entry, 2, 3, 3, 4, GTK_EXPAND | GTK_FILL,
|
||||||
GTK_EXPAND | GTK_FILL, 0, 0);
|
GTK_EXPAND | GTK_FILL, 0, 0);
|
||||||
gtk_widget_set_usize(entry, 50, 0);
|
gtk_widget_set_usize (entry, 50, 0);
|
||||||
sprintf(buffer, "%i", my_config.y_offset);
|
sprintf (buffer, "%i", my_config.y_offset);
|
||||||
gtk_entry_set_text(GTK_ENTRY(entry), buffer);
|
gtk_entry_set_text (GTK_ENTRY (entry), buffer);
|
||||||
gtk_signal_connect(GTK_OBJECT(entry), "changed",
|
gtk_signal_connect (GTK_OBJECT (entry), "changed",
|
||||||
(GtkSignalFunc) entry_callback, &my_config.y_offset);
|
(GtkSignalFunc) entry_callback, &my_config.y_offset);
|
||||||
gtk_widget_show(entry);
|
gtk_widget_show (entry);
|
||||||
|
|
||||||
gtk_widget_show(dlg);
|
gtk_widget_show (dlg);
|
||||||
|
|
||||||
gtk_main();
|
gtk_main ();
|
||||||
gdk_flush();
|
gdk_flush ();
|
||||||
|
|
||||||
return run_flag;
|
return run_flag;
|
||||||
}
|
}
|
||||||
|
@ -148,7 +148,7 @@ static void run(char *name, int n_params, GParam * param, int *nreturn_vals,
|
|||||||
run_mode = param[0].data.d_int32;
|
run_mode = param[0].data.d_int32;
|
||||||
|
|
||||||
if (run_mode == RUN_NONINTERACTIVE) {
|
if (run_mode == RUN_NONINTERACTIVE) {
|
||||||
if (n_params != 8) {
|
if (n_params != 7) {
|
||||||
status = STATUS_CALLING_ERROR;
|
status = STATUS_CALLING_ERROR;
|
||||||
} else {
|
} else {
|
||||||
params.density = param[3].data.d_float;
|
params.density = param[3].data.d_float;
|
||||||
|
Reference in New Issue
Block a user