mirror of https://github.com/GNOME/gimp.git
use gimp_ui_init(). Minor cleanups like reordering includes consistently
2000-05-01 Michael Natterer <mitch@gimp.org> * plug-ins/common/[h-p]*.c: use gimp_ui_init(). Minor cleanups like reordering includes consistently and removing trailing commas from enums and param defs.
This commit is contained in:
parent
6ba24da2a8
commit
7ea5afb49c
|
@ -1,3 +1,9 @@
|
|||
2000-05-01 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* plug-ins/common/[h-p]*.c: use gimp_ui_init(). Minor cleanups like
|
||||
reordering includes consistently and removing trailing commas from
|
||||
enums and param defs.
|
||||
|
||||
2000-05-01 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* libgimp/gimpsignal.[ch]
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
|
||||
#include "libgimp/stdplugins-intl.h"
|
||||
|
||||
|
||||
/* Declare some local functions.
|
||||
*/
|
||||
static void query (void);
|
||||
|
@ -37,7 +38,6 @@ static void run (gchar *name,
|
|||
GParam *param,
|
||||
gint *nreturn_vals,
|
||||
GParam **return_vals);
|
||||
static void init_gtk (void);
|
||||
static gint save_image (gchar *filename,
|
||||
gint32 image_ID,
|
||||
gint32 drawable_ID);
|
||||
|
@ -63,7 +63,7 @@ query (void)
|
|||
{ PARAM_IMAGE, "image", "Input image" },
|
||||
{ PARAM_DRAWABLE, "drawable", "Drawable to save" },
|
||||
{ PARAM_STRING, "filename", "The name of the file to save the image in" },
|
||||
{ PARAM_STRING, "raw_filename", "The name of the file to save the image in" },
|
||||
{ PARAM_STRING, "raw_filename", "The name of the file to save the image in" }
|
||||
};
|
||||
static gint nsave_args = sizeof (save_args) / sizeof (save_args[0]);
|
||||
|
||||
|
@ -116,7 +116,7 @@ run (gchar *name,
|
|||
case RUN_INTERACTIVE:
|
||||
case RUN_WITH_LAST_VALS:
|
||||
INIT_I18N_UI();
|
||||
init_gtk ();
|
||||
gimp_ui_init ("header", FALSE);
|
||||
export = gimp_export_image (&image_ID, &drawable_ID, "Header",
|
||||
(CAN_HANDLE_RGB |
|
||||
CAN_HANDLE_INDEXED));
|
||||
|
@ -146,20 +146,6 @@ run (gchar *name,
|
|||
values[0].data.d_status = status;
|
||||
}
|
||||
|
||||
static void
|
||||
init_gtk (void)
|
||||
{
|
||||
gchar **argv;
|
||||
gint argc;
|
||||
|
||||
argc = 1;
|
||||
argv = g_new (gchar *, 1);
|
||||
argv[0] = g_strdup ("header");
|
||||
|
||||
gtk_init (&argc, &argv);
|
||||
gtk_rc_parse (gimp_gtkrc ());
|
||||
}
|
||||
|
||||
static int
|
||||
save_image (gchar *filename,
|
||||
gint32 image_ID,
|
||||
|
|
|
@ -77,6 +77,7 @@
|
|||
|
||||
#include "libgimp/stdplugins-intl.h"
|
||||
|
||||
|
||||
struct Grgb
|
||||
{
|
||||
guint8 red;
|
||||
|
@ -151,11 +152,11 @@ struct
|
|||
#define SCALE 8192 /* scale factor: do floats with int math */
|
||||
#define MAXPIX 255 /* white value */
|
||||
|
||||
gint tab[3][3][MAXPIX+1]; /* multiply lookup table */
|
||||
gdouble chroma_lim; /* chroma limit */
|
||||
gdouble compos_lim; /* composite amplitude limit */
|
||||
glong ichroma_lim2; /* chroma limit squared (scaled integer) */
|
||||
gint icompos_lim; /* composite amplitude limit (scaled integer) */
|
||||
static gint tab[3][3][MAXPIX+1]; /* multiply lookup table */
|
||||
static gdouble chroma_lim; /* chroma limit */
|
||||
static gdouble compos_lim; /* composite amplitude limit */
|
||||
static glong ichroma_lim2; /* chroma limit squared (scaled integer) */
|
||||
static gint icompos_lim; /* composite amplitude limit (scaled integer) */
|
||||
|
||||
static void query (void);
|
||||
static void run (gchar *name,
|
||||
|
@ -197,10 +198,10 @@ static void build_tab (int m);
|
|||
|
||||
GPlugInInfo PLUG_IN_INFO =
|
||||
{
|
||||
NULL, /* init */
|
||||
NULL, /* quit */
|
||||
query, /* query */
|
||||
run, /* run */
|
||||
NULL, /* init_proc */
|
||||
NULL, /* quit_proc */
|
||||
query, /* query_proc */
|
||||
run, /* run_proc */
|
||||
};
|
||||
|
||||
MAIN ()
|
||||
|
@ -215,26 +216,26 @@ query (void)
|
|||
{ PARAM_DRAWABLE, "drawable", "The Drawable" },
|
||||
{ PARAM_INT32, "mode", "Mode -- NTSC/PAL" },
|
||||
{ PARAM_INT32, "action", "The action to perform" },
|
||||
{ PARAM_INT32, "new_layerp", "Create a new layer iff True" },
|
||||
{ PARAM_INT32, "new_layerp", "Create a new layer iff True" }
|
||||
};
|
||||
static gint nargs = sizeof (args) / sizeof (args[0]);
|
||||
|
||||
static GParamDef *rets = NULL;
|
||||
static int nrets = 0;
|
||||
|
||||
INIT_I18N();
|
||||
|
||||
gimp_install_procedure ("plug_in_hot",
|
||||
"Look for hot NTSC or PAL pixels ",
|
||||
"hot scans an image for pixels that will give unsave values of chrominance or composite signale amplitude when encoded into an NTSC or PAL signal. Three actions can be performed on these ``hot'' pixels. (0) reduce luminance, (1) reduce saturation, or (2) Blacken.",
|
||||
"hot scans an image for pixels that will give unsave "
|
||||
"values of chrominance or composite signale "
|
||||
"amplitude when encoded into an NTSC or PAL signal. "
|
||||
"Three actions can be performed on these ``hot'' "
|
||||
"pixels. (0) reduce luminance, (1) reduce "
|
||||
"saturation, or (2) Blacken.",
|
||||
"Eric L. Hernes, Alan Wm Paeth",
|
||||
"Eric L. Hernes",
|
||||
"1997",
|
||||
N_("<Image>/Filters/Colors/Hot..."),
|
||||
"RGB",
|
||||
PROC_PLUG_IN,
|
||||
nargs, nrets,
|
||||
args, rets);
|
||||
nargs, 0,
|
||||
args, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -330,7 +331,7 @@ pluginCore (struct piArgs *argp)
|
|||
gdouble pr, pg, pb;
|
||||
gdouble py;
|
||||
|
||||
drw = gimp_drawable_get(argp->drawable);
|
||||
drw = gimp_drawable_get (argp->drawable);
|
||||
|
||||
width = drw->width;
|
||||
height = drw->height;
|
||||
|
@ -577,15 +578,8 @@ pluginCoreIA (struct piArgs *argp)
|
|||
GtkWidget *vbox;
|
||||
GtkWidget *toggle;
|
||||
GtkWidget *frame;
|
||||
gchar **argv;
|
||||
gint argc;
|
||||
|
||||
argc = 1;
|
||||
argv = g_new (gchar *, 1);
|
||||
argv[0] = g_strdup ("hot");
|
||||
|
||||
gtk_init (&argc, &argv);
|
||||
gtk_rc_parse (gimp_gtkrc());
|
||||
gimp_ui_init ("hot", FALSE);
|
||||
|
||||
dlg = gimp_dialog_new (_("Hot"), "hot",
|
||||
gimp_plugin_help_func, "filters/hot.html",
|
||||
|
|
|
@ -66,6 +66,7 @@
|
|||
|
||||
#include "libgimp/stdplugins-intl.h"
|
||||
|
||||
|
||||
/* Declare local data types
|
||||
*/
|
||||
|
||||
|
@ -88,7 +89,6 @@ static gint save_image (gchar *filename,
|
|||
gint32 image_ID,
|
||||
gint32 drawable_ID);
|
||||
|
||||
static void init_gtk (void);
|
||||
/*
|
||||
static gint save_dialog (void);
|
||||
static void save_ok_callback (GtkWidget *widget,
|
||||
|
@ -128,11 +128,11 @@ query (void)
|
|||
{
|
||||
{ PARAM_INT32, "run_mode", "Interactive, non-interactive" },
|
||||
{ PARAM_STRING, "filename", "The name of the file to load" },
|
||||
{ PARAM_STRING, "raw_filename", "The name of the file to load" },
|
||||
{ PARAM_STRING, "raw_filename", "The name of the file to load" }
|
||||
};
|
||||
static GParamDef load_return_vals[] =
|
||||
{
|
||||
{ PARAM_IMAGE, "image", "Output image" },
|
||||
{ PARAM_IMAGE, "image", "Output image" }
|
||||
};
|
||||
static gint nload_args = sizeof (load_args) / sizeof (load_args[0]);
|
||||
static gint nload_return_vals = (sizeof (load_return_vals) /
|
||||
|
@ -148,8 +148,6 @@ query (void)
|
|||
};
|
||||
static gint nsave_args = sizeof (save_args) / sizeof (save_args[0]);
|
||||
|
||||
INIT_I18N();
|
||||
|
||||
gimp_install_procedure ("file_hrz_load",
|
||||
"loads files of the hrz file format",
|
||||
"FIXME: write help for hrz_load",
|
||||
|
@ -231,7 +229,7 @@ run (gchar *name,
|
|||
case RUN_INTERACTIVE:
|
||||
case RUN_WITH_LAST_VALS:
|
||||
INIT_I18N_UI();
|
||||
init_gtk ();
|
||||
gimp_ui_init ("hrz", FALSE);
|
||||
export = gimp_export_image (&image_ID, &drawable_ID, "HRZ",
|
||||
(CAN_HANDLE_RGB |
|
||||
CAN_HANDLE_GRAY));
|
||||
|
@ -515,20 +513,6 @@ save_image (gchar *filename,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
init_gtk (void)
|
||||
{
|
||||
gchar **argv;
|
||||
gint argc;
|
||||
|
||||
argc = 1;
|
||||
argv = g_new (gchar *, 1);
|
||||
argv[0] = g_strdup ("hrz");
|
||||
|
||||
gtk_init (&argc, &argv);
|
||||
gtk_rc_parse (gimp_gtkrc ());
|
||||
}
|
||||
|
||||
/*********** Save dialog ************/
|
||||
/*
|
||||
static gint
|
||||
|
|
|
@ -33,21 +33,21 @@
|
|||
|
||||
#include "libgimp/stdplugins-intl.h"
|
||||
|
||||
|
||||
#define PLUG_IN_NAME "plug_in_illusion"
|
||||
#define PLUG_IN_VERSION "v0.7 (Dec. 25 1997)"
|
||||
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
static void query (void);
|
||||
static void run (gchar *name,
|
||||
gint nparam,
|
||||
GParam *param,
|
||||
gint *nreturn_vals,
|
||||
GParam **return_vals);
|
||||
static void query (void);
|
||||
static void run (gchar *name,
|
||||
gint nparam,
|
||||
GParam *param,
|
||||
gint *nreturn_vals,
|
||||
GParam **return_vals);
|
||||
|
||||
static void filter (GDrawable *drawable);
|
||||
static int dialog (void);
|
||||
static void filter (GDrawable *drawable);
|
||||
static gboolean dialog (void);
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
|
@ -93,7 +93,6 @@ MAIN ()
|
|||
static void
|
||||
query (void)
|
||||
{
|
||||
static int nargs = 4;
|
||||
static GParamDef args[] =
|
||||
{
|
||||
{ PARAM_INT32, "run_mode", "interactive / non-interactive" },
|
||||
|
@ -101,10 +100,7 @@ query (void)
|
|||
{ PARAM_DRAWABLE, "drawable", "input drawable" },
|
||||
{ PARAM_INT32, "division", "the number of divisions" }
|
||||
};
|
||||
static int nreturn_vals = 0;
|
||||
static GParamDef *return_vals = NULL;
|
||||
|
||||
INIT_I18N();
|
||||
static gint nargs = sizeof (args) / sizeof (args[0]);;
|
||||
|
||||
gimp_install_procedure (PLUG_IN_NAME,
|
||||
"produce illusion",
|
||||
|
@ -115,10 +111,8 @@ query (void)
|
|||
N_("<Image>/Filters/Map/Illusion..."),
|
||||
"RGB*, GRAY*",
|
||||
PROC_PLUG_IN,
|
||||
nargs,
|
||||
nreturn_vals,
|
||||
args,
|
||||
return_vals);
|
||||
nargs, 0,
|
||||
args, NULL);
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
|
@ -279,7 +273,7 @@ filter (GDrawable *drawable)
|
|||
|
||||
/******************************************************************************/
|
||||
|
||||
static int dialog_status = FALSE;
|
||||
static gboolean dialog_status = FALSE;
|
||||
|
||||
static void
|
||||
dialog_ok_handler (GtkWidget *widget,
|
||||
|
@ -292,7 +286,7 @@ dialog_ok_handler (GtkWidget *widget,
|
|||
|
||||
/******************************************************************************/
|
||||
|
||||
static int
|
||||
static gboolean
|
||||
dialog (void)
|
||||
{
|
||||
GtkWidget *window;
|
||||
|
@ -301,15 +295,8 @@ dialog (void)
|
|||
GtkWidget *spinbutton;
|
||||
GtkObject *adj;
|
||||
|
||||
gint argc = 1;
|
||||
gchar **argv = g_new (gchar *, 1);
|
||||
gimp_ui_init ("illusion", FALSE);
|
||||
|
||||
argv[0] = g_strdup ("illusion");
|
||||
|
||||
gtk_init (&argc, &argv);
|
||||
gtk_rc_parse (gimp_gtkrc ());
|
||||
|
||||
/* dialog window */
|
||||
window = gimp_dialog_new (_("Illusion"), "illusion",
|
||||
gimp_plugin_help_func, "filters/illusion.html",
|
||||
GTK_WIN_POS_MOUSE,
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
(thanks to Arthur Hagen for reporting it)
|
||||
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
@ -50,6 +51,7 @@
|
|||
|
||||
#include "libgimp/stdplugins-intl.h"
|
||||
|
||||
|
||||
#define MAX_PREVIEW_WIDTH 256
|
||||
#define MAX_PREVIEW_HEIGHT 256
|
||||
#define MAX_DEFORM_AREA_RADIUS 100
|
||||
|
@ -96,7 +98,7 @@ static void run (gchar *name,
|
|||
static void iwarp (void);
|
||||
static void iwarp_frame (void);
|
||||
|
||||
static gint iwarp_dialog (void);
|
||||
static gboolean iwarp_dialog (void);
|
||||
static void iwarp_animate_dialog (GtkWidget *dlg,
|
||||
GtkWidget *notebook);
|
||||
|
||||
|
@ -240,7 +242,7 @@ query (void)
|
|||
{
|
||||
{ PARAM_INT32, "run_mode", "Interactive, non-interactive" },
|
||||
{ PARAM_IMAGE, "image", "Input image (unused)" },
|
||||
{ PARAM_DRAWABLE, "drawable", "Input drawable" },
|
||||
{ PARAM_DRAWABLE, "drawable", "Input drawable" }
|
||||
};
|
||||
static gint nargs = sizeof (args) / sizeof (args[0]);
|
||||
|
||||
|
@ -1117,7 +1119,7 @@ iwarp_settings_dialog (GtkWidget *dlg,
|
|||
gtk_label_new (_("Settings")));
|
||||
}
|
||||
|
||||
static gint
|
||||
static gboolean
|
||||
iwarp_dialog (void)
|
||||
{
|
||||
GtkWidget *dlg;
|
||||
|
@ -1126,24 +1128,8 @@ iwarp_dialog (void)
|
|||
GtkWidget *abox;
|
||||
GtkWidget *pframe;
|
||||
GtkWidget *notebook;
|
||||
guchar *color_cube;
|
||||
gint argc;
|
||||
gchar **argv;
|
||||
|
||||
argc = 1;
|
||||
argv = g_new (gchar *, 1);
|
||||
argv[0] = g_strdup ("iwarp");
|
||||
|
||||
gtk_init (&argc, &argv);
|
||||
gtk_rc_parse (gimp_gtkrc ());
|
||||
|
||||
gtk_preview_set_gamma (gimp_gamma ());
|
||||
gtk_preview_set_install_cmap (gimp_install_cmap ());
|
||||
color_cube = gimp_color_cube ();
|
||||
gtk_preview_set_color_cube (color_cube[0], color_cube[1],
|
||||
color_cube[2], color_cube[3]);
|
||||
gtk_widget_set_default_visual (gtk_preview_get_visual ());
|
||||
gtk_widget_set_default_colormap (gtk_preview_get_cmap ());
|
||||
gimp_ui_init ("iwarp", TRUE);
|
||||
|
||||
iwarp_init ();
|
||||
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
|
||||
#include "libgimp/stdplugins-intl.h"
|
||||
|
||||
|
||||
typedef enum {BEZIER_1, BEZIER_2} style_t;
|
||||
typedef enum {LEFT, RIGHT, UP, DOWN} bump_t;
|
||||
|
||||
|
@ -138,7 +139,7 @@ static void check_config(gint width, gint height);
|
|||
|
||||
|
||||
|
||||
#define PLUG_IN_NAME "jigsaw"
|
||||
#define PLUG_IN_NAME "jigsaw"
|
||||
#define PLUG_IN_STORAGE "jigsaw-storage"
|
||||
|
||||
#define XFACTOR2 0.0833
|
||||
|
@ -312,20 +313,16 @@ query (void)
|
|||
{
|
||||
static GParamDef args[] =
|
||||
{
|
||||
{ PARAM_INT32, "run_mode", "Interactive, Non-interactive, Last-Vals"},
|
||||
{ PARAM_IMAGE, "image", "Input image"},
|
||||
{ PARAM_DRAWABLE, "drawable", "Input drawable"},
|
||||
{ PARAM_INT32, "x", "Number of tiles across > 0"},
|
||||
{ PARAM_INT32, "y", "Number of tiles down > 0"},
|
||||
{ PARAM_INT32, "style", "The style/shape of the jigsaw puzzle, 0 or 1"},
|
||||
{ PARAM_INT32, "blend_lines", "Number of lines for shading bevels >= 0"},
|
||||
{ PARAM_FLOAT, "blend_amount", "The power of the light highlights 0 =< 5"}
|
||||
{ PARAM_INT32, "run_mode", "Interactive, Non-interactive, Last-Vals" },
|
||||
{ PARAM_IMAGE, "image", "Input image" },
|
||||
{ PARAM_DRAWABLE, "drawable", "Input drawable" },
|
||||
{ PARAM_INT32, "x", "Number of tiles across > 0" },
|
||||
{ PARAM_INT32, "y", "Number of tiles down > 0" },
|
||||
{ PARAM_INT32, "style", "The style/shape of the jigsaw puzzle, 0 or 1" },
|
||||
{ PARAM_INT32, "blend_lines", "Number of lines for shading bevels >= 0" },
|
||||
{ PARAM_FLOAT, "blend_amount", "The power of the light highlights 0 =< 5" }
|
||||
};
|
||||
static GParamDef *return_vals = NULL;
|
||||
static gint nargs = sizeof(args) / sizeof(args[0]);
|
||||
static gint nreturn_vals = 0;
|
||||
|
||||
INIT_I18N();
|
||||
static gint nargs = sizeof (args) / sizeof (args[0]);
|
||||
|
||||
gimp_install_procedure ("plug_in_jigsaw",
|
||||
"Renders a jigsaw puzzle look",
|
||||
|
@ -336,8 +333,8 @@ query (void)
|
|||
N_("<Image>/Filters/Render/Pattern/Jigsaw..."),
|
||||
"RGB*",
|
||||
PROC_PLUG_IN,
|
||||
nargs, nreturn_vals,
|
||||
args, return_vals);
|
||||
nargs, 0,
|
||||
args, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -2296,18 +2293,9 @@ dialog_box (void)
|
|||
GtkWidget *hbox;
|
||||
GtkWidget *table;
|
||||
GtkObject *adj;
|
||||
gchar **argv;
|
||||
gint argc;
|
||||
|
||||
argc = 1;
|
||||
argv = g_new (gchar *, 1);
|
||||
argv[0] = g_strdup (PLUG_IN_NAME);
|
||||
gimp_ui_init ("jigsaw", FALSE);
|
||||
|
||||
gtk_init (&argc, &argv);
|
||||
gtk_rc_parse (gimp_gtkrc ());
|
||||
|
||||
/* Create the dialog box */
|
||||
|
||||
dlg = gimp_dialog_new (_("Jigsaw"), "jigsaw",
|
||||
gimp_plugin_help_func, "filters/jigsaw.html",
|
||||
GTK_WIN_POS_MOUSE,
|
||||
|
|
|
@ -126,6 +126,7 @@
|
|||
* pretty obscure Win32 compilation issues.
|
||||
*/
|
||||
#include <setjmp.h>
|
||||
#include <signal.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
@ -142,7 +143,6 @@
|
|||
|
||||
#include "libgimp/stdplugins-intl.h"
|
||||
|
||||
#include <signal.h>
|
||||
|
||||
#define SCALE_WIDTH 125
|
||||
|
||||
|
@ -229,7 +229,6 @@ static void add_menu_item (GtkWidget *menu,
|
|||
guint op_no,
|
||||
GtkSignalFunc callback);
|
||||
|
||||
static void init_gtk (void);
|
||||
static gint save_dialog (void);
|
||||
|
||||
static void save_close_callback (GtkWidget *widget,
|
||||
|
@ -289,11 +288,11 @@ query (void)
|
|||
{
|
||||
{ PARAM_INT32, "run_mode", "Interactive, non-interactive" },
|
||||
{ PARAM_STRING, "filename", "The name of the file to load" },
|
||||
{ PARAM_STRING, "raw_filename", "The name of the file to load" },
|
||||
{ PARAM_STRING, "raw_filename", "The name of the file to load" }
|
||||
};
|
||||
static GParamDef load_return_vals[] =
|
||||
{
|
||||
{ PARAM_IMAGE, "image", "Output image" },
|
||||
{ PARAM_IMAGE, "image", "Output image" }
|
||||
};
|
||||
static gint nload_args = sizeof (load_args) / sizeof (load_args[0]);
|
||||
static gint nload_return_vals = (sizeof (load_return_vals) /
|
||||
|
@ -318,8 +317,6 @@ query (void)
|
|||
};
|
||||
static gint nsave_args = sizeof (save_args) / sizeof (save_args[0]);
|
||||
|
||||
INIT_I18N();
|
||||
|
||||
gimp_install_procedure ("file_jpeg_load",
|
||||
"loads files in the JPEG file format",
|
||||
"loads files in the JPEG file format",
|
||||
|
@ -409,7 +406,7 @@ run (gchar *name,
|
|||
{
|
||||
case RUN_INTERACTIVE:
|
||||
case RUN_WITH_LAST_VALS:
|
||||
init_gtk ();
|
||||
gimp_ui_init ("jpeg", FALSE);
|
||||
export = gimp_export_image (&image_ID, &drawable_ID, "JPEG",
|
||||
(CAN_HANDLE_RGB |
|
||||
CAN_HANDLE_GRAY));
|
||||
|
@ -1554,20 +1551,6 @@ add_menu_item (GtkWidget *menu,
|
|||
gtk_widget_show (menu_item);
|
||||
}
|
||||
|
||||
static void
|
||||
init_gtk (void)
|
||||
{
|
||||
gchar **argv;
|
||||
gint argc;
|
||||
|
||||
argc = 1;
|
||||
argv = g_new (gchar *, 1);
|
||||
argv[0] = g_strdup ("jpeg");
|
||||
|
||||
gtk_init (&argc, &argv);
|
||||
gtk_rc_parse (gimp_gtkrc ());
|
||||
}
|
||||
|
||||
static gint
|
||||
save_dialog (void)
|
||||
{
|
||||
|
|
|
@ -28,74 +28,78 @@
|
|||
/* update 03/10/97
|
||||
#ifdef MAX and MIN */
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include "config.h"
|
||||
#include "libgimp/gimp.h"
|
||||
|
||||
#include <libgimp/gimp.h>
|
||||
|
||||
#include "libgimp/stdplugins-intl.h"
|
||||
|
||||
|
||||
/* 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 laplace (GDrawable *drawable);
|
||||
static void laplace_prepare_row (GPixelRgn *pixel_rgn,
|
||||
guchar *data,
|
||||
int x,
|
||||
int y,
|
||||
int w);
|
||||
guchar *data,
|
||||
gint x,
|
||||
gint y,
|
||||
gint w);
|
||||
|
||||
|
||||
GPlugInInfo PLUG_IN_INFO =
|
||||
{
|
||||
NULL, /* init_proc */
|
||||
NULL, /* quit_proc */
|
||||
query, /* query_proc */
|
||||
run, /* run_proc */
|
||||
NULL, /* init_proc */
|
||||
NULL, /* quit_proc */
|
||||
query, /* query_proc */
|
||||
run, /* run_proc */
|
||||
};
|
||||
|
||||
|
||||
MAIN ()
|
||||
|
||||
static void
|
||||
query ()
|
||||
query (void)
|
||||
{
|
||||
static GParamDef args[] =
|
||||
{
|
||||
{ PARAM_INT32, "run_mode", "Interactive, non-interactive" },
|
||||
{ PARAM_IMAGE, "image", "Input image (unused)" },
|
||||
{ PARAM_DRAWABLE, "drawable", "Input drawable" },
|
||||
{ PARAM_DRAWABLE, "drawable", "Input drawable" }
|
||||
};
|
||||
static GParamDef *return_vals = NULL;
|
||||
static int nargs = sizeof (args) / sizeof (args[0]);
|
||||
static int nreturn_vals = 0;
|
||||
|
||||
INIT_I18N();
|
||||
static gint nargs = sizeof (args) / sizeof (args[0]);
|
||||
|
||||
gimp_install_procedure ("plug_in_laplace",
|
||||
"Edge Detection with Laplace Operation",
|
||||
"This plugin creates one-pixel wide edges from the image, with the value proportional to the gradient. It uses the Laplace operator (a 3x3 kernel with -8 in the middle). The image has to be laplacered to get useful results, a gauss_iir with 1.5 - 5.0 depending on the noise in the image is best.",
|
||||
"This plugin creates one-pixel wide edges from the "
|
||||
"image, with the value proportional to the gradient. "
|
||||
"It uses the Laplace operator (a 3x3 kernel with -8 "
|
||||
"in the middle). The image has to be laplacered to "
|
||||
"get useful results, a gauss_iir with 1.5 - 5.0 "
|
||||
"depending on the noise in the image is best.",
|
||||
"Thorsten Schnier",
|
||||
"Thorsten Schnier",
|
||||
"1997",
|
||||
N_("<Image>/Filters/Edge-Detect/Laplace"),
|
||||
"RGB*, GRAY*",
|
||||
PROC_PLUG_IN,
|
||||
nargs, nreturn_vals,
|
||||
args, return_vals);
|
||||
nargs, 0,
|
||||
args, NULL);
|
||||
}
|
||||
|
||||
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[1];
|
||||
|
@ -111,7 +115,8 @@ run (char *name,
|
|||
drawable = gimp_drawable_get (param[2].data.d_drawable);
|
||||
|
||||
/* Make sure that the drawable is gray or RGB color */
|
||||
if (gimp_drawable_is_rgb (drawable->id) || gimp_drawable_is_gray (drawable->id))
|
||||
if (gimp_drawable_is_rgb (drawable->id) ||
|
||||
gimp_drawable_is_gray (drawable->id))
|
||||
{
|
||||
gimp_tile_cache_ntiles (2 * (drawable->width / gimp_tile_width () + 1));
|
||||
laplace (drawable);
|
||||
|
@ -136,12 +141,12 @@ run (char *name,
|
|||
|
||||
static void
|
||||
laplace_prepare_row (GPixelRgn *pixel_rgn,
|
||||
guchar *data,
|
||||
int x,
|
||||
int y,
|
||||
int w)
|
||||
guchar *data,
|
||||
gint x,
|
||||
gint y,
|
||||
gint w)
|
||||
{
|
||||
int b;
|
||||
gint b;
|
||||
|
||||
if (y == 0)
|
||||
gimp_pixel_rgn_get_row (pixel_rgn, data, x, (y + 1), w);
|
||||
|
@ -160,29 +165,28 @@ laplace_prepare_row (GPixelRgn *pixel_rgn,
|
|||
|
||||
#define SIGN(a) (((a) > 0) ? 1 : -1)
|
||||
#define RMS(a,b) (sqrt (pow ((a),2) + pow ((b), 2)))
|
||||
#ifndef MAX
|
||||
#define MAX(a,b) (((a) > (b)) ? (a) : (b))
|
||||
#endif
|
||||
#ifndef MIN
|
||||
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
|
||||
#endif
|
||||
#define BLACK_REGION(val) ((val) > 128)
|
||||
#define WHITE_REGION(val) ((val) <= 128)
|
||||
|
||||
|
||||
static void minmax (gint x1, gint x2, gint x3, gint x4, gint x5,
|
||||
gint* min_result, gint* max_result)
|
||||
static void
|
||||
minmax (gint x1,
|
||||
gint x2,
|
||||
gint x3,
|
||||
gint x4,
|
||||
gint x5,
|
||||
gint *min_result,
|
||||
gint *max_result)
|
||||
{
|
||||
gint min1,min2,max1,max2;
|
||||
if (x1>x2) {max1=x1; min1=x2;} else {max1=x2; min1=x1;}
|
||||
if (x3>x4) {max2=x3; min2=x4;} else {max2=x4; min2=x3;}
|
||||
if (min1<min2)
|
||||
gint min1, min2, max1, max2;
|
||||
|
||||
if (x1 > x2) { max1=x1; min1=x2; } else { max1=x2; min1=x1; }
|
||||
if (x3 > x4) { max2=x3; min2=x4; } else { max2=x4; min2=x3; }
|
||||
if (min1 < min2)
|
||||
*min_result = MIN (min1, x5);
|
||||
else *min_result = MIN (min2, x5);
|
||||
if (max1>max2)
|
||||
if (max1 > max2)
|
||||
*max_result = MAX (max1, x5);
|
||||
else *max_result = MAX (max2, x5);
|
||||
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -48,6 +48,7 @@
|
|||
|
||||
#include "libgimp/stdplugins-intl.h"
|
||||
|
||||
|
||||
/************/
|
||||
/* Typedefs */
|
||||
/************/
|
||||
|
@ -114,7 +115,7 @@ static gint border_x1, border_y1, border_x2, border_y2;
|
|||
static glong maxcounter;
|
||||
static guchar *scalarfield;
|
||||
|
||||
GtkWidget *dialog;
|
||||
static GtkWidget *dialog;
|
||||
|
||||
/************************/
|
||||
/* Convenience routines */
|
||||
|
@ -1206,14 +1207,9 @@ query (void)
|
|||
{
|
||||
{ PARAM_INT32, "run_mode", "Interactive" },
|
||||
{ PARAM_IMAGE, "image", "Input image" },
|
||||
{ PARAM_DRAWABLE, "drawable", "Input drawable" },
|
||||
{ PARAM_DRAWABLE, "drawable", "Input drawable" }
|
||||
};
|
||||
|
||||
static GParamDef *return_vals = NULL;
|
||||
static gint nargs = sizeof (args) / sizeof (args[0]);
|
||||
static gint nreturn_vals = 0;
|
||||
|
||||
INIT_I18N();
|
||||
|
||||
gimp_install_procedure ("plug_in_lic",
|
||||
"Creates a Van Gogh effect (Line Integral Convolution)",
|
||||
|
@ -1224,8 +1220,8 @@ query (void)
|
|||
N_("<Image>/Filters/Map/Van Gogh (LIC)..."),
|
||||
"RGB",
|
||||
PROC_PLUG_IN,
|
||||
nargs, nreturn_vals,
|
||||
args, return_vals);
|
||||
nargs, 0,
|
||||
args, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1317,17 +1313,7 @@ GPlugInInfo PLUG_IN_INFO =
|
|||
static void
|
||||
lic_interactive (GDrawable *drawable)
|
||||
{
|
||||
gchar **argv;
|
||||
gint argc;
|
||||
|
||||
argc = 1;
|
||||
argv = g_new (gchar *, 1);
|
||||
argv[0] = g_strdup ("lic");
|
||||
|
||||
gtk_init (&argc, &argv);
|
||||
gtk_rc_parse(gimp_gtkrc());
|
||||
|
||||
gdk_set_use_xshm (gimp_use_xshm());
|
||||
gimp_ui_init ("lic", TRUE);
|
||||
|
||||
/* Create application window */
|
||||
/* ========================= */
|
||||
|
@ -1354,4 +1340,4 @@ lic_noninteractive (GDrawable *drawable)
|
|||
}
|
||||
*/
|
||||
|
||||
MAIN()
|
||||
MAIN ()
|
||||
|
|
|
@ -126,6 +126,7 @@
|
|||
|
||||
#include "libgimp/stdplugins-intl.h"
|
||||
|
||||
|
||||
static void query (void);
|
||||
static void run (gchar *name,
|
||||
gint nparams,
|
||||
|
@ -206,13 +207,9 @@ query (void)
|
|||
{ PARAM_STRING, "from", "The email address for the From: field" },
|
||||
{ PARAM_STRING, "subject", "The subject" },
|
||||
{ PARAM_STRING, "comment", "The Comment" },
|
||||
{ PARAM_INT32, "encapsulation", "Uuencode, MIME" },
|
||||
{ PARAM_INT32, "encapsulation", "Uuencode, MIME" }
|
||||
};
|
||||
static int nargs = sizeof (args) / sizeof (args[0]);
|
||||
static GParamDef *return_vals = NULL;
|
||||
static int nreturn_vals = 0;
|
||||
|
||||
INIT_I18N();
|
||||
static gint nargs = sizeof (args) / sizeof (args[0]);
|
||||
|
||||
gimp_install_procedure ("plug_in_mail_image",
|
||||
"pipe files to uuencode then mail them",
|
||||
|
@ -223,8 +220,8 @@ query (void)
|
|||
N_("<Image>/File/Mail Image..."),
|
||||
"RGB*, GRAY*, INDEXED*",
|
||||
PROC_PLUG_IN,
|
||||
nargs, nreturn_vals,
|
||||
args, return_vals);
|
||||
nargs, 0,
|
||||
args, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -470,18 +467,11 @@ save_dialog (void)
|
|||
GtkWidget *text;
|
||||
GtkWidget *vscrollbar;
|
||||
|
||||
gint argc;
|
||||
gchar **argv;
|
||||
gchar buffer[BUFFER_SIZE];
|
||||
gint nreturn_vals;
|
||||
GParam *return_vals;
|
||||
|
||||
argc = 1;
|
||||
argv = g_new (gchar *, 1);
|
||||
argv[0] = g_strdup ("mail");
|
||||
|
||||
gtk_init (&argc, &argv);
|
||||
gtk_rc_parse (gimp_gtkrc ());
|
||||
gimp_ui_init ("mail", FALSE);
|
||||
|
||||
/* check gimprc for a preffered "From:" address */
|
||||
return_vals = gimp_run_procedure ("gimp_gimprc_query",
|
||||
|
|
|
@ -37,27 +37,23 @@ static char ident[] = "@(#) GIMP mapcolor plug-in v1.02 19-Mar-00";
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
#include <time.h>
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "libgimp/gimp.h"
|
||||
#include "libgimp/gimpui.h"
|
||||
#include <libgimp/gimp.h>
|
||||
#include <libgimp/gimpui.h>
|
||||
|
||||
#include "libgimp/stdplugins-intl.h"
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#define PRV_WIDTH 50
|
||||
#define PRV_HEIGHT 20
|
||||
|
||||
typedef struct
|
||||
{
|
||||
guchar colors[4][3];
|
||||
gint32 map_mode;
|
||||
guchar colors[4][3];
|
||||
gint32 map_mode;
|
||||
} PluginValues;
|
||||
|
||||
PluginValues plvals =
|
||||
|
@ -78,20 +74,20 @@ PluginValues plvals =
|
|||
|
||||
typedef struct
|
||||
{
|
||||
guint width, height;
|
||||
guint width, height;
|
||||
guchar *img;
|
||||
} IMG_PREVIEW;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
GtkWidget *preview;
|
||||
GtkWidget *preview;
|
||||
IMG_PREVIEW *img_preview;
|
||||
IMG_PREVIEW *map_preview;
|
||||
} PLInterface;
|
||||
|
||||
|
||||
gint run_flag = FALSE;
|
||||
static gboolean run_flag = FALSE;
|
||||
|
||||
/* Declare some local functions.
|
||||
*/
|
||||
|
@ -114,18 +110,18 @@ static IMG_PREVIEW *img_preview_alloc (guint width, guint height);
|
|||
static void img_preview_free (IMG_PREVIEW *ip);
|
||||
static void img_preview_copy (IMG_PREVIEW *src, IMG_PREVIEW **dst);
|
||||
static IMG_PREVIEW *img_preview_create_from_drawable (guint maxsize,
|
||||
gint32 drawable_ID);
|
||||
gint32 drawable_ID);
|
||||
|
||||
static void update_img_preview (void);
|
||||
|
||||
static gint dialog (gint32 drawable_ID);
|
||||
static gboolean dialog (gint32 drawable_ID);
|
||||
static void mapcolor_ok_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
static void get_mapping (guchar *src_col1, guchar *src_col2,
|
||||
guchar *dst_col1, guchar *dst_col2, gint32 map_mode,
|
||||
guchar *redmap, guchar *greenmap, guchar *bluemap);
|
||||
guchar *dst_col1, guchar *dst_col2, gint32 map_mode,
|
||||
guchar *redmap, guchar *greenmap, guchar *bluemap);
|
||||
static void color_button_color_changed_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
gpointer data);
|
||||
static void add_color_button (gint csel_index,
|
||||
gint left,
|
||||
gint top,
|
||||
|
@ -333,8 +329,6 @@ query (void)
|
|||
};
|
||||
static gint nmap_args = sizeof (map_args) / sizeof (map_args[0]);
|
||||
|
||||
INIT_I18N ();
|
||||
|
||||
gimp_install_procedure ("plug_in_color_adjust",
|
||||
"Adjust color range given by foreground/background "
|
||||
"color to black/white",
|
||||
|
@ -537,7 +531,7 @@ update_img_preview (void)
|
|||
}
|
||||
|
||||
|
||||
static gint
|
||||
static gboolean
|
||||
dialog (gint32 drawable_ID)
|
||||
{
|
||||
GtkWidget *dlg;
|
||||
|
@ -546,27 +540,9 @@ dialog (gint32 drawable_ID)
|
|||
GtkWidget *table;
|
||||
GtkWidget *preview;
|
||||
IMG_PREVIEW *ip;
|
||||
guchar *color_cube;
|
||||
gchar **argv;
|
||||
gint argc, j;
|
||||
gint j;
|
||||
|
||||
argc = 1;
|
||||
argv = g_new (gchar *, 1);
|
||||
argv[0] = g_strdup ("mapcolor");
|
||||
|
||||
gtk_init (&argc, &argv);
|
||||
gtk_rc_parse (gimp_gtkrc ());
|
||||
|
||||
gdk_set_use_xshm (gimp_use_xshm ());
|
||||
|
||||
gtk_preview_set_gamma (gimp_gamma ());
|
||||
gtk_preview_set_install_cmap (gimp_install_cmap ());
|
||||
color_cube = gimp_color_cube ();
|
||||
gtk_preview_set_color_cube (color_cube[0], color_cube[1],
|
||||
color_cube[2], color_cube[3]);
|
||||
|
||||
gtk_widget_set_default_visual (gtk_preview_get_visual ());
|
||||
gtk_widget_set_default_colormap (gtk_preview_get_cmap ());
|
||||
gimp_ui_init ("mapcolor", TRUE);
|
||||
|
||||
memset (&plinterface, 0, sizeof (plinterface));
|
||||
|
||||
|
@ -589,54 +565,57 @@ dialog (gint32 drawable_ID)
|
|||
/* Preview */
|
||||
ip = img_preview_create_from_drawable (IMG_PRV_SIZE, drawable_ID);
|
||||
if (ip)
|
||||
{
|
||||
plinterface.img_preview = ip;
|
||||
img_preview_copy (plinterface.img_preview, &(plinterface.map_preview));
|
||||
{
|
||||
plinterface.img_preview = ip;
|
||||
img_preview_copy (plinterface.img_preview, &(plinterface.map_preview));
|
||||
|
||||
frame = gtk_frame_new (_("Preview"));
|
||||
gtk_container_set_border_width (GTK_CONTAINER (frame), 6);
|
||||
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox),frame,FALSE,FALSE,0);
|
||||
frame = gtk_frame_new (_("Preview"));
|
||||
gtk_container_set_border_width (GTK_CONTAINER (frame), 6);
|
||||
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox), frame,
|
||||
FALSE, FALSE, 0);
|
||||
|
||||
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);
|
||||
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);
|
||||
|
||||
pframe = gtk_frame_new (NULL);
|
||||
gtk_frame_set_shadow_type (GTK_FRAME (pframe), GTK_SHADOW_IN);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (pframe), 4);
|
||||
gtk_container_add (GTK_CONTAINER (abox), pframe);
|
||||
pframe = gtk_frame_new (NULL);
|
||||
gtk_frame_set_shadow_type (GTK_FRAME (pframe), GTK_SHADOW_IN);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (pframe), 4);
|
||||
gtk_container_add (GTK_CONTAINER (abox), pframe);
|
||||
|
||||
preview = gtk_preview_new (GTK_PREVIEW_COLOR);
|
||||
plinterface.preview = preview;
|
||||
gtk_preview_size (GTK_PREVIEW (preview), ip->width, ip->height);
|
||||
gtk_container_add (GTK_CONTAINER (pframe), preview);
|
||||
preview = gtk_preview_new (GTK_PREVIEW_COLOR);
|
||||
plinterface.preview = preview;
|
||||
gtk_preview_size (GTK_PREVIEW (preview), ip->width, ip->height);
|
||||
gtk_container_add (GTK_CONTAINER (pframe), preview);
|
||||
|
||||
gtk_widget_show (preview);
|
||||
gtk_widget_show (pframe);
|
||||
gtk_widget_show (abox);
|
||||
gtk_widget_show (frame);
|
||||
}
|
||||
gtk_widget_show (preview);
|
||||
gtk_widget_show (pframe);
|
||||
gtk_widget_show (abox);
|
||||
gtk_widget_show (frame);
|
||||
}
|
||||
|
||||
for (j = 0; j < 2; j++)
|
||||
{
|
||||
frame = gtk_frame_new ((j==0) ? _("Source color range")
|
||||
: _("Destination color range"));
|
||||
gtk_container_set_border_width (GTK_CONTAINER (frame), 6);
|
||||
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox),frame,FALSE,FALSE,0);
|
||||
gtk_widget_show (frame);
|
||||
{
|
||||
frame = gtk_frame_new ((j == 0) ?
|
||||
_("Source color range") :
|
||||
_("Destination color range"));
|
||||
gtk_container_set_border_width (GTK_CONTAINER (frame), 6);
|
||||
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox), frame,
|
||||
FALSE, FALSE, 0);
|
||||
gtk_widget_show (frame);
|
||||
|
||||
/* The table keeps the color selections */
|
||||
table = gtk_table_new (1, 4, FALSE);
|
||||
gtk_table_set_row_spacings (GTK_TABLE (table), 4);
|
||||
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
|
||||
gtk_table_set_col_spacing (GTK_TABLE (table), 1, 6);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (table), 4);
|
||||
gtk_container_add (GTK_CONTAINER (frame), table);
|
||||
gtk_widget_show (table);
|
||||
/* The table keeps the color selections */
|
||||
table = gtk_table_new (1, 4, FALSE);
|
||||
gtk_table_set_row_spacings (GTK_TABLE (table), 4);
|
||||
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
|
||||
gtk_table_set_col_spacing (GTK_TABLE (table), 1, 6);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (table), 4);
|
||||
gtk_container_add (GTK_CONTAINER (frame), table);
|
||||
gtk_widget_show (table);
|
||||
|
||||
add_color_button (j*2, 0, 0, table);
|
||||
add_color_button (j*2 + 1, 2, 0, table);
|
||||
}
|
||||
add_color_button (j * 2, 0, 0, table);
|
||||
add_color_button (j * 2 + 1, 2, 0, table);
|
||||
}
|
||||
|
||||
update_img_preview ();
|
||||
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
|
||||
#include "libgimp/stdplugins-intl.h"
|
||||
|
||||
|
||||
/* Replace them with the right ones */
|
||||
#define PLUG_IN_NAME "plug_in_max_rgb"
|
||||
#define SHORT_NAME "max_rgb"
|
||||
|
@ -100,8 +101,6 @@ query (void)
|
|||
};
|
||||
static gint nargs = sizeof (args) / sizeof (args[0]);
|
||||
|
||||
INIT_I18N();
|
||||
|
||||
gimp_install_procedure (PLUG_IN_NAME,
|
||||
"Return an image in which each pixel holds only "
|
||||
"the channel that has the maximum value in three "
|
||||
|
@ -248,15 +247,8 @@ dialog (void)
|
|||
{
|
||||
GtkWidget *dlg;
|
||||
GtkWidget *frame;
|
||||
gchar **argv;
|
||||
gint argc;
|
||||
|
||||
argc = 1;
|
||||
argv = g_new (gchar *, 1);
|
||||
argv[0] = g_strdup (PLUG_IN_NAME);
|
||||
|
||||
gtk_init (&argc, &argv);
|
||||
gtk_rc_parse (gimp_gtkrc ());
|
||||
gimp_ui_init ("max_rgb", FALSE);
|
||||
|
||||
dlg = gimp_dialog_new (_("Max RGB"), "max_rgb",
|
||||
gimp_plugin_help_func, "filters/max_rgb.html",
|
||||
|
|
|
@ -47,7 +47,6 @@
|
|||
#include "config.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <signal.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
@ -59,6 +58,7 @@
|
|||
|
||||
#include "libgimp/stdplugins-intl.h"
|
||||
|
||||
|
||||
#define PLUG_IN_NAME "plug_in_mblur"
|
||||
#define PLUG_IN_VERSION "Sep 1997, 1.2"
|
||||
|
||||
|
@ -153,28 +153,22 @@ query (void)
|
|||
{ PARAM_INT32, "type", "Type of motion blur (0 - linear, 1 - radial, 2 - zoom)" },
|
||||
{ PARAM_INT32, "length", "Length" },
|
||||
{ PARAM_INT32, "angle", "Angle" }
|
||||
}; /* args */
|
||||
|
||||
static GParamDef *return_vals = NULL;
|
||||
static int nargs = sizeof(args) / sizeof(args[0]);
|
||||
static int nreturn_vals = 0;
|
||||
|
||||
INIT_I18N();
|
||||
};
|
||||
static gint nargs = sizeof (args) / sizeof (args[0]);
|
||||
|
||||
gimp_install_procedure (PLUG_IN_NAME,
|
||||
"Motion blur of image",
|
||||
"This plug-in simulates the effect seen when photographing a moving object "
|
||||
"at a slow shutter speed. Done by adding multiple displaced copies.",
|
||||
"This plug-in simulates the effect seen when "
|
||||
"photographing a moving object at a slow shutter "
|
||||
"speed. Done by adding multiple displaced copies.",
|
||||
"Torsten Martinsen, Federico Mena Quintero and Daniel Skarda",
|
||||
"Torsten Martinsen, Federico Mena Quintero and Daniel Skarda",
|
||||
PLUG_IN_VERSION,
|
||||
N_("<Image>/Filters/Blur/Motion Blur..."),
|
||||
"RGB*, GRAY*",
|
||||
PROC_PLUG_IN,
|
||||
nargs,
|
||||
nreturn_vals,
|
||||
args,
|
||||
return_vals);
|
||||
nargs, 0,
|
||||
args, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -189,11 +183,6 @@ run (gchar *name,
|
|||
GRunModeType run_mode;
|
||||
GStatusType status;
|
||||
|
||||
#if 0
|
||||
g_print ("Waiting... (pid %d)\n", getpid ());
|
||||
kill (getpid (), SIGSTOP);
|
||||
#endif
|
||||
|
||||
status = STATUS_SUCCESS;
|
||||
run_mode = param[0].data.d_int32;
|
||||
|
||||
|
@ -764,17 +753,7 @@ mblur_dialog (void)
|
|||
GtkWidget *table;
|
||||
GtkObject *adjustment;
|
||||
|
||||
gint argc;
|
||||
gchar **argv;
|
||||
|
||||
argc = 1;
|
||||
argv = g_new (gchar *, 1);
|
||||
argv[0] = g_strdup ("mblur");
|
||||
|
||||
gtk_init (&argc, &argv);
|
||||
gtk_rc_parse (gimp_gtkrc ());
|
||||
|
||||
gdk_set_use_xshm (gimp_use_xshm ());
|
||||
gimp_ui_init ("mblur", FALSE);
|
||||
|
||||
dialog = gimp_dialog_new (_("Motion Blur"), "mblur",
|
||||
gimp_plugin_help_func, "filters/mblur.html",
|
||||
|
|
|
@ -70,16 +70,19 @@
|
|||
* Crop images properly (e.g. height&~7 ?)
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include "config.h"
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include "libgimp/gimp.h"
|
||||
#include "libgimp/stdplugins-intl.h"
|
||||
|
||||
#include <libgimp/gimp.h>
|
||||
|
||||
#include "mpeg.h"
|
||||
|
||||
#include "libgimp/stdplugins-intl.h"
|
||||
|
||||
|
||||
static void query (void);
|
||||
|
@ -109,18 +112,16 @@ query (void)
|
|||
{
|
||||
{ PARAM_INT32, "run_mode", "Interactive, non-interactive" },
|
||||
{ PARAM_STRING, "filename", "The name of the file to load" },
|
||||
{ PARAM_STRING, "raw_filename", "The name entered" },
|
||||
{ PARAM_STRING, "raw_filename", "The name entered" }
|
||||
};
|
||||
static GParamDef load_return_vals[] =
|
||||
{
|
||||
{ PARAM_IMAGE, "image", "Output image" },
|
||||
{ PARAM_IMAGE, "image", "Output image" }
|
||||
};
|
||||
static gint nload_args = sizeof (load_args) / sizeof (load_args[0]);
|
||||
static gint nload_return_vals = (sizeof (load_return_vals) /
|
||||
sizeof (load_return_vals[0]));
|
||||
|
||||
INIT_I18N();
|
||||
|
||||
gimp_install_procedure ("file_mpeg_load",
|
||||
"Loads MPEG movies",
|
||||
"FIXME: write help for mpeg_load",
|
||||
|
|
|
@ -48,6 +48,7 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include <libgimp/gimp.h>
|
||||
|
@ -55,6 +56,7 @@
|
|||
|
||||
#include "libgimp/stdplugins-intl.h"
|
||||
|
||||
|
||||
#ifdef RCSID
|
||||
static char rcsid[] = "$Id$";
|
||||
#endif
|
||||
|
@ -519,13 +521,12 @@ GPlugInInfo PLUG_IN_INFO =
|
|||
};
|
||||
|
||||
|
||||
|
||||
/***** Functions *****/
|
||||
|
||||
MAIN ()
|
||||
|
||||
static void
|
||||
query(void)
|
||||
query (void)
|
||||
{
|
||||
static GParamDef args[]=
|
||||
{
|
||||
|
@ -552,11 +553,13 @@ query(void)
|
|||
};
|
||||
static gint nargs = sizeof (args) / sizeof (args[0]);
|
||||
|
||||
INIT_I18N();
|
||||
|
||||
gimp_install_procedure ("plug_in_newsprint",
|
||||
"Re-sample the image to give a newspaper-like effect",
|
||||
"Halftone the image, trading off resolution to represent colors or grey levels using the process described both in the PostScript language definition, and also by Robert Ulichney, \"Digital halftoning\", MIT Press, 1987.",
|
||||
"Halftone the image, trading off resolution to "
|
||||
"represent colors or grey levels using the process "
|
||||
"described both in the PostScript language "
|
||||
"definition, and also by Robert Ulichney, \"Digital "
|
||||
"halftoning\", MIT Press, 1987.",
|
||||
"Austin Donnelly",
|
||||
"Austin Donnelly",
|
||||
"1998 (" VERSION ")",
|
||||
|
@ -660,7 +663,7 @@ run (gchar *name,
|
|||
if (gimp_drawable_is_rgb (drawable->id) ||
|
||||
gimp_drawable_is_gray (drawable->id))
|
||||
{
|
||||
gimp_progress_init( _("Newsprintifing..."));
|
||||
gimp_progress_init (_("Newsprintifing..."));
|
||||
|
||||
/* set the tile cache size */
|
||||
gimp_tile_cache_ntiles (TILE_CACHE_SIZE);
|
||||
|
@ -1173,32 +1176,10 @@ newsprint_dialog (GDrawable *drawable)
|
|||
GtkWidget *table;
|
||||
GtkObject *adj;
|
||||
GSList *group = NULL;
|
||||
gchar **argv;
|
||||
gint argc;
|
||||
guchar *color_cube;
|
||||
gint bpp;
|
||||
gint i;
|
||||
|
||||
argc = 1;
|
||||
argv = g_new (gchar *, 1);
|
||||
argv[0] = g_strdup ("newsprint");
|
||||
|
||||
gtk_init (&argc, &argv);
|
||||
gtk_rc_parse (gimp_gtkrc ());
|
||||
|
||||
gtk_preview_set_gamma (gimp_gamma ());
|
||||
gtk_preview_set_install_cmap (gimp_install_cmap ());
|
||||
color_cube = gimp_color_cube ();
|
||||
gtk_preview_set_color_cube (color_cube[0], color_cube[1],
|
||||
color_cube[2], color_cube[3]);
|
||||
|
||||
gtk_widget_set_default_visual (gtk_preview_get_visual ());
|
||||
gtk_widget_set_default_colormap (gtk_preview_get_cmap ());
|
||||
|
||||
#if 0
|
||||
g_print ("newsprint: waiting... (pid %d)\n", getpid ());
|
||||
kill (getpid (), 19);
|
||||
#endif
|
||||
gimp_ui_init ("newsprint", TRUE);
|
||||
|
||||
/* flag values to say we haven't filled these channel
|
||||
* states in yet */
|
||||
|
|
|
@ -44,6 +44,7 @@
|
|||
|
||||
#include "libgimp/stdplugins-intl.h"
|
||||
|
||||
|
||||
struct Grgb
|
||||
{
|
||||
guint8 red;
|
||||
|
@ -139,15 +140,10 @@ query (void)
|
|||
{ PARAM_DRAWABLE, "drw", "The Drawable" },
|
||||
{ PARAM_FLOAT, "alpha", "The amount of the filter to apply" },
|
||||
{ PARAM_FLOAT, "radius", "The filter radius" },
|
||||
{ PARAM_INT32, "filter", "The Filter to Run, 0 - alpha trimmed mean; 1 - optimal estimation (alpha controls noise variance); 2 - edge enhancement" },
|
||||
{ PARAM_INT32, "filter", "The Filter to Run, 0 - alpha trimmed mean; 1 - optimal estimation (alpha controls noise variance); 2 - edge enhancement" }
|
||||
};
|
||||
static gint nargs = 6;
|
||||
static gint nargs = sizeof (args) / sizeof (args[0]);
|
||||
|
||||
static GParamDef *rets = NULL;
|
||||
static gint nrets = 0;
|
||||
|
||||
INIT_I18N();
|
||||
|
||||
gimp_install_procedure ("plug_in_nlfilt",
|
||||
"Nonlinear swiss army knife filter",
|
||||
"This is the pnmnlfilt, in gimp's clothing. See the pnmnlfilt manpage for details.",
|
||||
|
@ -157,8 +153,8 @@ query (void)
|
|||
N_("<Image>/Filters/Enhance/NL Filter..."),
|
||||
"RGB,GRAY",
|
||||
PROC_PLUG_IN,
|
||||
nargs, nrets,
|
||||
args, rets);
|
||||
nargs, 0,
|
||||
args, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -341,15 +337,8 @@ pluginCoreIA (struct piArgs *argp)
|
|||
GtkWidget *table;
|
||||
GtkWidget *preview;
|
||||
GtkObject *adj;
|
||||
gchar **argv;
|
||||
gint argc;
|
||||
|
||||
argc = 1;
|
||||
argv = g_new (gchar *, 1);
|
||||
argv[0] = g_strdup ("nlfilt");
|
||||
|
||||
gtk_init (&argc, &argv);
|
||||
gtk_rc_parse (gimp_gtkrc());
|
||||
gimp_ui_init ("nlfilt", TRUE);
|
||||
|
||||
dlg = gimp_dialog_new (_("NL Filter"), "nlfilt",
|
||||
gimp_plugin_help_func, "filters/nlfilt.html",
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
|
||||
#include "libgimp/stdplugins-intl.h"
|
||||
|
||||
|
||||
#define SCALE_WIDTH 125
|
||||
#define TILE_CACHE_SIZE 16
|
||||
|
||||
|
@ -114,8 +115,6 @@ query (void)
|
|||
};
|
||||
static gint nargs = sizeof (args) / sizeof (args[0]);
|
||||
|
||||
INIT_I18N();
|
||||
|
||||
gimp_install_procedure ("plug_in_noisify",
|
||||
"Adds random noise to a drawable's channels",
|
||||
"More here later",
|
||||
|
@ -313,17 +312,10 @@ noisify_dialog (gint channels)
|
|||
GtkWidget *frame;
|
||||
GtkWidget *table;
|
||||
GtkObject *adj;
|
||||
gchar *buffer;
|
||||
gchar **argv;
|
||||
gint argc;
|
||||
gint i;
|
||||
gchar *buffer;
|
||||
gint i;
|
||||
|
||||
argc = 1;
|
||||
argv = g_new (gchar *, 1);
|
||||
argv[0] = g_strdup ("noisify");
|
||||
|
||||
gtk_init (&argc, &argv);
|
||||
gtk_rc_parse (gimp_gtkrc ());
|
||||
gimp_ui_init ("noisify", FALSE);
|
||||
|
||||
dlg = gimp_dialog_new (_("Noisify"), "noisify",
|
||||
gimp_plugin_help_func, "filters/noisify.html",
|
||||
|
|
|
@ -27,71 +27,77 @@
|
|||
* contain pure-white and pure-black.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include "libgimp/gimp.h"
|
||||
|
||||
#include "config.h"
|
||||
#include <libgimp/gimp.h>
|
||||
|
||||
#include "libgimp/stdplugins-intl.h"
|
||||
|
||||
|
||||
/* Declare local functions.
|
||||
*/
|
||||
static void query (void);
|
||||
static void run (char *name,
|
||||
int nparams,
|
||||
GParam *param,
|
||||
int *nreturn_vals,
|
||||
GParam **return_vals);
|
||||
static void run (gchar *name,
|
||||
gint nparams,
|
||||
GParam *param,
|
||||
gint *nreturn_vals,
|
||||
GParam **return_vals);
|
||||
|
||||
static void norma (GDrawable * drawable);
|
||||
static void indexed_norma (gint32 image_ID);
|
||||
static void norma (GDrawable *drawable);
|
||||
static void indexed_norma (gint32 image_ID);
|
||||
|
||||
|
||||
GPlugInInfo PLUG_IN_INFO =
|
||||
{
|
||||
NULL, /* init_proc */
|
||||
NULL, /* quit_proc */
|
||||
query, /* query_proc */
|
||||
run, /* run_proc */
|
||||
NULL, /* init_proc */
|
||||
NULL, /* quit_proc */
|
||||
query, /* query_proc */
|
||||
run, /* run_proc */
|
||||
};
|
||||
|
||||
|
||||
MAIN ()
|
||||
|
||||
static void
|
||||
query ()
|
||||
query (void)
|
||||
{
|
||||
static GParamDef args[] =
|
||||
{
|
||||
{ PARAM_INT32, "run_mode", "Interactive, non-interactive" },
|
||||
{ PARAM_IMAGE, "image", "Input image" },
|
||||
{ PARAM_DRAWABLE, "drawable", "Input drawable" },
|
||||
{ PARAM_DRAWABLE, "drawable", "Input drawable" }
|
||||
};
|
||||
static GParamDef *return_vals = NULL;
|
||||
static int nargs = sizeof (args) / sizeof (args[0]);
|
||||
static int nreturn_vals = 0;
|
||||
|
||||
INIT_I18N();
|
||||
static gint nargs = sizeof (args) / sizeof (args[0]);
|
||||
|
||||
gimp_install_procedure ("plug_in_normalize",
|
||||
"Normalize the contrast of the specified drawable to cover all possible ranges.",
|
||||
"This plugin performs almost the same operation as the 'contrast autostretch' plugin, except that it won't allow the color channels to normalize independently. This is actually what most people probably want instead of contrast-autostretch; use c-a only if you wish to remove an undesirable color-tint from a source image which is supposed to contain pure-white and pure-black.",
|
||||
"Normalize the contrast of the specified drawable to "
|
||||
"cover all possible ranges.",
|
||||
"This plugin performs almost the same operation as "
|
||||
"the 'contrast autostretch' plugin, except that it "
|
||||
"won't allow the color channels to normalize "
|
||||
"independently. This is actually what most people "
|
||||
"probably want instead of contrast-autostretch; use "
|
||||
"c-a only if you wish to remove an undesirable "
|
||||
"color-tint from a source image which is supposed to "
|
||||
"contain pure-white and pure-black.",
|
||||
"Adam D. Moss, Federico Mena Quintero",
|
||||
"Adam D. Moss, Federico Mena Quintero",
|
||||
"1997",
|
||||
N_("<Image>/Image/Colors/Auto/Normalize"),
|
||||
"RGB*, GRAY*, INDEXED*",
|
||||
PROC_PLUG_IN,
|
||||
nargs, nreturn_vals,
|
||||
args, return_vals);
|
||||
nargs, 0,
|
||||
args, NULL);
|
||||
}
|
||||
|
||||
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[1];
|
||||
|
@ -142,7 +148,7 @@ run (char *name,
|
|||
|
||||
|
||||
static void
|
||||
indexed_norma(gint32 image_ID) /* a.d.m. */
|
||||
indexed_norma (gint32 image_ID) /* a.d.m. */
|
||||
{
|
||||
guchar *cmap;
|
||||
gint ncols,i;
|
||||
|
@ -206,9 +212,12 @@ norma (GDrawable *drawable)
|
|||
min = 255;
|
||||
max = 0;
|
||||
|
||||
gimp_pixel_rgn_init (&src_rgn, drawable, x1, y1, (x2 - x1), (y2 - y1), FALSE, FALSE);
|
||||
gimp_pixel_rgn_init (&src_rgn, drawable,
|
||||
x1, y1, (x2 - x1), (y2 - y1), FALSE, FALSE);
|
||||
|
||||
for (pr = gimp_pixel_rgns_register (1, &src_rgn); pr != NULL; pr = gimp_pixel_rgns_process (pr))
|
||||
for (pr = gimp_pixel_rgns_register (1, &src_rgn);
|
||||
pr != NULL;
|
||||
pr = gimp_pixel_rgns_process (pr))
|
||||
{
|
||||
src = src_rgn.data;
|
||||
|
||||
|
@ -252,10 +261,14 @@ norma (GDrawable *drawable)
|
|||
|
||||
|
||||
/* Now substitute pixel vales */
|
||||
gimp_pixel_rgn_init (&src_rgn, drawable, x1, y1, (x2 - x1), (y2 - y1), FALSE, FALSE);
|
||||
gimp_pixel_rgn_init (&dest_rgn, drawable, x1, y1, (x2 - x1), (y2 - y1), TRUE, TRUE);
|
||||
gimp_pixel_rgn_init (&src_rgn, drawable,
|
||||
x1, y1, (x2 - x1), (y2 - y1), FALSE, FALSE);
|
||||
gimp_pixel_rgn_init (&dest_rgn, drawable,
|
||||
x1, y1, (x2 - x1), (y2 - y1), TRUE, TRUE);
|
||||
|
||||
for (pr = gimp_pixel_rgns_register (2, &src_rgn, &dest_rgn); pr != NULL; pr = gimp_pixel_rgns_process (pr))
|
||||
for (pr = gimp_pixel_rgns_register (2, &src_rgn, &dest_rgn);
|
||||
pr != NULL;
|
||||
pr = gimp_pixel_rgns_process (pr))
|
||||
{
|
||||
src = src_rgn.data;
|
||||
dest = dest_rgn.data;
|
||||
|
|
|
@ -68,6 +68,7 @@
|
|||
|
||||
#include "libgimp/stdplugins-intl.h"
|
||||
|
||||
|
||||
#ifdef RCSID
|
||||
static char rcsid[] = "$Id$";
|
||||
#endif
|
||||
|
@ -180,43 +181,40 @@ static NovaInterface pint =
|
|||
};
|
||||
|
||||
|
||||
MAIN()
|
||||
MAIN ()
|
||||
|
||||
static void
|
||||
query (void)
|
||||
{
|
||||
static GParamDef args[]=
|
||||
{
|
||||
{ PARAM_INT32, "run_mode", "Interactive, non-interactive" },
|
||||
{ PARAM_IMAGE, "image", "Input image (unused)" },
|
||||
{ PARAM_DRAWABLE, "drawable", "Input drawable" },
|
||||
{ PARAM_INT32, "xcenter", "X coordinates of the center of supernova" },
|
||||
{ PARAM_INT32, "ycenter", "Y coordinates of the center of supernova" },
|
||||
{ PARAM_COLOR, "color", "Color of supernova" },
|
||||
{ PARAM_INT32, "radius", "Radius of supernova" },
|
||||
{ PARAM_INT32, "nspoke", "Number of spokes" },
|
||||
{ PARAM_INT32, "randomhue", "Random hue" }
|
||||
};
|
||||
static GParamDef *return_vals = NULL;
|
||||
{
|
||||
{ PARAM_INT32, "run_mode", "Interactive, non-interactive" },
|
||||
{ PARAM_IMAGE, "image", "Input image (unused)" },
|
||||
{ PARAM_DRAWABLE, "drawable", "Input drawable" },
|
||||
{ PARAM_INT32, "xcenter", "X coordinates of the center of supernova" },
|
||||
{ PARAM_INT32, "ycenter", "Y coordinates of the center of supernova" },
|
||||
{ PARAM_COLOR, "color", "Color of supernova" },
|
||||
{ PARAM_INT32, "radius", "Radius of supernova" },
|
||||
{ PARAM_INT32, "nspoke", "Number of spokes" },
|
||||
{ PARAM_INT32, "randomhue", "Random hue" }
|
||||
};
|
||||
static gint nargs = sizeof (args) / sizeof (args[0]);
|
||||
static gint nreturn_vals = 0;
|
||||
|
||||
INIT_I18N();
|
||||
|
||||
gimp_install_procedure ("plug_in_nova",
|
||||
"Produce Supernova effect to the specified drawable",
|
||||
"This plug-in produces an effect like a supernova burst. The "
|
||||
"amount of the light effect is approximately in proportion to 1/r, "
|
||||
"where r is the distance from the center of the star. It works with "
|
||||
"RGB*, GRAY* image.",
|
||||
"This plug-in produces an effect like a supernova "
|
||||
"burst. The amount of the light effect is "
|
||||
"approximately in proportion to 1/r, where r is the "
|
||||
"distance from the center of the star. It works with "
|
||||
"RGB*, GRAY* image.",
|
||||
"Eiichi Takamori",
|
||||
"Eiichi Takamori",
|
||||
"1997",
|
||||
N_("<Image>/Filters/Light Effects/SuperNova..."),
|
||||
"RGB*, GRAY*",
|
||||
PROC_PLUG_IN,
|
||||
nargs, nreturn_vals,
|
||||
args, return_vals);
|
||||
nargs, 0,
|
||||
args, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -330,31 +328,8 @@ nova_dialog (GDrawable *drawable)
|
|||
GtkWidget *button;
|
||||
GtkWidget *center_frame;
|
||||
GtkObject *adj;
|
||||
guchar *color_cube;
|
||||
gchar **argv;
|
||||
gint argc;
|
||||
|
||||
argc = 1;
|
||||
argv = g_new (gchar *, 1);
|
||||
argv[0] = g_strdup ("nova");
|
||||
|
||||
gtk_init (&argc, &argv);
|
||||
gtk_rc_parse (gimp_gtkrc ());
|
||||
|
||||
gdk_set_use_xshm (gimp_use_xshm ());
|
||||
gtk_preview_set_gamma (gimp_gamma ());
|
||||
gtk_preview_set_install_cmap (gimp_install_cmap ());
|
||||
color_cube = gimp_color_cube ();
|
||||
gtk_preview_set_color_cube (color_cube[0], color_cube[1],
|
||||
color_cube[2], color_cube[3]);
|
||||
|
||||
gtk_widget_set_default_visual (gtk_preview_get_visual ());
|
||||
gtk_widget_set_default_colormap (gtk_preview_get_cmap ());
|
||||
|
||||
#if 0
|
||||
g_print ("Waiting... (pid %d)\n", getpid ());
|
||||
kill (getpid (), 19); /* SIGSTOP */
|
||||
#endif
|
||||
gimp_ui_init ("nova", TRUE);
|
||||
|
||||
dlg = gimp_dialog_new (_("SuperNova"), "nova",
|
||||
gimp_plugin_help_func, "filters/nova.html",
|
||||
|
@ -1036,6 +1011,6 @@ nova (GDrawable *drawable)
|
|||
gimp_drawable_merge_shadow (drawable->id, TRUE);
|
||||
gimp_drawable_update (drawable->id, x1, y1, (x2 - x1), (y2 - y1));
|
||||
|
||||
g_free(spoke);
|
||||
g_free(spokecolor);
|
||||
g_free (spoke);
|
||||
g_free (spokecolor);
|
||||
}
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
|
||||
#include "libgimp/stdplugins-intl.h"
|
||||
|
||||
|
||||
#define SCALE_WIDTH 125
|
||||
#define HISTSIZE 256
|
||||
|
||||
|
@ -46,7 +47,7 @@
|
|||
typedef struct
|
||||
{
|
||||
gdouble mask_size;
|
||||
gint mode;
|
||||
gint mode;
|
||||
} OilifyVals;
|
||||
|
||||
typedef struct
|
||||
|
@ -106,11 +107,12 @@ query (void)
|
|||
};
|
||||
static gint nargs = sizeof (args) / sizeof (args[0]);
|
||||
|
||||
INIT_I18N();
|
||||
|
||||
gimp_install_procedure ("plug_in_oilify",
|
||||
"Modify the specified drawable to resemble an oil painting",
|
||||
"This function performs the well-known oil-paint effect on the specified drawable. The size of the input mask is specified by 'mask_size'.",
|
||||
"Modify the specified drawable to resemble an oil "
|
||||
"painting",
|
||||
"This function performs the well-known oil-paint "
|
||||
"effect on the specified drawable. The size of the "
|
||||
"input mask is specified by 'mask_size'.",
|
||||
"Torsten Martinsen",
|
||||
"Torsten Martinsen",
|
||||
"1996",
|
||||
|
@ -186,7 +188,8 @@ run (gchar *name,
|
|||
|
||||
/* Make sure that the drawable is gray or RGB color */
|
||||
if ((status == STATUS_SUCCESS) &&
|
||||
(gimp_drawable_is_rgb (drawable->id) || gimp_drawable_is_gray (drawable->id)))
|
||||
(gimp_drawable_is_rgb (drawable->id) ||
|
||||
gimp_drawable_is_gray (drawable->id)))
|
||||
{
|
||||
gimp_progress_init (_("Oil Painting..."));
|
||||
gimp_tile_cache_ntiles (2 * (drawable->width / gimp_tile_width () + 1));
|
||||
|
@ -444,15 +447,8 @@ oilify_dialog (void)
|
|||
GtkWidget *table;
|
||||
GtkWidget *toggle;
|
||||
GtkObject *adj;
|
||||
gchar **argv;
|
||||
gint argc;
|
||||
|
||||
argc = 1;
|
||||
argv = g_new (gchar *, 1);
|
||||
argv[0] = g_strdup ("oilify");
|
||||
|
||||
gtk_init (&argc, &argv);
|
||||
gtk_rc_parse (gimp_gtkrc ());
|
||||
gimp_ui_init ("oilify", FALSE);
|
||||
|
||||
dlg = gimp_dialog_new (_("Oilify"), "oilify",
|
||||
gimp_plugin_help_func, "filters/oilify.html",
|
||||
|
|
|
@ -227,7 +227,7 @@ dialog_ok_clicked (GtkWidget *widget,
|
|||
}
|
||||
|
||||
static void
|
||||
dialog_create (void)
|
||||
open_dialog (void)
|
||||
{
|
||||
GtkWidget *dialog;
|
||||
GtkWidget *main_hbox;
|
||||
|
@ -240,6 +240,8 @@ dialog_create (void)
|
|||
GtkWidget *color_button;
|
||||
GtkWidget *sep;
|
||||
|
||||
gimp_ui_init ("papertile", TRUE);
|
||||
|
||||
dialog = gimp_dialog_new (_("Paper Tile"), "papertile",
|
||||
gimp_plugin_help_func, "filters/papertile.html",
|
||||
GTK_WIN_POS_MOUSE,
|
||||
|
@ -403,39 +405,9 @@ dialog_create (void)
|
|||
gtk_object_set_data (GTK_OBJECT (button), "set_sensitive", color_button);
|
||||
|
||||
gtk_widget_show (dialog);
|
||||
}
|
||||
|
||||
static inline void
|
||||
open_dialog (void)
|
||||
{
|
||||
gint argc;
|
||||
gchar **argv;
|
||||
guchar *color_cube;
|
||||
|
||||
argc = 1;
|
||||
argv = g_new (gchar *, 1);
|
||||
argv[0] = g_strdup (PLUGIN_PROCEDURE_NAME);
|
||||
|
||||
gtk_init (&argc, &argv);
|
||||
gtk_set_locale ();
|
||||
gtk_rc_parse (gimp_gtkrc ());
|
||||
gdk_set_use_xshm (gimp_use_xshm ());
|
||||
|
||||
color_cube = gimp_color_cube ();
|
||||
gtk_preview_set_gamma (gimp_gamma ());
|
||||
gtk_preview_set_install_cmap (gimp_install_cmap ());
|
||||
gtk_preview_set_color_cube (color_cube[0], color_cube[1],
|
||||
color_cube[2], color_cube[3]);
|
||||
gtk_widget_set_default_visual (gtk_preview_get_visual ());
|
||||
gtk_widget_set_default_colormap (gtk_preview_get_cmap ());
|
||||
|
||||
dialog_create ();
|
||||
|
||||
gtk_main ();
|
||||
gdk_flush ();
|
||||
|
||||
g_free (argv[0]);
|
||||
g_free (argv);
|
||||
}
|
||||
|
||||
/*============================================================================*/
|
||||
|
@ -856,11 +828,7 @@ plugin_query (void)
|
|||
{ PARAM_INT32, "background_color", "background color (for bg-type 5)" },
|
||||
{ PARAM_INT32, "background_alpha", "opacity (for bg-type 5)" }
|
||||
};
|
||||
static GParamDef *return_vals = NULL;
|
||||
static gint numof_args = sizeof args / sizeof args[0];
|
||||
static gint numof_return_vals = 0;
|
||||
|
||||
INIT_I18N ();
|
||||
static gint numof_args = sizeof args / sizeof args[0];
|
||||
|
||||
gimp_install_procedure (PLUGIN_PROCEDURE_NAME,
|
||||
"Cuts an image into paper tiles, and slides each paper tile.",
|
||||
|
@ -871,8 +839,8 @@ plugin_query (void)
|
|||
N_("<Image>/Filters/Map/Paper Tile..."),
|
||||
"RGB*",
|
||||
PROC_PLUG_IN,
|
||||
numof_args, numof_return_vals,
|
||||
args, return_vals);
|
||||
numof_args, 0,
|
||||
args, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -976,4 +944,4 @@ GPlugInInfo PLUG_IN_INFO =
|
|||
plugin_run
|
||||
};
|
||||
|
||||
MAIN()
|
||||
MAIN ()
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
|
||||
#include "libgimp/stdplugins-intl.h"
|
||||
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
#include <io.h>
|
||||
#endif
|
||||
|
@ -57,7 +58,6 @@ static gint save_image (gchar *filename,
|
|||
gint32 image_ID,
|
||||
gint32 drawable_ID);
|
||||
|
||||
static void init_gtk (void);
|
||||
static gint save_dialog (void);
|
||||
static void ok_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
|
@ -82,11 +82,11 @@ query (void)
|
|||
{
|
||||
{ PARAM_INT32, "run_mode", "Interactive, non-interactive" },
|
||||
{ PARAM_STRING, "filename", "The name of the file to load" },
|
||||
{ PARAM_STRING, "raw_filename", "The name of the file to load" },
|
||||
{ PARAM_STRING, "raw_filename", "The name of the file to load" }
|
||||
};
|
||||
static GParamDef load_return_vals[] =
|
||||
{
|
||||
{ PARAM_IMAGE, "image", "Output image" },
|
||||
{ PARAM_IMAGE, "image", "Output image" }
|
||||
};
|
||||
static gint nload_args = sizeof (load_args) / sizeof (load_args[0]);
|
||||
static gint nload_return_vals = (sizeof (load_return_vals) /
|
||||
|
@ -103,8 +103,6 @@ query (void)
|
|||
};
|
||||
static gint nsave_args = sizeof (save_args) / sizeof (save_args[0]);
|
||||
|
||||
INIT_I18N();
|
||||
|
||||
gimp_install_procedure ("file_pat_load",
|
||||
"Loads Gimp's .PAT pattern files",
|
||||
"The images in the pattern dialog can be loaded directly with this plug-in",
|
||||
|
@ -186,7 +184,7 @@ run (gchar *name,
|
|||
case RUN_INTERACTIVE:
|
||||
case RUN_WITH_LAST_VALS:
|
||||
INIT_I18N_UI();
|
||||
init_gtk ();
|
||||
gimp_ui_init ("pat", FALSE);
|
||||
export = gimp_export_image (&image_ID, &drawable_ID, "PAT",
|
||||
(CAN_HANDLE_RGB | CAN_HANDLE_GRAY));
|
||||
if (export == EXPORT_CANCEL)
|
||||
|
@ -399,20 +397,6 @@ save_image (gchar *filename,
|
|||
return 1;
|
||||
}
|
||||
|
||||
static void
|
||||
init_gtk (void)
|
||||
{
|
||||
gchar **argv;
|
||||
gint argc;
|
||||
|
||||
argc = 1;
|
||||
argv = g_new (gchar *, 1);
|
||||
argv[0] = g_strdup ("pat");
|
||||
|
||||
gtk_init (&argc, &argv);
|
||||
gtk_rc_parse (gimp_gtkrc ());
|
||||
}
|
||||
|
||||
static gint
|
||||
save_dialog (void)
|
||||
{
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
|
||||
#include "libgimp/stdplugins-intl.h"
|
||||
|
||||
|
||||
/* Declare plug-in functions. */
|
||||
|
||||
static void query (void);
|
||||
|
@ -69,11 +70,11 @@ query (void)
|
|||
{
|
||||
{ PARAM_INT32, "run_mode", "Interactive, non-interactive" },
|
||||
{ PARAM_STRING, "filename", "The name of the file to load" },
|
||||
{ PARAM_STRING, "raw_filename", "The name entered" },
|
||||
{ PARAM_STRING, "raw_filename", "The name entered" }
|
||||
};
|
||||
static GParamDef load_return_vals[] =
|
||||
{
|
||||
{ PARAM_IMAGE, "image", "Output image" },
|
||||
{ PARAM_IMAGE, "image", "Output image" }
|
||||
};
|
||||
static gint nload_args = sizeof (load_args) / sizeof (load_args[0]);
|
||||
static gint nload_return_vals = (sizeof (load_return_vals) /
|
||||
|
@ -85,12 +86,10 @@ query (void)
|
|||
{ PARAM_IMAGE, "image", "Input image" },
|
||||
{ PARAM_DRAWABLE, "drawable", "Drawable to save" },
|
||||
{ PARAM_STRING, "filename", "The name of the file to save the image in" },
|
||||
{ PARAM_STRING, "raw_filename", "The name entered" },
|
||||
{ PARAM_STRING, "raw_filename", "The name entered" }
|
||||
};
|
||||
static gint nsave_args = sizeof (save_args) / sizeof (save_args[0]);
|
||||
|
||||
INIT_I18N();
|
||||
|
||||
gimp_install_procedure ("file_pcx_load",
|
||||
"Loads files in Zsoft PCX file format",
|
||||
"FIXME: write help for pcx_load",
|
||||
|
@ -126,8 +125,6 @@ query (void)
|
|||
|
||||
/* Declare internal functions. */
|
||||
|
||||
static void init_gtk (void);
|
||||
|
||||
static gint32 load_image (gchar *filename);
|
||||
static void load_1 (FILE *fp,
|
||||
gint width,
|
||||
|
@ -218,7 +215,7 @@ run (gchar *name,
|
|||
case RUN_INTERACTIVE:
|
||||
case RUN_WITH_LAST_VALS:
|
||||
INIT_I18N_UI();
|
||||
init_gtk ();
|
||||
gimp_ui_init ("pcx", FALSE);
|
||||
export = gimp_export_image (&image_ID, &drawable_ID, "PCX",
|
||||
(CAN_HANDLE_RGB |
|
||||
CAN_HANDLE_GRAY |
|
||||
|
@ -270,20 +267,6 @@ run (gchar *name,
|
|||
values[0].data.d_status = status;
|
||||
}
|
||||
|
||||
static void
|
||||
init_gtk (void)
|
||||
{
|
||||
gchar **argv;
|
||||
gint argc;
|
||||
|
||||
argc = 1;
|
||||
argv = g_new (gchar *, 1);
|
||||
argv[0] = g_strdup ("pcx");
|
||||
|
||||
gtk_init (&argc, &argv);
|
||||
gtk_rc_parse (gimp_gtkrc ());
|
||||
}
|
||||
|
||||
guchar mono[6]= { 0, 0, 0, 255, 255, 255 };
|
||||
|
||||
static struct
|
||||
|
|
|
@ -57,6 +57,7 @@ static char ident[] = "@(#) GIMP Alias|Wavefront pix image file-plugin v1.0 24-
|
|||
|
||||
#include "libgimp/stdplugins-intl.h"
|
||||
|
||||
|
||||
/* #define PIX_DEBUG */
|
||||
|
||||
#ifdef PIX_DEBUG
|
||||
|
@ -89,8 +90,6 @@ static guint16 get_short (FILE *file);
|
|||
static void put_short (guint16 value,
|
||||
FILE *file);
|
||||
|
||||
static void init_gtk (void);
|
||||
|
||||
/******************
|
||||
* Implementation *
|
||||
******************/
|
||||
|
@ -116,11 +115,11 @@ query (void)
|
|||
{
|
||||
{ PARAM_INT32, "run_mode", "Interactive, non-interactive" },
|
||||
{ PARAM_STRING, "filename", "The name of the file to load" },
|
||||
{ PARAM_STRING, "raw_filename", "The name entered" },
|
||||
{ PARAM_STRING, "raw_filename", "The name entered" }
|
||||
};
|
||||
static GParamDef load_return_vals[] =
|
||||
{
|
||||
{ PARAM_IMAGE, "image", "Output image" },
|
||||
{ PARAM_IMAGE, "image", "Output image" }
|
||||
};
|
||||
static gint nload_args = sizeof (load_args) / sizeof (load_args[0]);
|
||||
static gint nload_return_vals = (sizeof (load_return_vals) /
|
||||
|
@ -136,8 +135,6 @@ query (void)
|
|||
};
|
||||
static gint nsave_args = sizeof (save_args) / sizeof (save_args[0]);
|
||||
|
||||
INIT_I18N();
|
||||
|
||||
gimp_install_procedure ("file_pix_load",
|
||||
"loads files of the PIX file format",
|
||||
"loads files of the PIX file format",
|
||||
|
@ -232,7 +229,7 @@ run (gchar *name,
|
|||
case RUN_INTERACTIVE:
|
||||
case RUN_WITH_LAST_VALS:
|
||||
INIT_I18N_UI();
|
||||
init_gtk ();
|
||||
gimp_ui_init ("pix", FALSE);
|
||||
export = gimp_export_image (&image_ID, &drawable_ID, "PIX",
|
||||
(CAN_HANDLE_RGB |
|
||||
CAN_HANDLE_GRAY));
|
||||
|
@ -653,17 +650,3 @@ save_image (gchar *filename,
|
|||
fclose (file);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
init_gtk (void)
|
||||
{
|
||||
gchar **argv;
|
||||
gint argc;
|
||||
|
||||
argc = 1;
|
||||
argv = g_new (gchar *, 1);
|
||||
argv[0] = g_strdup ("pix");
|
||||
|
||||
gtk_init (&argc, &argv);
|
||||
gtk_rc_parse (gimp_gtkrc ());
|
||||
}
|
||||
|
|
|
@ -68,6 +68,7 @@
|
|||
|
||||
#include "libgimp/stdplugins-intl.h"
|
||||
|
||||
|
||||
#ifdef RCSID
|
||||
static char rcsid[] = "$Id$";
|
||||
#endif
|
||||
|
@ -119,10 +120,10 @@ static void pixelize_sub (gint pixelwidth, gint bpp);
|
|||
|
||||
GPlugInInfo PLUG_IN_INFO =
|
||||
{
|
||||
NULL, /* init_proc */
|
||||
NULL, /* quit_proc */
|
||||
query, /* query_proc */
|
||||
run /* run_proc */
|
||||
NULL, /* init_proc */
|
||||
NULL, /* quit_proc */
|
||||
query, /* query_proc */
|
||||
run /* run_proc */
|
||||
};
|
||||
|
||||
static PixelizeValues pvals =
|
||||
|
@ -151,11 +152,7 @@ query (void)
|
|||
{ PARAM_DRAWABLE, "drawable", "Input drawable" },
|
||||
{ PARAM_INT32, "pixelwidth", "Pixel width (the decrease in resolution)" }
|
||||
};
|
||||
static GParamDef *return_vals = NULL;
|
||||
static gint nargs = sizeof (args) / sizeof (args[0]);
|
||||
static gint nreturn_vals = 0;
|
||||
|
||||
INIT_I18N();
|
||||
|
||||
gimp_install_procedure ("plug_in_pixelize",
|
||||
"Pixelize the contents of the specified drawable",
|
||||
|
@ -166,8 +163,8 @@ query (void)
|
|||
N_("<Image>/Filters/Blur/Pixelize..."),
|
||||
"RGB*, GRAY*",
|
||||
PROC_PLUG_IN,
|
||||
nargs, nreturn_vals,
|
||||
args, return_vals);
|
||||
nargs, 0,
|
||||
args, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -218,7 +215,7 @@ run (gchar *name,
|
|||
pvals.pixelwidth = (gdouble) param[3].data.d_int32;
|
||||
}
|
||||
if ((status == STATUS_SUCCESS) &&
|
||||
pvals.pixelwidth <= 0 )
|
||||
pvals.pixelwidth <= 0)
|
||||
status = STATUS_CALLING_ERROR;
|
||||
break;
|
||||
|
||||
|
@ -235,9 +232,10 @@ run (gchar *name,
|
|||
if (status == STATUS_SUCCESS)
|
||||
{
|
||||
/* Make sure that the drawable is gray or RGB color */
|
||||
if (gimp_drawable_is_rgb (drawable->id) || gimp_drawable_is_gray (drawable->id))
|
||||
if (gimp_drawable_is_rgb (drawable->id) ||
|
||||
gimp_drawable_is_gray (drawable->id))
|
||||
{
|
||||
gimp_progress_init ( _("Pixelizing..."));
|
||||
gimp_progress_init (_("Pixelizing..."));
|
||||
|
||||
/* set the tile cache size */
|
||||
gimp_tile_cache_ntiles (TILE_CACHE_SIZE);
|
||||
|
@ -254,7 +252,7 @@ run (gchar *name,
|
|||
}
|
||||
else
|
||||
{
|
||||
/* gimp_message ("pixelize: cannot operate on indexed color images"); */
|
||||
/* g_message ("pixelize: cannot operate on indexed color images"); */
|
||||
status = STATUS_EXECUTION_ERROR;
|
||||
}
|
||||
}
|
||||
|
@ -271,15 +269,8 @@ pixelize_dialog (void)
|
|||
GtkWidget *frame;
|
||||
GtkWidget *table;
|
||||
GtkObject *adjustment;
|
||||
gchar **argv;
|
||||
gint argc;
|
||||
|
||||
argc = 1;
|
||||
argv = g_new (gchar *, 1);
|
||||
argv[0] = g_strdup ("pixelize");
|
||||
|
||||
gtk_init (&argc, &argv);
|
||||
gtk_rc_parse (gimp_gtkrc ());
|
||||
gimp_ui_init ("pixelize", FALSE);
|
||||
|
||||
dlg = gimp_dialog_new (_("Pixelize"), "pixelize",
|
||||
gimp_plugin_help_func, "filters/pixelize.html",
|
||||
|
@ -357,10 +348,10 @@ pixelize (GDrawable *drawable)
|
|||
if (pixelwidth < 1)
|
||||
pixelwidth = 1;
|
||||
|
||||
if( pixelwidth >= tile_width )
|
||||
pixelize_large( drawable, pixelwidth );
|
||||
if (pixelwidth >= tile_width)
|
||||
pixelize_large (drawable, pixelwidth);
|
||||
else
|
||||
pixelize_small( drawable, pixelwidth, tile_width );
|
||||
pixelize_small (drawable, pixelwidth, tile_width);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -384,28 +375,31 @@ pixelize_large (GDrawable *drawable,
|
|||
|
||||
gimp_drawable_mask_bounds (drawable->id, &x1, &y1, &x2, &y2);
|
||||
|
||||
bpp = gimp_drawable_bpp( drawable->id );
|
||||
average = g_new( gulong, bpp );
|
||||
bpp = gimp_drawable_bpp(drawable->id);
|
||||
average = g_new(gulong, bpp);
|
||||
|
||||
/* Initialize progress */
|
||||
progress = 0;
|
||||
max_progress = 2 * (x2 - x1) * (y2 - y1);
|
||||
|
||||
for( y = y1; y < y2; y += pixelwidth - ( y % pixelwidth ) )
|
||||
for (y = y1; y < y2; y += pixelwidth - (y % pixelwidth))
|
||||
{
|
||||
for( x = x1; x < x2; x += pixelwidth - ( x % pixelwidth ) )
|
||||
for (x = x1; x < x2; x += pixelwidth - (x % pixelwidth))
|
||||
{
|
||||
x_step = pixelwidth - ( x % pixelwidth );
|
||||
y_step = pixelwidth - ( y % pixelwidth );
|
||||
x_step = MIN( x_step, x2-x );
|
||||
y_step = MIN( y_step, y2-y );
|
||||
x_step = pixelwidth - (x % pixelwidth);
|
||||
y_step = pixelwidth - (y % pixelwidth);
|
||||
x_step = MIN(x_step, x2-x);
|
||||
y_step = MIN(y_step, y2-y);
|
||||
|
||||
gimp_pixel_rgn_init (&src_rgn, drawable, x, y, x_step, y_step, FALSE, FALSE);
|
||||
for( b = 0; b < bpp; b++ )
|
||||
gimp_pixel_rgn_init (&src_rgn, drawable,
|
||||
x, y, x_step, y_step, FALSE, FALSE);
|
||||
for (b = 0; b < bpp; b++)
|
||||
average[b] = 0;
|
||||
count = 0;
|
||||
|
||||
for (pr = gimp_pixel_rgns_register (1, &src_rgn); pr != NULL; pr = gimp_pixel_rgns_process (pr))
|
||||
for (pr = gimp_pixel_rgns_register (1, &src_rgn);
|
||||
pr != NULL;
|
||||
pr = gimp_pixel_rgns_process (pr))
|
||||
{
|
||||
src_row = src_rgn.data;
|
||||
for (row = 0; row < src_rgn.h; row++)
|
||||
|
@ -413,7 +407,7 @@ pixelize_large (GDrawable *drawable,
|
|||
src = src_row;
|
||||
for (col = 0; col < src_rgn.w; col++)
|
||||
{
|
||||
for( b = 0; b < bpp; b++ )
|
||||
for(b = 0; b < bpp; b++)
|
||||
average[b] += src[b];
|
||||
src += src_rgn.bpp;
|
||||
count += 1;
|
||||
|
@ -425,14 +419,17 @@ pixelize_large (GDrawable *drawable,
|
|||
gimp_progress_update ((double) progress / (double) max_progress);
|
||||
}
|
||||
|
||||
if ( count > 0 )
|
||||
if (count > 0)
|
||||
{
|
||||
for ( b = 0; b < bpp; b++ )
|
||||
average[b] = (guchar) ( average[b] / count );
|
||||
for (b = 0; b < bpp; b++)
|
||||
average[b] = (guchar) (average[b] / count);
|
||||
}
|
||||
|
||||
gimp_pixel_rgn_init (&dest_rgn, drawable, x, y, x_step, y_step, 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,
|
||||
x, y, x_step, y_step, TRUE, TRUE);
|
||||
for (pr = gimp_pixel_rgns_register (1, &dest_rgn);
|
||||
pr != NULL;
|
||||
pr = gimp_pixel_rgns_process (pr))
|
||||
{
|
||||
dest_row = dest_rgn.data;
|
||||
for (row = 0; row < dest_rgn.h; row++)
|
||||
|
@ -440,7 +437,7 @@ pixelize_large (GDrawable *drawable,
|
|||
dest = dest_row;
|
||||
for (col = 0; col < dest_rgn.w; col++)
|
||||
{
|
||||
for( b = 0; b < bpp; b++ )
|
||||
for (b = 0; b < bpp; b++)
|
||||
dest[b] = average[b];
|
||||
dest += dest_rgn.bpp;
|
||||
count += 1;
|
||||
|
@ -454,7 +451,7 @@ pixelize_large (GDrawable *drawable,
|
|||
}
|
||||
}
|
||||
|
||||
g_free( average );
|
||||
g_free (average);
|
||||
|
||||
/* update the blurred region */
|
||||
gimp_drawable_flush (drawable);
|
||||
|
@ -469,13 +466,13 @@ pixelize_large (GDrawable *drawable,
|
|||
its speed).
|
||||
|
||||
If any coordinates of mask boundary is not multiply of pixel width
|
||||
( e.g. x1 % pixelwidth != 0 ), operates on the region whose width
|
||||
(e.g. x1 % pixelwidth != 0), operates on the region whose width
|
||||
or height is the remainder.
|
||||
*/
|
||||
static void
|
||||
pixelize_small (GDrawable *drawable,
|
||||
gint pixelwidth,
|
||||
gint tile_width )
|
||||
gint tile_width)
|
||||
{
|
||||
GPixelRgn src_rgn, dest_rgn;
|
||||
gint bpp;
|
||||
|
@ -492,25 +489,27 @@ pixelize_small (GDrawable *drawable,
|
|||
|
||||
bpp = drawable->bpp;
|
||||
|
||||
area.width = ( tile_width / pixelwidth ) * pixelwidth;
|
||||
area.data= g_new( guchar, (glong) bpp * area.width * area.width );
|
||||
area.width = (tile_width / pixelwidth) * pixelwidth;
|
||||
area.data= g_new(guchar, (glong) bpp * area.width * area.width );
|
||||
|
||||
for( area.y = y1; area.y < y2;
|
||||
area.y += area.width - ( area.y % area.width ) )
|
||||
for(area.y = y1; area.y < y2;
|
||||
area.y += area.width - (area.y % area.width))
|
||||
{
|
||||
area.h = area.width - ( area.y % area.width );
|
||||
area.h = MIN( area.h, y2 - area.y );
|
||||
for( area.x = x1; area.x < x2;
|
||||
area.x += area.width - ( area.x % area.width ) )
|
||||
area.h = area.width - (area.y % area.width);
|
||||
area.h = MIN(area.h, y2 - area.y);
|
||||
for(area.x = x1; area.x < x2;
|
||||
area.x += area.width - (area.x % area.width))
|
||||
{
|
||||
area.w = area.width - ( area.x % area.width );
|
||||
area.w = MIN( area.w, x2 - area.x );
|
||||
area.w = area.width - (area.x % area.width);
|
||||
area.w = MIN(area.w, x2 - area.x);
|
||||
|
||||
gimp_pixel_rgn_get_rect( &src_rgn, area.data, area.x, area.y, area.w, area.h );
|
||||
gimp_pixel_rgn_get_rect (&src_rgn, area.data,
|
||||
area.x, area.y, area.w, area.h);
|
||||
|
||||
pixelize_sub( pixelwidth, bpp );
|
||||
pixelize_sub(pixelwidth, bpp);
|
||||
|
||||
gimp_pixel_rgn_set_rect( &dest_rgn, area.data, area.x, area.y, area.w, area.h );
|
||||
gimp_pixel_rgn_set_rect (&dest_rgn, area.data,
|
||||
area.x, area.y, area.w, area.h);
|
||||
|
||||
/* Update progress */
|
||||
progress += area.w * area.h;
|
||||
|
@ -518,7 +517,7 @@ pixelize_small (GDrawable *drawable,
|
|||
}
|
||||
}
|
||||
|
||||
g_free( area.data );
|
||||
g_free(area.data);
|
||||
|
||||
/* update the pixelized region */
|
||||
gimp_drawable_flush (drawable);
|
||||
|
@ -545,28 +544,28 @@ pixelize_sub (gint pixelwidth,
|
|||
|
||||
rowstride = area.w * bpp;
|
||||
|
||||
for( y = area.y; y < area.y + area.h; y += pixelwidth - ( y % pixelwidth ) )
|
||||
for (y = area.y; y < area.y + area.h; y += pixelwidth - (y % pixelwidth))
|
||||
{
|
||||
h = pixelwidth - ( y % pixelwidth );
|
||||
h = MIN( h, area.y + area.h - y );
|
||||
for( x = area.x; x < area.x + area.w; x += pixelwidth - ( x % pixelwidth ) )
|
||||
h = pixelwidth - (y % pixelwidth);
|
||||
h = MIN(h, area.y + area.h - y);
|
||||
for (x = area.x; x < area.x + area.w; x += pixelwidth - (x % pixelwidth))
|
||||
{
|
||||
w = pixelwidth - ( x % pixelwidth );
|
||||
w = MIN( w, area.x + area.w - x );
|
||||
w = pixelwidth - (x % pixelwidth);
|
||||
w = MIN (w, area.x + area.w - x);
|
||||
|
||||
for( i = 0; i < bpp; i++ )
|
||||
for (i = 0; i < bpp; i++)
|
||||
average[i] = 0;
|
||||
count = 0;
|
||||
|
||||
/* Read */
|
||||
buf_row = area.data + (y-area.y)*rowstride + (x-area.x)*bpp;
|
||||
|
||||
for( row = 0; row < h; row++ )
|
||||
for (row = 0; row < h; row++)
|
||||
{
|
||||
buf = buf_row;
|
||||
for( col = 0; col < w; col++ )
|
||||
for (col = 0; col < w; col++)
|
||||
{
|
||||
for( i = 0; i < bpp; i++ )
|
||||
for (i = 0; i < bpp; i++)
|
||||
average[i] += buf[i];
|
||||
count++;
|
||||
buf += bpp;
|
||||
|
@ -575,21 +574,21 @@ pixelize_sub (gint pixelwidth,
|
|||
}
|
||||
|
||||
/* Average */
|
||||
if ( count > 0 )
|
||||
if (count > 0)
|
||||
{
|
||||
for( i = 0; i < bpp; i++ )
|
||||
for (i = 0; i < bpp; i++)
|
||||
average[i] /= count;
|
||||
}
|
||||
|
||||
/* Write */
|
||||
buf_row = area.data + (y-area.y)*rowstride + (x-area.x)*bpp;
|
||||
|
||||
for( row = 0; row < h; row++ )
|
||||
for (row = 0; row < h; row++)
|
||||
{
|
||||
buf = buf_row;
|
||||
for( col = 0; col < w; col++ )
|
||||
for (col = 0; col < w; col++)
|
||||
{
|
||||
for( i = 0; i < bpp; i++ )
|
||||
for (i = 0; i < bpp; i++)
|
||||
buf[i] = average[i];
|
||||
count++;
|
||||
buf += bpp;
|
||||
|
|
|
@ -61,6 +61,7 @@
|
|||
|
||||
#include "libgimp/stdplugins-intl.h"
|
||||
|
||||
|
||||
/* Some useful macros */
|
||||
|
||||
#define ENTRY_WIDTH 75
|
||||
|
@ -159,8 +160,6 @@ query (void)
|
|||
};
|
||||
static gint nargs = sizeof (args) / sizeof (args[0]);
|
||||
|
||||
INIT_I18N();
|
||||
|
||||
gimp_install_procedure ("plug_in_plasma",
|
||||
"Create a plasma cloud like image to the specified drawable",
|
||||
"More help",
|
||||
|
@ -277,15 +276,8 @@ plasma_dialog (void)
|
|||
GtkWidget *table;
|
||||
GtkWidget *seed_hbox;
|
||||
GtkObject *adj;
|
||||
gchar **argv;
|
||||
gint argc;
|
||||
|
||||
argc = 1;
|
||||
argv = g_new (gchar *, 1);
|
||||
argv[0] = g_strdup ("plasma");
|
||||
|
||||
gtk_init (&argc, &argv);
|
||||
gtk_rc_parse (gimp_gtkrc ());
|
||||
gimp_ui_init ("plasma", FALSE);
|
||||
|
||||
dlg = gimp_dialog_new (_("Plasma"), "plasma",
|
||||
gimp_plugin_help_func, "filters/plasma.html",
|
||||
|
@ -362,14 +354,14 @@ plasma_ok_callback (GtkWidget *widget,
|
|||
* Some glabals to save passing too many paramaters that don't change.
|
||||
*/
|
||||
|
||||
gint ix1, iy1, ix2, iy2; /* Selected image size. */
|
||||
GTile *tile=NULL;
|
||||
gint tile_row, tile_col;
|
||||
gint tile_width, tile_height;
|
||||
gint tile_dirty;
|
||||
gint bpp, has_alpha, alpha;
|
||||
gdouble turbulence;
|
||||
glong max_progress, progress;
|
||||
static gint ix1, iy1, ix2, iy2; /* Selected image size. */
|
||||
static GTile *tile=NULL;
|
||||
static gint tile_row, tile_col;
|
||||
static gint tile_width, tile_height;
|
||||
static gint tile_dirty;
|
||||
static gint bpp, has_alpha, alpha;
|
||||
static gdouble turbulence;
|
||||
static glong max_progress, progress;
|
||||
|
||||
/*
|
||||
* The setup function.
|
||||
|
@ -388,7 +380,7 @@ plasma (GDrawable *drawable)
|
|||
* center of the image.
|
||||
*/
|
||||
|
||||
do_plasma(drawable, ix1, iy1, ix2 - 1, iy2 - 1, -1, 0);
|
||||
do_plasma (drawable, ix1, iy1, ix2 - 1, iy2 - 1, -1, 0);
|
||||
|
||||
/*
|
||||
* Now we recurse through the images, going further each time.
|
||||
|
@ -407,10 +399,10 @@ init_plasma (GDrawable *drawable)
|
|||
if (pvals.timeseed)
|
||||
pvals.seed = time(NULL);
|
||||
|
||||
srand(pvals.seed);
|
||||
srand (pvals.seed);
|
||||
turbulence = pvals.turbulence;
|
||||
|
||||
gimp_drawable_mask_bounds(drawable->id, &ix1, &iy1, &ix2, &iy2);
|
||||
gimp_drawable_mask_bounds (drawable->id, &ix1, &iy1, &ix2, &iy2);
|
||||
|
||||
max_progress = (ix2 - ix1) * (iy2 - iy1);
|
||||
progress = 0;
|
||||
|
@ -422,8 +414,8 @@ init_plasma (GDrawable *drawable)
|
|||
tile_row = 0; tile_col = 0;
|
||||
|
||||
bpp = drawable->bpp;
|
||||
has_alpha = gimp_drawable_has_alpha(drawable->id);
|
||||
if(has_alpha)
|
||||
has_alpha = gimp_drawable_has_alpha (drawable->id);
|
||||
if (has_alpha)
|
||||
alpha = bpp-1;
|
||||
else
|
||||
alpha = bpp;
|
||||
|
@ -436,22 +428,22 @@ provide_tile (GDrawable *drawable,
|
|||
{
|
||||
if (col != tile_col || row != tile_row || !tile)
|
||||
{
|
||||
if(tile)
|
||||
gimp_tile_unref(tile, tile_dirty);
|
||||
if (tile)
|
||||
gimp_tile_unref (tile, tile_dirty);
|
||||
tile_col = col;
|
||||
tile_row = row;
|
||||
tile = gimp_drawable_get_tile(drawable, TRUE, tile_row, tile_col);
|
||||
tile = gimp_drawable_get_tile (drawable, TRUE, tile_row, tile_col);
|
||||
tile_dirty = FALSE;
|
||||
gimp_tile_ref(tile);
|
||||
gimp_tile_ref (tile);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
end_plasma (GDrawable *drawable)
|
||||
{
|
||||
if(tile)
|
||||
gimp_tile_unref(tile, tile_dirty);
|
||||
tile=NULL;
|
||||
if (tile)
|
||||
gimp_tile_unref (tile, tile_dirty);
|
||||
tile = NULL;
|
||||
|
||||
gimp_drawable_flush (drawable);
|
||||
gimp_drawable_merge_shadow (drawable->id, TRUE);
|
||||
|
@ -478,7 +470,7 @@ get_pixel (GDrawable *drawable,
|
|||
offx = x % tile_width;
|
||||
offy = y % tile_height;
|
||||
|
||||
provide_tile(drawable, col, row);
|
||||
provide_tile (drawable, col, row);
|
||||
|
||||
ptr = tile->data + (offy * tile->ewidth + offx) * bpp;
|
||||
for(i = 0; i < alpha; i++)
|
||||
|
@ -505,12 +497,12 @@ put_pixel (GDrawable *drawable,
|
|||
offx = x % tile_width;
|
||||
offy = y % tile_height;
|
||||
|
||||
provide_tile(drawable, col, row);
|
||||
provide_tile (drawable, col, row);
|
||||
|
||||
ptr = tile->data + (offy * tile->ewidth + offx) * bpp;
|
||||
for(i = 0; i < alpha; i++)
|
||||
ptr[i] = pixel[i];
|
||||
if(has_alpha)
|
||||
if (has_alpha)
|
||||
ptr[alpha] = 255;
|
||||
|
||||
tile_dirty = TRUE;
|
||||
|
@ -578,24 +570,24 @@ do_plasma (GDrawable *drawable,
|
|||
|
||||
if (depth == -1)
|
||||
{
|
||||
random_rgb(tl);
|
||||
put_pixel(drawable, x1, y1, tl);
|
||||
random_rgb(tr);
|
||||
put_pixel(drawable, x2, y1, tr);
|
||||
random_rgb(bl);
|
||||
put_pixel(drawable, x1, y2, bl);
|
||||
random_rgb(br);
|
||||
put_pixel(drawable, x2, y2, br);
|
||||
random_rgb(mm);
|
||||
put_pixel(drawable, (x1 + x2) / 2, (y1 + y2) / 2, mm);
|
||||
random_rgb(ml);
|
||||
put_pixel(drawable, x1, (y1 + y2) / 2, ml);
|
||||
random_rgb(mr);
|
||||
put_pixel(drawable, x2, (y1 + y2) / 2, mr);
|
||||
random_rgb(mt);
|
||||
put_pixel(drawable, (x1 + x2) / 2, y1, mt);
|
||||
random_rgb(ml);
|
||||
put_pixel(drawable, (x1 + x2) / 2, y2, ml);
|
||||
random_rgb (tl);
|
||||
put_pixel (drawable, x1, y1, tl);
|
||||
random_rgb (tr);
|
||||
put_pixel (drawable, x2, y1, tr);
|
||||
random_rgb (bl);
|
||||
put_pixel (drawable, x1, y2, bl);
|
||||
random_rgb (br);
|
||||
put_pixel (drawable, x2, y2, br);
|
||||
random_rgb (mm);
|
||||
put_pixel (drawable, (x1 + x2) / 2, (y1 + y2) / 2, mm);
|
||||
random_rgb (ml);
|
||||
put_pixel (drawable, x1, (y1 + y2) / 2, ml);
|
||||
random_rgb (mr);
|
||||
put_pixel (drawable, x2, (y1 + y2) / 2, mr);
|
||||
random_rgb (mt);
|
||||
put_pixel (drawable, (x1 + x2) / 2, y1, mt);
|
||||
random_rgb (ml);
|
||||
put_pixel (drawable, (x1 + x2) / 2, y2, ml);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -609,10 +601,10 @@ do_plasma (GDrawable *drawable,
|
|||
gdouble rnd;
|
||||
gint xave, yave;
|
||||
|
||||
get_pixel(drawable, x1, y1, tl);
|
||||
get_pixel(drawable, x1, y2, bl);
|
||||
get_pixel(drawable, x2, y1, tr);
|
||||
get_pixel(drawable, x2, y2, br);
|
||||
get_pixel (drawable, x1, y1, tl);
|
||||
get_pixel (drawable, x1, y2, bl);
|
||||
get_pixel (drawable, x2, y1, tr);
|
||||
get_pixel (drawable, x2, y2, br);
|
||||
|
||||
rnd = (256.0 / (2.0 * (gdouble)scale_depth)) * turbulence;
|
||||
ran = rnd;
|
||||
|
@ -628,16 +620,16 @@ do_plasma (GDrawable *drawable,
|
|||
if (xave != x1 || xave != x2)
|
||||
{
|
||||
/* Left. */
|
||||
AVE(ml, tl, bl);
|
||||
add_random(ml, ran);
|
||||
put_pixel(drawable, x1, yave, ml);
|
||||
AVE (ml, tl, bl);
|
||||
add_random (ml, ran);
|
||||
put_pixel (drawable, x1, yave, ml);
|
||||
|
||||
if (x1 != x2)
|
||||
{
|
||||
/* Right. */
|
||||
AVE(mr, tr, br);
|
||||
add_random(mr, ran);
|
||||
put_pixel(drawable, x2, yave, mr);
|
||||
AVE (mr, tr, br);
|
||||
add_random (mr, ran);
|
||||
put_pixel (drawable, x2, yave, mr);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -646,36 +638,36 @@ do_plasma (GDrawable *drawable,
|
|||
if (x1 != xave || yave != y2)
|
||||
{
|
||||
/* Bottom. */
|
||||
AVE(mb, bl, br);
|
||||
add_random(mb, ran);
|
||||
put_pixel(drawable, xave, y2, mb);
|
||||
AVE (mb, bl, br);
|
||||
add_random (mb, ran);
|
||||
put_pixel (drawable, xave, y2, mb);
|
||||
}
|
||||
|
||||
if (y1 != y2)
|
||||
{
|
||||
/* Top. */
|
||||
AVE(mt, tl, tr);
|
||||
add_random(mt, ran);
|
||||
put_pixel(drawable, xave, y1, mt);
|
||||
AVE (mt, tl, tr);
|
||||
add_random (mt, ran);
|
||||
put_pixel (drawable, xave, y1, mt);
|
||||
}
|
||||
}
|
||||
|
||||
if (y1 != y2 || x1 != x2)
|
||||
{
|
||||
/* Middle pixel. */
|
||||
AVE(mm, tl, br);
|
||||
AVE(tmp, bl, tr);
|
||||
AVE(mm, mm, tmp);
|
||||
AVE (mm, tl, br);
|
||||
AVE (tmp, bl, tr);
|
||||
AVE (mm, mm, tmp);
|
||||
|
||||
add_random(mm, ran);
|
||||
put_pixel(drawable, xave, yave, mm);
|
||||
add_random (mm, ran);
|
||||
put_pixel (drawable, xave, yave, mm);
|
||||
}
|
||||
|
||||
count ++;
|
||||
|
||||
if (!(count % 2000))
|
||||
{
|
||||
gimp_progress_update((double) progress / (double) max_progress);
|
||||
gimp_progress_update ((double) progress / (double) max_progress);
|
||||
}
|
||||
|
||||
if ((x2 - x1) < 3 && (y2 - y1) < 3)
|
||||
|
@ -689,11 +681,11 @@ do_plasma (GDrawable *drawable,
|
|||
ym = (y1 + y2) >> 1;
|
||||
|
||||
/* Top left. */
|
||||
do_plasma(drawable, x1, y1, xm, ym, depth - 1, scale_depth + 1);
|
||||
do_plasma (drawable, x1, y1, xm, ym, depth - 1, scale_depth + 1);
|
||||
/* Bottom left. */
|
||||
do_plasma(drawable, x1, ym, xm ,y2, depth - 1, scale_depth + 1);
|
||||
do_plasma (drawable, x1, ym, xm ,y2, depth - 1, scale_depth + 1);
|
||||
/* Top right. */
|
||||
do_plasma(drawable, xm, y1, x2 , ym, depth - 1, scale_depth + 1);
|
||||
do_plasma (drawable, xm, y1, x2 , ym, depth - 1, scale_depth + 1);
|
||||
/* Bottom right. */
|
||||
return do_plasma(drawable, xm, ym, x2, y2, depth - 1, scale_depth + 1);
|
||||
return do_plasma (drawable, xm, ym, x2, y2, depth - 1, scale_depth + 1);
|
||||
}
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
|
||||
#include "libgimp/stdplugins-intl.h"
|
||||
|
||||
|
||||
#define DBL_LIST_WIDTH 250
|
||||
#define DBL_WIDTH (DBL_LIST_WIDTH + 300)
|
||||
#define DBL_HEIGHT 200
|
||||
|
@ -515,7 +516,7 @@ procedure_clist_select_callback (GtkWidget *widget,
|
|||
|
||||
pinfo = (PInfo *) gtk_clist_get_row_data (GTK_CLIST (widget), row);
|
||||
|
||||
if(!pinfo)
|
||||
if (!pinfo)
|
||||
return FALSE;
|
||||
|
||||
/* Must select the correct one in the ctree structure */
|
||||
|
@ -977,16 +978,9 @@ gimp_plugin_desc (void)
|
|||
GtkWidget *button;
|
||||
GtkWidget *hbox, *searchhbox, *vbox;
|
||||
GtkWidget *label, *notebook, *swindow;
|
||||
gchar **argv;
|
||||
gint argc;
|
||||
gchar *clabels[4];
|
||||
|
||||
argc = 1;
|
||||
argv = g_new (gchar *, 1);
|
||||
argv[0] = g_strdup ("plugindetails");
|
||||
|
||||
gtk_init (&argc, &argv);
|
||||
gtk_rc_parse (gimp_gtkrc ());
|
||||
gimp_ui_init ("plugindetails", FALSE);
|
||||
|
||||
plugindesc = g_new0 (PDesc, 1);
|
||||
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
|
||||
#include "libgimp/stdplugins-intl.h"
|
||||
|
||||
|
||||
#define DBL_LIST_WIDTH 250
|
||||
#define DBL_WIDTH (DBL_LIST_WIDTH + 300)
|
||||
#define DBL_HEIGHT 200
|
||||
|
@ -515,7 +516,7 @@ procedure_clist_select_callback (GtkWidget *widget,
|
|||
|
||||
pinfo = (PInfo *) gtk_clist_get_row_data (GTK_CLIST (widget), row);
|
||||
|
||||
if(!pinfo)
|
||||
if (!pinfo)
|
||||
return FALSE;
|
||||
|
||||
/* Must select the correct one in the ctree structure */
|
||||
|
@ -977,16 +978,9 @@ gimp_plugin_desc (void)
|
|||
GtkWidget *button;
|
||||
GtkWidget *hbox, *searchhbox, *vbox;
|
||||
GtkWidget *label, *notebook, *swindow;
|
||||
gchar **argv;
|
||||
gint argc;
|
||||
gchar *clabels[4];
|
||||
|
||||
argc = 1;
|
||||
argv = g_new (gchar *, 1);
|
||||
argv[0] = g_strdup ("plugindetails");
|
||||
|
||||
gtk_init (&argc, &argv);
|
||||
gtk_rc_parse (gimp_gtkrc ());
|
||||
gimp_ui_init ("plugindetails", FALSE);
|
||||
|
||||
plugindesc = g_new0 (PDesc, 1);
|
||||
|
||||
|
|
|
@ -55,6 +55,7 @@
|
|||
|
||||
#include "libgimp/stdplugins-intl.h"
|
||||
|
||||
|
||||
/*
|
||||
* Constants...
|
||||
*/
|
||||
|
@ -97,7 +98,6 @@ static void respin_cmap (png_structp pp,
|
|||
png_infop info,
|
||||
gint32 image_ID);
|
||||
|
||||
static void init_gtk (void);
|
||||
static gint save_dialog (void);
|
||||
static void save_ok_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
|
@ -142,11 +142,11 @@ query (void)
|
|||
{
|
||||
{ PARAM_INT32, "run_mode", "Interactive, non-interactive" },
|
||||
{ PARAM_STRING, "filename", "The name of the file to load" },
|
||||
{ PARAM_STRING, "raw_filename", "The name of the file to load" },
|
||||
{ PARAM_STRING, "raw_filename", "The name of the file to load" }
|
||||
};
|
||||
static GParamDef load_return_vals[] =
|
||||
{
|
||||
{ PARAM_IMAGE, "image", "Output image" },
|
||||
{ PARAM_IMAGE, "image", "Output image" }
|
||||
};
|
||||
static gint nload_args = sizeof (load_args) / sizeof (load_args[0]);
|
||||
static gint nload_return_vals = (sizeof (load_return_vals) /
|
||||
|
@ -165,8 +165,6 @@ query (void)
|
|||
};
|
||||
static gint nsave_args = sizeof (save_args) / sizeof (save_args[0]);
|
||||
|
||||
INIT_I18N ();
|
||||
|
||||
gimp_install_procedure ("file_png_load",
|
||||
"Loads files in PNG file format",
|
||||
"This plug-in loads Portable Network Graphics (PNG) files.",
|
||||
|
@ -254,7 +252,7 @@ run (gchar *name,
|
|||
{
|
||||
case RUN_INTERACTIVE:
|
||||
case RUN_WITH_LAST_VALS:
|
||||
init_gtk ();
|
||||
gimp_ui_init ("png", FALSE);
|
||||
export = gimp_export_image (&image_ID, &drawable_ID, "PNG",
|
||||
(CAN_HANDLE_RGB |
|
||||
CAN_HANDLE_GRAY |
|
||||
|
@ -996,20 +994,6 @@ static void respin_cmap (png_structp pp, png_infop info, gint32 image_ID) {
|
|||
|
||||
}
|
||||
|
||||
static void
|
||||
init_gtk (void)
|
||||
{
|
||||
gchar **argv;
|
||||
gint argc;
|
||||
|
||||
argc = 1;
|
||||
argv = g_new (gchar *, 1);
|
||||
argv[0] = g_strdup ("png");
|
||||
|
||||
gtk_init (&argc, &argv);
|
||||
gtk_rc_parse (gimp_gtkrc ());
|
||||
}
|
||||
|
||||
static gint
|
||||
save_dialog (void)
|
||||
{
|
||||
|
|
|
@ -47,6 +47,7 @@
|
|||
|
||||
#include "libgimp/stdplugins-intl.h"
|
||||
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
#include <io.h>
|
||||
#endif
|
||||
|
@ -125,7 +126,6 @@ static gint save_image (gchar *filename,
|
|||
gint32 image_ID,
|
||||
gint32 drawable_ID);
|
||||
|
||||
static void init_gtk (void);
|
||||
static gint save_dialog (void);
|
||||
static void save_ok_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
|
@ -217,11 +217,11 @@ query (void)
|
|||
{
|
||||
{ PARAM_INT32, "run_mode", "Interactive, non-interactive" },
|
||||
{ PARAM_STRING, "filename", "The name of the file to load" },
|
||||
{ PARAM_STRING, "raw_filename", "The name of the file to load" },
|
||||
{ PARAM_STRING, "raw_filename", "The name of the file to load" }
|
||||
};
|
||||
static GParamDef load_return_vals[] =
|
||||
{
|
||||
{ PARAM_IMAGE, "image", "Output image" },
|
||||
{ PARAM_IMAGE, "image", "Output image" }
|
||||
};
|
||||
static gint nload_args = sizeof (load_args) / sizeof (load_args[0]);
|
||||
static gint nload_return_vals = (sizeof (load_return_vals) /
|
||||
|
@ -238,8 +238,6 @@ query (void)
|
|||
};
|
||||
static gint nsave_args = sizeof (save_args) / sizeof (save_args[0]);
|
||||
|
||||
INIT_I18N();
|
||||
|
||||
gimp_install_procedure ("file_pnm_load",
|
||||
"loads files of the pnm file format",
|
||||
"FIXME: write help for pnm_load",
|
||||
|
@ -329,7 +327,7 @@ run (gchar *name,
|
|||
{
|
||||
case RUN_INTERACTIVE:
|
||||
case RUN_WITH_LAST_VALS:
|
||||
init_gtk ();
|
||||
gimp_ui_init ("pnm", FALSE);
|
||||
export = gimp_export_image (&image_ID, &drawable_ID, "PNM",
|
||||
(CAN_HANDLE_RGB |
|
||||
CAN_HANDLE_GRAY |
|
||||
|
@ -921,21 +919,6 @@ save_image (gchar *filename,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
init_gtk (void)
|
||||
{
|
||||
gchar **argv;
|
||||
gint argc;
|
||||
|
||||
argc = 1;
|
||||
argv = g_new (gchar *, 1);
|
||||
argv[0] = g_strdup ("pnm");
|
||||
|
||||
gtk_init (&argc, &argv);
|
||||
gtk_rc_parse (gimp_gtkrc ());
|
||||
}
|
||||
|
||||
static gint
|
||||
save_dialog (void)
|
||||
{
|
||||
|
|
|
@ -71,6 +71,7 @@
|
|||
|
||||
#include "libgimp/stdplugins-intl.h"
|
||||
|
||||
|
||||
#define WITHIN(a, b, c) ((((a) <= (b)) && ((b) <= (c))) ? 1 : 0)
|
||||
|
||||
|
||||
|
@ -200,12 +201,10 @@ query (void)
|
|||
{ PARAM_FLOAT, "angle", "Offset angle" },
|
||||
{ PARAM_INT32, "backwards", "Map backwards?" },
|
||||
{ PARAM_INT32, "inverse", "Map from top?" },
|
||||
{ PARAM_INT32, "polrec", "Polar to rectangular?" },
|
||||
{ PARAM_INT32, "polrec", "Polar to rectangular?" }
|
||||
};
|
||||
static gint nargs = sizeof (args) / sizeof (args[0]);
|
||||
|
||||
INIT_I18N();
|
||||
|
||||
gimp_install_procedure (PLUG_IN_NAME,
|
||||
"Converts and image to and from polar coords",
|
||||
"Remaps and image from rectangular coordinates to polar coordinates "
|
||||
|
@ -245,14 +244,14 @@ run (gchar *name,
|
|||
|
||||
/* Get the active drawable info */
|
||||
|
||||
drawable = gimp_drawable_get(param[2].data.d_drawable);
|
||||
drawable = gimp_drawable_get (param[2].data.d_drawable);
|
||||
|
||||
img_width = gimp_drawable_width(drawable->id);
|
||||
img_height = gimp_drawable_height(drawable->id);
|
||||
img_bpp = gimp_drawable_bpp(drawable->id);
|
||||
img_has_alpha = gimp_drawable_has_alpha(drawable->id);
|
||||
img_width = gimp_drawable_width (drawable->id);
|
||||
img_height = gimp_drawable_height (drawable->id);
|
||||
img_bpp = gimp_drawable_bpp (drawable->id);
|
||||
img_has_alpha = gimp_drawable_has_alpha (drawable->id);
|
||||
|
||||
gimp_drawable_mask_bounds(drawable->id, &sel_x1, &sel_y1, &sel_x2, &sel_y2);
|
||||
gimp_drawable_mask_bounds (drawable->id, &sel_x1, &sel_y1, &sel_x2, &sel_y2);
|
||||
|
||||
/* Calculate scaling parameters */
|
||||
|
||||
|
@ -285,17 +284,17 @@ run (gchar *name,
|
|||
|
||||
if (sel_width > sel_height)
|
||||
{
|
||||
pwidth = MIN(sel_width, PREVIEW_SIZE);
|
||||
pwidth = MIN (sel_width, PREVIEW_SIZE);
|
||||
pheight = sel_height * pwidth / sel_width;
|
||||
}
|
||||
else
|
||||
{
|
||||
pheight = MIN(sel_height, PREVIEW_SIZE);
|
||||
pheight = MIN (sel_height, PREVIEW_SIZE);
|
||||
pwidth = sel_width * pheight / sel_height;
|
||||
}
|
||||
|
||||
preview_width = MAX(pwidth, 2); /* Min size is 2 */
|
||||
preview_height = MAX(pheight, 2);
|
||||
preview_width = MAX (pwidth, 2); /* Min size is 2 */
|
||||
preview_height = MAX (pheight, 2);
|
||||
|
||||
/* See how we will run */
|
||||
|
||||
|
@ -305,10 +304,10 @@ run (gchar *name,
|
|||
INIT_I18N_UI();
|
||||
|
||||
/* Possibly retrieve data */
|
||||
gimp_get_data(PLUG_IN_NAME, &pcvals);
|
||||
gimp_get_data (PLUG_IN_NAME, &pcvals);
|
||||
|
||||
/* Get information from the dialog */
|
||||
if (!polarize_dialog())
|
||||
if (!polarize_dialog ())
|
||||
return;
|
||||
|
||||
break;
|
||||
|
@ -335,7 +334,7 @@ run (gchar *name,
|
|||
INIT_I18N();
|
||||
|
||||
/* Possibly retrieve data */
|
||||
gimp_get_data(PLUG_IN_NAME, &pcvals);
|
||||
gimp_get_data (PLUG_IN_NAME, &pcvals);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -344,53 +343,49 @@ run (gchar *name,
|
|||
|
||||
/* Distort the image */
|
||||
if ((status == STATUS_SUCCESS) &&
|
||||
(gimp_drawable_is_rgb(drawable->id) ||
|
||||
gimp_drawable_is_gray(drawable->id)))
|
||||
(gimp_drawable_is_rgb (drawable->id) ||
|
||||
gimp_drawable_is_gray (drawable->id)))
|
||||
{
|
||||
/* Set the tile cache size */
|
||||
gimp_tile_cache_ntiles(2 * (drawable->width + gimp_tile_width() - 1) / gimp_tile_width());
|
||||
gimp_tile_cache_ntiles (2 * (drawable->width + gimp_tile_width() - 1) /
|
||||
gimp_tile_width ());
|
||||
|
||||
/* Run! */
|
||||
polarize();
|
||||
polarize ();
|
||||
|
||||
/* If run mode is interactive, flush displays */
|
||||
if (run_mode != RUN_NONINTERACTIVE)
|
||||
gimp_displays_flush();
|
||||
gimp_displays_flush ();
|
||||
|
||||
/* Store data */
|
||||
if (run_mode == RUN_INTERACTIVE)
|
||||
gimp_set_data(PLUG_IN_NAME, &pcvals, sizeof(polarize_vals_t));
|
||||
gimp_set_data (PLUG_IN_NAME, &pcvals, sizeof (polarize_vals_t));
|
||||
}
|
||||
else if (status == STATUS_SUCCESS)
|
||||
status = STATUS_EXECUTION_ERROR;
|
||||
|
||||
values[0].data.d_status = status;
|
||||
|
||||
gimp_drawable_detach(drawable);
|
||||
gimp_drawable_detach (drawable);
|
||||
}
|
||||
|
||||
static void
|
||||
polarize (void)
|
||||
{
|
||||
GPixelRgn dest_rgn;
|
||||
guchar *dest, *d;
|
||||
guchar pixel[4][4];
|
||||
guchar pixel2[4];
|
||||
guchar values[4];
|
||||
gint progress, max_progress;
|
||||
double cx, cy;
|
||||
guchar bg_color[4];
|
||||
gint x1, y1, x2, y2;
|
||||
gint x, y, b;
|
||||
gpointer pr;
|
||||
GPixelRgn dest_rgn;
|
||||
guchar *dest, *d;
|
||||
guchar pixel[4][4];
|
||||
guchar pixel2[4];
|
||||
guchar values[4];
|
||||
gint progress, max_progress;
|
||||
double cx, cy;
|
||||
guchar bg_color[4];
|
||||
gint x1, y1, x2, y2;
|
||||
gint x, y, b;
|
||||
gpointer pr;
|
||||
|
||||
pixel_fetcher_t *pft;
|
||||
|
||||
#if 0
|
||||
printf("Waiting... (pid %d)\n", getpid());
|
||||
kill(getpid(), SIGSTOP);
|
||||
#endif
|
||||
|
||||
/* Get selection area */
|
||||
gimp_drawable_mask_bounds (drawable->id, &x1, &y1, &x2, &y2);
|
||||
|
||||
|
@ -398,16 +393,16 @@ polarize (void)
|
|||
gimp_pixel_rgn_init (&dest_rgn, drawable,
|
||||
x1, y1, (x2 - x1), (y2 - y1), TRUE, TRUE);
|
||||
|
||||
pft = pixel_fetcher_new(drawable);
|
||||
pft = pixel_fetcher_new (drawable);
|
||||
|
||||
gimp_palette_get_background(&bg_color[0], &bg_color[1], &bg_color[2]);
|
||||
pixel_fetcher_set_bg_color(pft, bg_color[0], bg_color[1], bg_color[2],
|
||||
(img_has_alpha ? 0 : 255));
|
||||
gimp_palette_get_background (&bg_color[0], &bg_color[1], &bg_color[2]);
|
||||
pixel_fetcher_set_bg_color (pft, bg_color[0], bg_color[1], bg_color[2],
|
||||
(img_has_alpha ? 0 : 255));
|
||||
|
||||
progress = 0;
|
||||
max_progress = img_width * img_height;
|
||||
|
||||
gimp_progress_init( _("Polarizing..."));
|
||||
gimp_progress_init (_("Polarizing..."));
|
||||
|
||||
for (pr = gimp_pixel_rgns_register (1, &dest_rgn);
|
||||
pr != NULL;
|
||||
|
@ -421,12 +416,12 @@ polarize (void)
|
|||
|
||||
for (x = dest_rgn.x; x < (dest_rgn.x + dest_rgn.w); x++)
|
||||
{
|
||||
if (calc_undistorted_coords(x, y, &cx, &cy))
|
||||
if (calc_undistorted_coords (x, y, &cx, &cy))
|
||||
{
|
||||
pixel_fetcher_get_pixel(pft, cx, cy, pixel[0]);
|
||||
pixel_fetcher_get_pixel(pft, cx + 1, cy, pixel[1]);
|
||||
pixel_fetcher_get_pixel(pft, cx, cy + 1, pixel[2]);
|
||||
pixel_fetcher_get_pixel(pft, cx + 1, cy + 1, pixel[3]);
|
||||
pixel_fetcher_get_pixel (pft, cx, cy, pixel[0]);
|
||||
pixel_fetcher_get_pixel (pft, cx + 1, cy, pixel[1]);
|
||||
pixel_fetcher_get_pixel (pft, cx, cy + 1, pixel[2]);
|
||||
pixel_fetcher_get_pixel (pft, cx + 1, cy + 1, pixel[3]);
|
||||
|
||||
for (b = 0; b < img_bpp; b++)
|
||||
{
|
||||
|
@ -435,12 +430,12 @@ polarize (void)
|
|||
values[2] = pixel[2][b];
|
||||
values[3] = pixel[3][b];
|
||||
|
||||
d[b] = bilinear(cx, cy, values);
|
||||
d[b] = bilinear (cx, cy, values);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
pixel_fetcher_get_pixel(pft, x, y, pixel2);
|
||||
pixel_fetcher_get_pixel (pft, x, y, pixel2);
|
||||
for (b = 0; b < img_bpp; b++)
|
||||
{
|
||||
d[b] = 255;
|
||||
|
@ -453,32 +448,32 @@ polarize (void)
|
|||
dest += dest_rgn.rowstride;
|
||||
}
|
||||
progress += dest_rgn.w *dest_rgn.h;
|
||||
|
||||
gimp_progress_update((double) progress / max_progress);
|
||||
|
||||
gimp_progress_update ((double) progress / max_progress);
|
||||
}
|
||||
|
||||
gimp_drawable_flush(drawable);
|
||||
gimp_drawable_merge_shadow(drawable->id, TRUE);
|
||||
gimp_drawable_update(drawable->id, x1, y1, (x2 - x1), (y2 - y1));
|
||||
gimp_drawable_flush (drawable);
|
||||
gimp_drawable_merge_shadow (drawable->id, TRUE);
|
||||
gimp_drawable_update (drawable->id, x1, y1, (x2 - x1), (y2 - y1));
|
||||
}
|
||||
|
||||
static gint
|
||||
calc_undistorted_coords (double wx,
|
||||
double wy,
|
||||
double *x,
|
||||
double *y)
|
||||
calc_undistorted_coords (gdouble wx,
|
||||
gdouble wy,
|
||||
gdouble *x,
|
||||
gdouble *y)
|
||||
{
|
||||
int inside;
|
||||
double phi, phi2;
|
||||
double xx, xm, ym, yy;
|
||||
int xdiff, ydiff;
|
||||
double r;
|
||||
double m;
|
||||
double xmax, ymax, rmax;
|
||||
double x_calc, y_calc;
|
||||
double xi, yi;
|
||||
double circle, angl, t, angle;
|
||||
int x1, x2, y1, y2;
|
||||
gint inside;
|
||||
gdouble phi, phi2;
|
||||
gdouble xx, xm, ym, yy;
|
||||
gint xdiff, ydiff;
|
||||
gdouble r;
|
||||
gdouble m;
|
||||
gdouble xmax, ymax, rmax;
|
||||
gdouble x_calc, y_calc;
|
||||
gdouble xi, yi;
|
||||
gdouble circle, angl, t, angle;
|
||||
gint x1, x2, y1, y2;
|
||||
|
||||
/* initialize */
|
||||
|
||||
|
@ -697,14 +692,14 @@ calc_undistorted_coords (double wx,
|
|||
}
|
||||
|
||||
static guchar
|
||||
bilinear (double x,
|
||||
double y,
|
||||
bilinear (gdouble x,
|
||||
gdouble y,
|
||||
guchar *values)
|
||||
{
|
||||
double m0, m1;
|
||||
gdouble m0, m1;
|
||||
|
||||
x = fmod(x, 1.0);
|
||||
y = fmod(y, 1.0);
|
||||
x = fmod (x, 1.0);
|
||||
y = fmod (y, 1.0);
|
||||
|
||||
if (x < 0.0)
|
||||
x += 1.0;
|
||||
|
@ -723,16 +718,16 @@ pixel_fetcher_new (GDrawable *drawable)
|
|||
{
|
||||
pixel_fetcher_t *pf;
|
||||
|
||||
pf = g_malloc(sizeof(pixel_fetcher_t));
|
||||
pf = g_new (pixel_fetcher_t, 1);
|
||||
|
||||
pf->col = -1;
|
||||
pf->row = -1;
|
||||
pf->img_width = gimp_drawable_width(drawable->id);
|
||||
pf->img_height = gimp_drawable_height(drawable->id);
|
||||
pf->img_bpp = gimp_drawable_bpp(drawable->id);
|
||||
pf->img_has_alpha = gimp_drawable_has_alpha(drawable->id);
|
||||
pf->tile_width = gimp_tile_width();
|
||||
pf->tile_height = gimp_tile_height();
|
||||
pf->img_width = gimp_drawable_width (drawable->id);
|
||||
pf->img_height = gimp_drawable_height (drawable->id);
|
||||
pf->img_bpp = gimp_drawable_bpp (drawable->id);
|
||||
pf->img_has_alpha = gimp_drawable_has_alpha (drawable->id);
|
||||
pf->tile_width = gimp_tile_width ();
|
||||
pf->tile_height = gimp_tile_height ();
|
||||
pf->bg_color[0] = 0;
|
||||
pf->bg_color[1] = 0;
|
||||
pf->bg_color[2] = 0;
|
||||
|
@ -761,14 +756,14 @@ pixel_fetcher_set_bg_color (pixel_fetcher_t *pf,
|
|||
|
||||
static void
|
||||
pixel_fetcher_get_pixel (pixel_fetcher_t *pf,
|
||||
int x,
|
||||
int y,
|
||||
gint x,
|
||||
gint y,
|
||||
guchar *pixel)
|
||||
{
|
||||
gint col, row;
|
||||
gint coloff, rowoff;
|
||||
guchar *p;
|
||||
int i;
|
||||
gint i;
|
||||
|
||||
if ((x < sel_x1) || (x >= sel_x2) ||
|
||||
(y < sel_y1) || (y >= sel_y2))
|
||||
|
@ -791,8 +786,8 @@ pixel_fetcher_get_pixel (pixel_fetcher_t *pf,
|
|||
if (pf->tile != NULL)
|
||||
gimp_tile_unref(pf->tile, FALSE);
|
||||
|
||||
pf->tile = gimp_drawable_get_tile(pf->drawable, FALSE, row, col);
|
||||
gimp_tile_ref(pf->tile);
|
||||
pf->tile = gimp_drawable_get_tile (pf->drawable, FALSE, row, col);
|
||||
gimp_tile_ref (pf->tile);
|
||||
|
||||
pf->col = col;
|
||||
pf->row = row;
|
||||
|
@ -816,18 +811,18 @@ pixel_fetcher_destroy (pixel_fetcher_t *pf)
|
|||
static void
|
||||
build_preview_source_image (void)
|
||||
{
|
||||
double left, right, bottom, top;
|
||||
double px, py;
|
||||
double dx, dy;
|
||||
int x, y;
|
||||
gdouble left, right, bottom, top;
|
||||
gdouble px, py;
|
||||
gdouble dx, dy;
|
||||
gint x, y;
|
||||
guchar *p;
|
||||
guchar pixel[4];
|
||||
pixel_fetcher_t *pf;
|
||||
|
||||
pcint.check_row_0 = g_malloc(preview_width * sizeof(guchar));
|
||||
pcint.check_row_1 = g_malloc(preview_width * sizeof(guchar));
|
||||
pcint.image = g_malloc(preview_width * preview_height * 4 * sizeof(guchar));
|
||||
pcint.dimage = g_malloc(preview_width * preview_height * 3 * sizeof(guchar));
|
||||
pcint.check_row_0 = g_new (guchar, preview_width);
|
||||
pcint.check_row_1 = g_new (guchar, preview_width);
|
||||
pcint.image = g_new (guchar, preview_width * preview_height * 4);
|
||||
pcint.dimage = g_new (guchar, preview_width * preview_height * 3);
|
||||
|
||||
left = sel_x1;
|
||||
right = sel_x2 - 1;
|
||||
|
@ -864,7 +859,7 @@ build_preview_source_image (void)
|
|||
|
||||
/* Thumbnail image */
|
||||
|
||||
pixel_fetcher_get_pixel(pf, (int) px, (int) py, pixel);
|
||||
pixel_fetcher_get_pixel (pf, (int) px, (int) py, pixel);
|
||||
|
||||
if (img_bpp < 3)
|
||||
{
|
||||
|
@ -890,7 +885,7 @@ build_preview_source_image (void)
|
|||
py += dy;
|
||||
}
|
||||
|
||||
pixel_fetcher_destroy(pf);
|
||||
pixel_fetcher_destroy (pf);
|
||||
}
|
||||
|
||||
static gint
|
||||
|
@ -906,32 +901,8 @@ polarize_dialog (void)
|
|||
GtkWidget *toggle;
|
||||
GtkWidget *hbox;
|
||||
GtkObject *adj;
|
||||
gint argc;
|
||||
gchar **argv;
|
||||
guchar *color_cube;
|
||||
|
||||
#if 0
|
||||
g_print ("Waiting... (pid %d)\n", getpid ());
|
||||
kill (getpid (), SIGSTOP);
|
||||
#endif
|
||||
|
||||
argc = 1;
|
||||
argv = g_new (gchar *, 1);
|
||||
argv[0] = g_strdup ("polarize");
|
||||
|
||||
gtk_init (&argc, &argv);
|
||||
gtk_rc_parse (gimp_gtkrc ());
|
||||
|
||||
gdk_set_use_xshm (gimp_use_xshm ());
|
||||
|
||||
gtk_preview_set_gamma (gimp_gamma ());
|
||||
gtk_preview_set_install_cmap (gimp_install_cmap ());
|
||||
color_cube = gimp_color_cube ();
|
||||
gtk_preview_set_color_cube (color_cube[0], color_cube[1],
|
||||
color_cube[2], color_cube[3]);
|
||||
|
||||
gtk_widget_set_default_visual (gtk_preview_get_visual ());
|
||||
gtk_widget_set_default_colormap (gtk_preview_get_cmap ());
|
||||
gimp_ui_init ("polar", TRUE);
|
||||
|
||||
build_preview_source_image ();
|
||||
|
||||
|
@ -1078,19 +1049,19 @@ polarize_dialog (void)
|
|||
static void
|
||||
dialog_update_preview (void)
|
||||
{
|
||||
double left, right, bottom, top;
|
||||
double dx, dy;
|
||||
double px, py;
|
||||
double cx = 0.0, cy = 0.0;
|
||||
int ix, iy;
|
||||
int x, y;
|
||||
double scale_x, scale_y;
|
||||
guchar *p_ul, *i, *p;
|
||||
guchar *check_ul;
|
||||
int check;
|
||||
guchar outside[4];
|
||||
gdouble left, right, bottom, top;
|
||||
gdouble dx, dy;
|
||||
gdouble px, py;
|
||||
gdouble cx = 0.0, cy = 0.0;
|
||||
gint ix, iy;
|
||||
gint x, y;
|
||||
gdouble scale_x, scale_y;
|
||||
guchar *p_ul, *i, *p;
|
||||
guchar *check_ul;
|
||||
gint check;
|
||||
guchar outside[4];
|
||||
|
||||
gimp_palette_get_background(&outside[0], &outside[1], &outside[2]);
|
||||
gimp_palette_get_background (&outside[0], &outside[1], &outside[2]);
|
||||
outside[3] = (img_has_alpha ? 0 : 255);
|
||||
|
||||
if (img_bpp < 3)
|
||||
|
@ -1126,7 +1097,7 @@ dialog_update_preview (void)
|
|||
|
||||
for (x = 0; x < preview_width; x++)
|
||||
{
|
||||
calc_undistorted_coords(px, py, &cx, &cy);
|
||||
calc_undistorted_coords (px, py, &cx, &cy);
|
||||
|
||||
cx = (cx - left) * scale_x;
|
||||
cy = (cy - top) * scale_y;
|
||||
|
@ -1158,13 +1129,13 @@ dialog_update_preview (void)
|
|||
|
||||
for (y = 0; y < img_height; y++)
|
||||
{
|
||||
gtk_preview_draw_row(GTK_PREVIEW(pcint.preview), p, 0, y, preview_width);
|
||||
gtk_preview_draw_row (GTK_PREVIEW (pcint.preview), p, 0, y, preview_width);
|
||||
|
||||
p += preview_width * 3;
|
||||
}
|
||||
|
||||
gtk_widget_draw(pcint.preview, NULL);
|
||||
gdk_flush();
|
||||
gtk_widget_draw (pcint.preview, NULL);
|
||||
gdk_flush ();
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -73,6 +73,7 @@ static char ident[] = "@(#) GIMP PostScript/PDF file-plugin v1.10 15-Mar-2000";
|
|||
|
||||
#include "libgimp/stdplugins-intl.h"
|
||||
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
#include <process.h> /* For _getpid() */
|
||||
|
||||
|
@ -239,8 +240,6 @@ static void dither_grey (guchar *grey,
|
|||
|
||||
/* Dialog-handling */
|
||||
|
||||
static void init_gtk (void);
|
||||
|
||||
static gint load_dialog (void);
|
||||
static void load_ok_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
|
@ -550,8 +549,6 @@ query (void)
|
|||
};
|
||||
static gint nsave_args = sizeof (save_args) / sizeof (save_args[0]);
|
||||
|
||||
INIT_I18N();
|
||||
|
||||
gimp_install_procedure ("file_ps_load",
|
||||
"load file of PostScript/PDF file format",
|
||||
"load file of PostScript/PDF file format",
|
||||
|
@ -725,7 +722,7 @@ run (gchar *name,
|
|||
{
|
||||
case RUN_INTERACTIVE:
|
||||
case RUN_WITH_LAST_VALS:
|
||||
init_gtk ();
|
||||
gimp_ui_init ("ps", FALSE);
|
||||
export = gimp_export_image (&image_ID, &drawable_ID, "PS",
|
||||
(CAN_HANDLE_RGB |
|
||||
CAN_HANDLE_GRAY |
|
||||
|
@ -2510,20 +2507,6 @@ save_rgb (FILE *ofp,
|
|||
#undef GET_RGB_TILE
|
||||
}
|
||||
|
||||
static void
|
||||
init_gtk (void)
|
||||
{
|
||||
gchar **argv;
|
||||
gint argc;
|
||||
|
||||
argc = 1;
|
||||
argv = g_new (gchar *, 1);
|
||||
argv[0] = g_strdup ("ps");
|
||||
|
||||
gtk_init (&argc, &argv);
|
||||
gtk_rc_parse (gimp_gtkrc ());
|
||||
}
|
||||
|
||||
/* Load interface functions */
|
||||
|
||||
static gint
|
||||
|
@ -2540,7 +2523,7 @@ load_dialog (void)
|
|||
GtkWidget *pages_entry;
|
||||
GtkWidget *toggle;
|
||||
|
||||
init_gtk ();
|
||||
gimp_ui_init ("ps", FALSE);
|
||||
|
||||
dialog = gimp_dialog_new (_("Load PostScript"), "ps",
|
||||
gimp_plugin_help_func, "filters/ps.html",
|
||||
|
|
|
@ -73,6 +73,7 @@ static char ident[] = "@(#) GIMP PostScript/PDF file-plugin v1.10 15-Mar-2000";
|
|||
|
||||
#include "libgimp/stdplugins-intl.h"
|
||||
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
#include <process.h> /* For _getpid() */
|
||||
|
||||
|
@ -239,8 +240,6 @@ static void dither_grey (guchar *grey,
|
|||
|
||||
/* Dialog-handling */
|
||||
|
||||
static void init_gtk (void);
|
||||
|
||||
static gint load_dialog (void);
|
||||
static void load_ok_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
|
@ -550,8 +549,6 @@ query (void)
|
|||
};
|
||||
static gint nsave_args = sizeof (save_args) / sizeof (save_args[0]);
|
||||
|
||||
INIT_I18N();
|
||||
|
||||
gimp_install_procedure ("file_ps_load",
|
||||
"load file of PostScript/PDF file format",
|
||||
"load file of PostScript/PDF file format",
|
||||
|
@ -725,7 +722,7 @@ run (gchar *name,
|
|||
{
|
||||
case RUN_INTERACTIVE:
|
||||
case RUN_WITH_LAST_VALS:
|
||||
init_gtk ();
|
||||
gimp_ui_init ("ps", FALSE);
|
||||
export = gimp_export_image (&image_ID, &drawable_ID, "PS",
|
||||
(CAN_HANDLE_RGB |
|
||||
CAN_HANDLE_GRAY |
|
||||
|
@ -2510,20 +2507,6 @@ save_rgb (FILE *ofp,
|
|||
#undef GET_RGB_TILE
|
||||
}
|
||||
|
||||
static void
|
||||
init_gtk (void)
|
||||
{
|
||||
gchar **argv;
|
||||
gint argc;
|
||||
|
||||
argc = 1;
|
||||
argv = g_new (gchar *, 1);
|
||||
argv[0] = g_strdup ("ps");
|
||||
|
||||
gtk_init (&argc, &argv);
|
||||
gtk_rc_parse (gimp_gtkrc ());
|
||||
}
|
||||
|
||||
/* Load interface functions */
|
||||
|
||||
static gint
|
||||
|
@ -2540,7 +2523,7 @@ load_dialog (void)
|
|||
GtkWidget *pages_entry;
|
||||
GtkWidget *toggle;
|
||||
|
||||
init_gtk ();
|
||||
gimp_ui_init ("ps", FALSE);
|
||||
|
||||
dialog = gimp_dialog_new (_("Load PostScript"), "ps",
|
||||
gimp_plugin_help_func, "filters/ps.html",
|
||||
|
|
|
@ -154,9 +154,12 @@
|
|||
#include <string.h>
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
#include <libgimp/gimp.h>
|
||||
|
||||
#include "libgimp/stdplugins-intl.h"
|
||||
|
||||
|
||||
/* Local types etc
|
||||
*/
|
||||
typedef enum
|
||||
|
@ -307,35 +310,37 @@ GPlugInInfo PLUG_IN_INFO =
|
|||
static PSDimage psd_image;
|
||||
|
||||
|
||||
static struct {
|
||||
gchar signature[4];
|
||||
gushort version;
|
||||
guchar reserved[6];
|
||||
gushort channels;
|
||||
gulong rows;
|
||||
gulong columns;
|
||||
gushort bpp;
|
||||
gushort mode;
|
||||
gulong imgreslen;
|
||||
gulong miscsizelen;
|
||||
gushort compression;
|
||||
gushort * rowlength;
|
||||
long imgdatalen;
|
||||
static struct
|
||||
{
|
||||
gchar signature[4];
|
||||
gushort version;
|
||||
guchar reserved[6];
|
||||
gushort channels;
|
||||
gulong rows;
|
||||
gulong columns;
|
||||
gushort bpp;
|
||||
gushort mode;
|
||||
gulong imgreslen;
|
||||
gulong miscsizelen;
|
||||
gushort compression;
|
||||
gushort *rowlength;
|
||||
long imgdatalen;
|
||||
} PSDheader;
|
||||
|
||||
|
||||
static gchar * modename[] = {
|
||||
"Bitmap",
|
||||
"Grayscale",
|
||||
"Indexed Colour",
|
||||
"RGB Colour",
|
||||
"CMYK Colour",
|
||||
"<invalid>",
|
||||
"<invalid>",
|
||||
"Multichannel",
|
||||
"Duotone",
|
||||
"Lab Colour",
|
||||
"<invalid>"
|
||||
static gchar * modename[] =
|
||||
{
|
||||
"Bitmap",
|
||||
"Grayscale",
|
||||
"Indexed Colour",
|
||||
"RGB Colour",
|
||||
"CMYK Colour",
|
||||
"<invalid>",
|
||||
"<invalid>",
|
||||
"Multichannel",
|
||||
"Duotone",
|
||||
"Lab Colour",
|
||||
"<invalid>"
|
||||
};
|
||||
|
||||
|
||||
|
@ -369,26 +374,25 @@ static void dumpchunk(size_t n, FILE * fd, gchar *why);
|
|||
static void seek_to_and_unpack_pixeldata(FILE* fd, gint layeri, gint channeli);
|
||||
|
||||
|
||||
MAIN()
|
||||
MAIN ()
|
||||
|
||||
|
||||
static void
|
||||
query ()
|
||||
query (void)
|
||||
{
|
||||
static GParamDef load_args[] =
|
||||
{
|
||||
{ PARAM_INT32, "run_mode", "Interactive, non-interactive" },
|
||||
{ PARAM_STRING, "filename", "The name of the file to load" },
|
||||
{ PARAM_STRING, "raw_filename", "The name of the file to load" },
|
||||
{ PARAM_STRING, "raw_filename", "The name of the file to load" }
|
||||
};
|
||||
static GParamDef load_return_vals[] =
|
||||
{
|
||||
{ PARAM_IMAGE, "image", "Output image" },
|
||||
{ PARAM_IMAGE, "image", "Output image" }
|
||||
};
|
||||
static int nload_args = sizeof (load_args) / sizeof (load_args[0]);
|
||||
static int nload_return_vals = sizeof (load_return_vals) / sizeof (load_return_vals[0]);
|
||||
|
||||
INIT_I18N();
|
||||
static gint nload_args = sizeof (load_args) / sizeof (load_args[0]);
|
||||
static gint nload_return_vals = (sizeof (load_return_vals) /
|
||||
sizeof (load_return_vals[0]));
|
||||
|
||||
gimp_install_procedure ("file_psd_load",
|
||||
"loads files of the Photoshop(tm) PSD file format",
|
||||
|
@ -402,12 +406,13 @@ query ()
|
|||
nload_args, nload_return_vals,
|
||||
load_args, load_return_vals);
|
||||
|
||||
gimp_register_magic_load_handler ("file_psd_load", "psd", "",
|
||||
gimp_register_magic_load_handler ("file_psd_load",
|
||||
"psd",
|
||||
"",
|
||||
"0,string,8BPS");
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void
|
||||
run (char *name,
|
||||
int nparams,
|
||||
|
@ -561,7 +566,7 @@ psd_mode_to_gimp_base_type (gushort psdtype)
|
|||
|
||||
|
||||
static void
|
||||
reshuffle_cmap(guchar *map256)
|
||||
reshuffle_cmap (guchar *map256)
|
||||
{
|
||||
guchar *tmpmap;
|
||||
int i;
|
||||
|
|
|
@ -52,7 +52,8 @@
|
|||
#include <libgimp/gimpui.h>
|
||||
#include <libgimp/parasiteio.h>
|
||||
|
||||
#include <libgimp/stdplugins-intl.h>
|
||||
#include "libgimp/stdplugins-intl.h"
|
||||
|
||||
|
||||
/* Note that the upcoming PSP version 6 writes PSP file format version
|
||||
* 4.0, but the documentation for that apparently isn't publicly
|
||||
|
@ -330,7 +331,7 @@ static PSPSaveInterface psint =
|
|||
static guint16 major, minor;
|
||||
static guint tile_height;
|
||||
|
||||
MAIN()
|
||||
MAIN ()
|
||||
|
||||
static void
|
||||
query (void)
|
||||
|
@ -339,11 +340,11 @@ query (void)
|
|||
{
|
||||
{ PARAM_INT32, "run_mode", "Interactive, non-interactive" },
|
||||
{ PARAM_STRING, "filename", "The name of the file to load" },
|
||||
{ PARAM_STRING, "raw_filename", "The name of the file to load" },
|
||||
{ PARAM_STRING, "raw_filename", "The name of the file to load" }
|
||||
};
|
||||
static GParamDef load_return_vals[] =
|
||||
{
|
||||
{ PARAM_IMAGE, "image", "Output image" },
|
||||
{ PARAM_IMAGE, "image", "Output image" }
|
||||
};
|
||||
static gint nload_args = sizeof (load_args) / sizeof (load_args[0]);
|
||||
static gint nload_return_vals = (sizeof (load_return_vals) /
|
||||
|
@ -361,8 +362,6 @@ query (void)
|
|||
/* }; */
|
||||
/* static gint nsave_args = sizeof (save_args) / sizeof (save_args[0]); */
|
||||
|
||||
INIT_I18N();
|
||||
|
||||
gimp_install_procedure ("file_psp_load",
|
||||
"loads images from the Paint Shop Pro PSP file format",
|
||||
"This plug-in loads and saves images in "
|
||||
|
@ -415,20 +414,6 @@ save_ok_callback (GtkWidget *widget,
|
|||
gtk_widget_destroy (GTK_WIDGET (data));
|
||||
}
|
||||
|
||||
static void
|
||||
init_gtk (void)
|
||||
{
|
||||
gchar **argv;
|
||||
gint argc;
|
||||
|
||||
argc = 1;
|
||||
argv = g_new (gchar *, 1);
|
||||
argv[0] = g_strdup ("psp");
|
||||
|
||||
gtk_init (&argc, &argv);
|
||||
gtk_rc_parse (gimp_gtkrc ());
|
||||
}
|
||||
|
||||
static gint
|
||||
save_dialog (void)
|
||||
{
|
||||
|
@ -1742,7 +1727,7 @@ run (gchar *name,
|
|||
case RUN_INTERACTIVE:
|
||||
case RUN_WITH_LAST_VALS:
|
||||
INIT_I18N_UI();
|
||||
init_gtk ();
|
||||
gimp_ui_init ("psp", FALSE);
|
||||
export = gimp_export_image (&image_ID, &drawable_ID, "PSP",
|
||||
(CAN_HANDLE_RGB |
|
||||
CAN_HANDLE_GRAY |
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
|
||||
#include "libgimp/stdplugins-intl.h"
|
||||
|
||||
|
||||
#define DBL_LIST_WIDTH 250
|
||||
#define DBL_WIDTH (DBL_LIST_WIDTH + 300)
|
||||
#define DBL_HEIGHT 200
|
||||
|
@ -515,7 +516,7 @@ procedure_clist_select_callback (GtkWidget *widget,
|
|||
|
||||
pinfo = (PInfo *) gtk_clist_get_row_data (GTK_CLIST (widget), row);
|
||||
|
||||
if(!pinfo)
|
||||
if (!pinfo)
|
||||
return FALSE;
|
||||
|
||||
/* Must select the correct one in the ctree structure */
|
||||
|
@ -977,16 +978,9 @@ gimp_plugin_desc (void)
|
|||
GtkWidget *button;
|
||||
GtkWidget *hbox, *searchhbox, *vbox;
|
||||
GtkWidget *label, *notebook, *swindow;
|
||||
gchar **argv;
|
||||
gint argc;
|
||||
gchar *clabels[4];
|
||||
|
||||
argc = 1;
|
||||
argv = g_new (gchar *, 1);
|
||||
argv[0] = g_strdup ("plugindetails");
|
||||
|
||||
gtk_init (&argc, &argv);
|
||||
gtk_rc_parse (gimp_gtkrc ());
|
||||
gimp_ui_init ("plugindetails", FALSE);
|
||||
|
||||
plugindesc = g_new0 (PDesc, 1);
|
||||
|
||||
|
|
|
@ -126,6 +126,7 @@
|
|||
* pretty obscure Win32 compilation issues.
|
||||
*/
|
||||
#include <setjmp.h>
|
||||
#include <signal.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
@ -142,7 +143,6 @@
|
|||
|
||||
#include "libgimp/stdplugins-intl.h"
|
||||
|
||||
#include <signal.h>
|
||||
|
||||
#define SCALE_WIDTH 125
|
||||
|
||||
|
@ -229,7 +229,6 @@ static void add_menu_item (GtkWidget *menu,
|
|||
guint op_no,
|
||||
GtkSignalFunc callback);
|
||||
|
||||
static void init_gtk (void);
|
||||
static gint save_dialog (void);
|
||||
|
||||
static void save_close_callback (GtkWidget *widget,
|
||||
|
@ -289,11 +288,11 @@ query (void)
|
|||
{
|
||||
{ PARAM_INT32, "run_mode", "Interactive, non-interactive" },
|
||||
{ PARAM_STRING, "filename", "The name of the file to load" },
|
||||
{ PARAM_STRING, "raw_filename", "The name of the file to load" },
|
||||
{ PARAM_STRING, "raw_filename", "The name of the file to load" }
|
||||
};
|
||||
static GParamDef load_return_vals[] =
|
||||
{
|
||||
{ PARAM_IMAGE, "image", "Output image" },
|
||||
{ PARAM_IMAGE, "image", "Output image" }
|
||||
};
|
||||
static gint nload_args = sizeof (load_args) / sizeof (load_args[0]);
|
||||
static gint nload_return_vals = (sizeof (load_return_vals) /
|
||||
|
@ -318,8 +317,6 @@ query (void)
|
|||
};
|
||||
static gint nsave_args = sizeof (save_args) / sizeof (save_args[0]);
|
||||
|
||||
INIT_I18N();
|
||||
|
||||
gimp_install_procedure ("file_jpeg_load",
|
||||
"loads files in the JPEG file format",
|
||||
"loads files in the JPEG file format",
|
||||
|
@ -409,7 +406,7 @@ run (gchar *name,
|
|||
{
|
||||
case RUN_INTERACTIVE:
|
||||
case RUN_WITH_LAST_VALS:
|
||||
init_gtk ();
|
||||
gimp_ui_init ("jpeg", FALSE);
|
||||
export = gimp_export_image (&image_ID, &drawable_ID, "JPEG",
|
||||
(CAN_HANDLE_RGB |
|
||||
CAN_HANDLE_GRAY));
|
||||
|
@ -1554,20 +1551,6 @@ add_menu_item (GtkWidget *menu,
|
|||
gtk_widget_show (menu_item);
|
||||
}
|
||||
|
||||
static void
|
||||
init_gtk (void)
|
||||
{
|
||||
gchar **argv;
|
||||
gint argc;
|
||||
|
||||
argc = 1;
|
||||
argv = g_new (gchar *, 1);
|
||||
argv[0] = g_strdup ("jpeg");
|
||||
|
||||
gtk_init (&argc, &argv);
|
||||
gtk_rc_parse (gimp_gtkrc ());
|
||||
}
|
||||
|
||||
static gint
|
||||
save_dialog (void)
|
||||
{
|
||||
|
|
|
@ -126,6 +126,7 @@
|
|||
* pretty obscure Win32 compilation issues.
|
||||
*/
|
||||
#include <setjmp.h>
|
||||
#include <signal.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
@ -142,7 +143,6 @@
|
|||
|
||||
#include "libgimp/stdplugins-intl.h"
|
||||
|
||||
#include <signal.h>
|
||||
|
||||
#define SCALE_WIDTH 125
|
||||
|
||||
|
@ -229,7 +229,6 @@ static void add_menu_item (GtkWidget *menu,
|
|||
guint op_no,
|
||||
GtkSignalFunc callback);
|
||||
|
||||
static void init_gtk (void);
|
||||
static gint save_dialog (void);
|
||||
|
||||
static void save_close_callback (GtkWidget *widget,
|
||||
|
@ -289,11 +288,11 @@ query (void)
|
|||
{
|
||||
{ PARAM_INT32, "run_mode", "Interactive, non-interactive" },
|
||||
{ PARAM_STRING, "filename", "The name of the file to load" },
|
||||
{ PARAM_STRING, "raw_filename", "The name of the file to load" },
|
||||
{ PARAM_STRING, "raw_filename", "The name of the file to load" }
|
||||
};
|
||||
static GParamDef load_return_vals[] =
|
||||
{
|
||||
{ PARAM_IMAGE, "image", "Output image" },
|
||||
{ PARAM_IMAGE, "image", "Output image" }
|
||||
};
|
||||
static gint nload_args = sizeof (load_args) / sizeof (load_args[0]);
|
||||
static gint nload_return_vals = (sizeof (load_return_vals) /
|
||||
|
@ -318,8 +317,6 @@ query (void)
|
|||
};
|
||||
static gint nsave_args = sizeof (save_args) / sizeof (save_args[0]);
|
||||
|
||||
INIT_I18N();
|
||||
|
||||
gimp_install_procedure ("file_jpeg_load",
|
||||
"loads files in the JPEG file format",
|
||||
"loads files in the JPEG file format",
|
||||
|
@ -409,7 +406,7 @@ run (gchar *name,
|
|||
{
|
||||
case RUN_INTERACTIVE:
|
||||
case RUN_WITH_LAST_VALS:
|
||||
init_gtk ();
|
||||
gimp_ui_init ("jpeg", FALSE);
|
||||
export = gimp_export_image (&image_ID, &drawable_ID, "JPEG",
|
||||
(CAN_HANDLE_RGB |
|
||||
CAN_HANDLE_GRAY));
|
||||
|
@ -1554,20 +1551,6 @@ add_menu_item (GtkWidget *menu,
|
|||
gtk_widget_show (menu_item);
|
||||
}
|
||||
|
||||
static void
|
||||
init_gtk (void)
|
||||
{
|
||||
gchar **argv;
|
||||
gint argc;
|
||||
|
||||
argc = 1;
|
||||
argv = g_new (gchar *, 1);
|
||||
argv[0] = g_strdup ("jpeg");
|
||||
|
||||
gtk_init (&argc, &argv);
|
||||
gtk_rc_parse (gimp_gtkrc ());
|
||||
}
|
||||
|
||||
static gint
|
||||
save_dialog (void)
|
||||
{
|
||||
|
|
|
@ -126,6 +126,7 @@
|
|||
* pretty obscure Win32 compilation issues.
|
||||
*/
|
||||
#include <setjmp.h>
|
||||
#include <signal.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
@ -142,7 +143,6 @@
|
|||
|
||||
#include "libgimp/stdplugins-intl.h"
|
||||
|
||||
#include <signal.h>
|
||||
|
||||
#define SCALE_WIDTH 125
|
||||
|
||||
|
@ -229,7 +229,6 @@ static void add_menu_item (GtkWidget *menu,
|
|||
guint op_no,
|
||||
GtkSignalFunc callback);
|
||||
|
||||
static void init_gtk (void);
|
||||
static gint save_dialog (void);
|
||||
|
||||
static void save_close_callback (GtkWidget *widget,
|
||||
|
@ -289,11 +288,11 @@ query (void)
|
|||
{
|
||||
{ PARAM_INT32, "run_mode", "Interactive, non-interactive" },
|
||||
{ PARAM_STRING, "filename", "The name of the file to load" },
|
||||
{ PARAM_STRING, "raw_filename", "The name of the file to load" },
|
||||
{ PARAM_STRING, "raw_filename", "The name of the file to load" }
|
||||
};
|
||||
static GParamDef load_return_vals[] =
|
||||
{
|
||||
{ PARAM_IMAGE, "image", "Output image" },
|
||||
{ PARAM_IMAGE, "image", "Output image" }
|
||||
};
|
||||
static gint nload_args = sizeof (load_args) / sizeof (load_args[0]);
|
||||
static gint nload_return_vals = (sizeof (load_return_vals) /
|
||||
|
@ -318,8 +317,6 @@ query (void)
|
|||
};
|
||||
static gint nsave_args = sizeof (save_args) / sizeof (save_args[0]);
|
||||
|
||||
INIT_I18N();
|
||||
|
||||
gimp_install_procedure ("file_jpeg_load",
|
||||
"loads files in the JPEG file format",
|
||||
"loads files in the JPEG file format",
|
||||
|
@ -409,7 +406,7 @@ run (gchar *name,
|
|||
{
|
||||
case RUN_INTERACTIVE:
|
||||
case RUN_WITH_LAST_VALS:
|
||||
init_gtk ();
|
||||
gimp_ui_init ("jpeg", FALSE);
|
||||
export = gimp_export_image (&image_ID, &drawable_ID, "JPEG",
|
||||
(CAN_HANDLE_RGB |
|
||||
CAN_HANDLE_GRAY));
|
||||
|
@ -1554,20 +1551,6 @@ add_menu_item (GtkWidget *menu,
|
|||
gtk_widget_show (menu_item);
|
||||
}
|
||||
|
||||
static void
|
||||
init_gtk (void)
|
||||
{
|
||||
gchar **argv;
|
||||
gint argc;
|
||||
|
||||
argc = 1;
|
||||
argv = g_new (gchar *, 1);
|
||||
argv[0] = g_strdup ("jpeg");
|
||||
|
||||
gtk_init (&argc, &argv);
|
||||
gtk_rc_parse (gimp_gtkrc ());
|
||||
}
|
||||
|
||||
static gint
|
||||
save_dialog (void)
|
||||
{
|
||||
|
|
|
@ -126,6 +126,7 @@
|
|||
* pretty obscure Win32 compilation issues.
|
||||
*/
|
||||
#include <setjmp.h>
|
||||
#include <signal.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
@ -142,7 +143,6 @@
|
|||
|
||||
#include "libgimp/stdplugins-intl.h"
|
||||
|
||||
#include <signal.h>
|
||||
|
||||
#define SCALE_WIDTH 125
|
||||
|
||||
|
@ -229,7 +229,6 @@ static void add_menu_item (GtkWidget *menu,
|
|||
guint op_no,
|
||||
GtkSignalFunc callback);
|
||||
|
||||
static void init_gtk (void);
|
||||
static gint save_dialog (void);
|
||||
|
||||
static void save_close_callback (GtkWidget *widget,
|
||||
|
@ -289,11 +288,11 @@ query (void)
|
|||
{
|
||||
{ PARAM_INT32, "run_mode", "Interactive, non-interactive" },
|
||||
{ PARAM_STRING, "filename", "The name of the file to load" },
|
||||
{ PARAM_STRING, "raw_filename", "The name of the file to load" },
|
||||
{ PARAM_STRING, "raw_filename", "The name of the file to load" }
|
||||
};
|
||||
static GParamDef load_return_vals[] =
|
||||
{
|
||||
{ PARAM_IMAGE, "image", "Output image" },
|
||||
{ PARAM_IMAGE, "image", "Output image" }
|
||||
};
|
||||
static gint nload_args = sizeof (load_args) / sizeof (load_args[0]);
|
||||
static gint nload_return_vals = (sizeof (load_return_vals) /
|
||||
|
@ -318,8 +317,6 @@ query (void)
|
|||
};
|
||||
static gint nsave_args = sizeof (save_args) / sizeof (save_args[0]);
|
||||
|
||||
INIT_I18N();
|
||||
|
||||
gimp_install_procedure ("file_jpeg_load",
|
||||
"loads files in the JPEG file format",
|
||||
"loads files in the JPEG file format",
|
||||
|
@ -409,7 +406,7 @@ run (gchar *name,
|
|||
{
|
||||
case RUN_INTERACTIVE:
|
||||
case RUN_WITH_LAST_VALS:
|
||||
init_gtk ();
|
||||
gimp_ui_init ("jpeg", FALSE);
|
||||
export = gimp_export_image (&image_ID, &drawable_ID, "JPEG",
|
||||
(CAN_HANDLE_RGB |
|
||||
CAN_HANDLE_GRAY));
|
||||
|
@ -1554,20 +1551,6 @@ add_menu_item (GtkWidget *menu,
|
|||
gtk_widget_show (menu_item);
|
||||
}
|
||||
|
||||
static void
|
||||
init_gtk (void)
|
||||
{
|
||||
gchar **argv;
|
||||
gint argc;
|
||||
|
||||
argc = 1;
|
||||
argv = g_new (gchar *, 1);
|
||||
argv[0] = g_strdup ("jpeg");
|
||||
|
||||
gtk_init (&argc, &argv);
|
||||
gtk_rc_parse (gimp_gtkrc ());
|
||||
}
|
||||
|
||||
static gint
|
||||
save_dialog (void)
|
||||
{
|
||||
|
|
|
@ -126,6 +126,7 @@
|
|||
* pretty obscure Win32 compilation issues.
|
||||
*/
|
||||
#include <setjmp.h>
|
||||
#include <signal.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
@ -142,7 +143,6 @@
|
|||
|
||||
#include "libgimp/stdplugins-intl.h"
|
||||
|
||||
#include <signal.h>
|
||||
|
||||
#define SCALE_WIDTH 125
|
||||
|
||||
|
@ -229,7 +229,6 @@ static void add_menu_item (GtkWidget *menu,
|
|||
guint op_no,
|
||||
GtkSignalFunc callback);
|
||||
|
||||
static void init_gtk (void);
|
||||
static gint save_dialog (void);
|
||||
|
||||
static void save_close_callback (GtkWidget *widget,
|
||||
|
@ -289,11 +288,11 @@ query (void)
|
|||
{
|
||||
{ PARAM_INT32, "run_mode", "Interactive, non-interactive" },
|
||||
{ PARAM_STRING, "filename", "The name of the file to load" },
|
||||
{ PARAM_STRING, "raw_filename", "The name of the file to load" },
|
||||
{ PARAM_STRING, "raw_filename", "The name of the file to load" }
|
||||
};
|
||||
static GParamDef load_return_vals[] =
|
||||
{
|
||||
{ PARAM_IMAGE, "image", "Output image" },
|
||||
{ PARAM_IMAGE, "image", "Output image" }
|
||||
};
|
||||
static gint nload_args = sizeof (load_args) / sizeof (load_args[0]);
|
||||
static gint nload_return_vals = (sizeof (load_return_vals) /
|
||||
|
@ -318,8 +317,6 @@ query (void)
|
|||
};
|
||||
static gint nsave_args = sizeof (save_args) / sizeof (save_args[0]);
|
||||
|
||||
INIT_I18N();
|
||||
|
||||
gimp_install_procedure ("file_jpeg_load",
|
||||
"loads files in the JPEG file format",
|
||||
"loads files in the JPEG file format",
|
||||
|
@ -409,7 +406,7 @@ run (gchar *name,
|
|||
{
|
||||
case RUN_INTERACTIVE:
|
||||
case RUN_WITH_LAST_VALS:
|
||||
init_gtk ();
|
||||
gimp_ui_init ("jpeg", FALSE);
|
||||
export = gimp_export_image (&image_ID, &drawable_ID, "JPEG",
|
||||
(CAN_HANDLE_RGB |
|
||||
CAN_HANDLE_GRAY));
|
||||
|
@ -1554,20 +1551,6 @@ add_menu_item (GtkWidget *menu,
|
|||
gtk_widget_show (menu_item);
|
||||
}
|
||||
|
||||
static void
|
||||
init_gtk (void)
|
||||
{
|
||||
gchar **argv;
|
||||
gint argc;
|
||||
|
||||
argc = 1;
|
||||
argv = g_new (gchar *, 1);
|
||||
argv[0] = g_strdup ("jpeg");
|
||||
|
||||
gtk_init (&argc, &argv);
|
||||
gtk_rc_parse (gimp_gtkrc ());
|
||||
}
|
||||
|
||||
static gint
|
||||
save_dialog (void)
|
||||
{
|
||||
|
|
|
@ -126,6 +126,7 @@
|
|||
* pretty obscure Win32 compilation issues.
|
||||
*/
|
||||
#include <setjmp.h>
|
||||
#include <signal.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
@ -142,7 +143,6 @@
|
|||
|
||||
#include "libgimp/stdplugins-intl.h"
|
||||
|
||||
#include <signal.h>
|
||||
|
||||
#define SCALE_WIDTH 125
|
||||
|
||||
|
@ -229,7 +229,6 @@ static void add_menu_item (GtkWidget *menu,
|
|||
guint op_no,
|
||||
GtkSignalFunc callback);
|
||||
|
||||
static void init_gtk (void);
|
||||
static gint save_dialog (void);
|
||||
|
||||
static void save_close_callback (GtkWidget *widget,
|
||||
|
@ -289,11 +288,11 @@ query (void)
|
|||
{
|
||||
{ PARAM_INT32, "run_mode", "Interactive, non-interactive" },
|
||||
{ PARAM_STRING, "filename", "The name of the file to load" },
|
||||
{ PARAM_STRING, "raw_filename", "The name of the file to load" },
|
||||
{ PARAM_STRING, "raw_filename", "The name of the file to load" }
|
||||
};
|
||||
static GParamDef load_return_vals[] =
|
||||
{
|
||||
{ PARAM_IMAGE, "image", "Output image" },
|
||||
{ PARAM_IMAGE, "image", "Output image" }
|
||||
};
|
||||
static gint nload_args = sizeof (load_args) / sizeof (load_args[0]);
|
||||
static gint nload_return_vals = (sizeof (load_return_vals) /
|
||||
|
@ -318,8 +317,6 @@ query (void)
|
|||
};
|
||||
static gint nsave_args = sizeof (save_args) / sizeof (save_args[0]);
|
||||
|
||||
INIT_I18N();
|
||||
|
||||
gimp_install_procedure ("file_jpeg_load",
|
||||
"loads files in the JPEG file format",
|
||||
"loads files in the JPEG file format",
|
||||
|
@ -409,7 +406,7 @@ run (gchar *name,
|
|||
{
|
||||
case RUN_INTERACTIVE:
|
||||
case RUN_WITH_LAST_VALS:
|
||||
init_gtk ();
|
||||
gimp_ui_init ("jpeg", FALSE);
|
||||
export = gimp_export_image (&image_ID, &drawable_ID, "JPEG",
|
||||
(CAN_HANDLE_RGB |
|
||||
CAN_HANDLE_GRAY));
|
||||
|
@ -1554,20 +1551,6 @@ add_menu_item (GtkWidget *menu,
|
|||
gtk_widget_show (menu_item);
|
||||
}
|
||||
|
||||
static void
|
||||
init_gtk (void)
|
||||
{
|
||||
gchar **argv;
|
||||
gint argc;
|
||||
|
||||
argc = 1;
|
||||
argv = g_new (gchar *, 1);
|
||||
argv[0] = g_strdup ("jpeg");
|
||||
|
||||
gtk_init (&argc, &argv);
|
||||
gtk_rc_parse (gimp_gtkrc ());
|
||||
}
|
||||
|
||||
static gint
|
||||
save_dialog (void)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue