Commit a8f621fe authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

renamed the "run_mode" parameters to "unused" and remode the rum_mode

2004-09-29  Michael Natterer  <mitch@gimp.org>

	* libgimp/gimpregioniterator.[ch]: renamed the "run_mode"
	parameters to "unused" and remode the rum_mode member from the
	private GimpRgbIterator struct.

	* plug-ins/common/AlienMap2.c
	* plug-ins/common/autostretch_hsv.c
	* plug-ins/common/c_astretch.c
	* plug-ins/common/color_enhance.c
	* plug-ins/common/colorify.c
	* plug-ins/common/colortoalpha.c
	* plug-ins/common/gradmap.c
	* plug-ins/common/mapcolor.c
	* plug-ins/common/max_rgb.c
	* plug-ins/common/noisify.c
	* plug-ins/common/normalize.c
	* plug-ins/common/sample_colorize.c
	* plug-ins/common/scatter_hsv.c
	* plug-ins/common/semiflatten.c
	* plug-ins/common/threshold_alpha.c
	* plug-ins/common/vinvert.c
	* plug-ins/fp/fp.c: made "run_mode" a private variable of run()
	and pass 0 to gimp_rgn_iterate*(). Minor cleanups.
parent 02ced0cd
2004-09-29 Michael Natterer <mitch@gimp.org>
* libgimp/gimpregioniterator.[ch]: renamed the "run_mode"
parameters to "unused" and remode the rum_mode member from the
private GimpRgbIterator struct.
* plug-ins/common/AlienMap2.c
* plug-ins/common/autostretch_hsv.c
* plug-ins/common/c_astretch.c
* plug-ins/common/color_enhance.c
* plug-ins/common/colorify.c
* plug-ins/common/colortoalpha.c
* plug-ins/common/gradmap.c
* plug-ins/common/mapcolor.c
* plug-ins/common/max_rgb.c
* plug-ins/common/noisify.c
* plug-ins/common/normalize.c
* plug-ins/common/sample_colorize.c
* plug-ins/common/scatter_hsv.c
* plug-ins/common/semiflatten.c
* plug-ins/common/threshold_alpha.c
* plug-ins/common/vinvert.c
* plug-ins/fp/fp.c: made "run_mode" a private variable of run()
and pass 0 to gimp_rgn_iterate*(). Minor cleanups.
2004-09-29 Sven Neumann <sven@gimp.org>
* libgimp/gimp.def
......
......@@ -39,7 +39,6 @@ struct _GimpRgnIterator
{
GimpDrawable *drawable;
gint x1, y1, x2, y2;
GimpRunMode run_mode;
};
......@@ -71,12 +70,12 @@ static void gimp_rgn_render_region (const GimpPixelRgn *srcPR,
**/
GimpRgnIterator *
gimp_rgn_iterator_new (GimpDrawable *drawable,
GimpRunMode run_mode)
GimpRunMode unused)
{
GimpRgnIterator *iter = g_new (GimpRgnIterator, 1);
iter->drawable = drawable;
iter->run_mode = run_mode;
gimp_drawable_mask_bounds (drawable->drawable_id,
&iter->x1, &iter->y1,
&iter->x2, &iter->y2);
......@@ -196,7 +195,7 @@ gimp_rgn_iterator_dest (GimpRgnIterator *iter,
void
gimp_rgn_iterate1 (GimpDrawable *drawable,
GimpRunMode run_mode,
GimpRunMode unused,
GimpRgnFunc1 func,
gpointer data)
{
......@@ -247,7 +246,7 @@ gimp_rgn_iterate1 (GimpDrawable *drawable,
void
gimp_rgn_iterate2 (GimpDrawable *drawable,
GimpRunMode run_mode,
GimpRunMode unused,
GimpRgnFunc2 func,
gpointer data)
{
......
......@@ -56,29 +56,29 @@ typedef void (* GimpRgnFuncSrcDest) (gint x,
gint bpp,
gpointer data);
GimpRgnIterator * gimp_rgn_iterator_new (GimpDrawable *drawable,
GimpRunMode run_mode);
void gimp_rgn_iterator_free (GimpRgnIterator *iter);
void gimp_rgn_iterator_src (GimpRgnIterator *iter,
GimpRgnFuncSrc func,
gpointer data);
void gimp_rgn_iterator_dest (GimpRgnIterator *iter,
GimpRgnFuncDest func,
gpointer data);
void gimp_rgn_iterator_src_dest (GimpRgnIterator *iter,
GimpRgnFuncSrcDest func,
gpointer data);
GimpRgnIterator * gimp_rgn_iterator_new (GimpDrawable *drawable,
GimpRunMode unused);
void gimp_rgn_iterator_free (GimpRgnIterator *iter);
void gimp_rgn_iterator_src (GimpRgnIterator *iter,
GimpRgnFuncSrc func,
gpointer data);
void gimp_rgn_iterator_dest (GimpRgnIterator *iter,
GimpRgnFuncDest func,
gpointer data);
void gimp_rgn_iterator_src_dest (GimpRgnIterator *iter,
GimpRgnFuncSrcDest func,
gpointer data);
void gimp_rgn_iterate1 (GimpDrawable *drawable,
GimpRunMode run_mode,
GimpRgnFunc1 func,
gpointer data);
void gimp_rgn_iterate1 (GimpDrawable *drawable,
GimpRunMode unused,
GimpRgnFunc1 func,
gpointer data);
void gimp_rgn_iterate2 (GimpDrawable *drawable,
GimpRunMode run_mode,
GimpRgnFunc2 func,
gpointer data);
void gimp_rgn_iterate2 (GimpDrawable *drawable,
GimpRunMode unused,
GimpRgnFunc2 func,
gpointer data);
G_END_DECLS
......
......@@ -100,8 +100,6 @@ static void alienmap2_get_label_size (void);
/***** Variables *****/
static GimpRunMode run_mode;
#define PREVIEW_SIZE 128
static GtkWidget *preview;
static gint preview_width, preview_height, preview_bpp;
......@@ -275,6 +273,7 @@ run (const gchar *name,
{
static GimpParam values[1];
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
GimpRunMode run_mode;
INIT_I18N ();
......@@ -391,7 +390,7 @@ alienmap2_func (const guchar *src,
static void
alienmap2 (GimpDrawable *drawable)
{
gimp_rgn_iterate2 (drawable, run_mode, alienmap2_func, NULL);
gimp_rgn_iterate2 (drawable, 0 /* unused */, alienmap2_func, NULL);
}
static gint
......
......@@ -40,7 +40,6 @@ static void run (const gchar *name,
static void autostretch_hsv (GimpDrawable *drawable);
static void indexed_autostretch_hsv (gint32 image_ID);
static GimpRunMode run_mode;
GimpPlugInInfo PLUG_IN_INFO =
{
......@@ -58,8 +57,8 @@ query (void)
{
static GimpParamDef args[] =
{
{ GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" },
{ GIMP_PDB_IMAGE, "image", "Input image" },
{ GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" },
{ GIMP_PDB_IMAGE, "image", "Input image" },
{ GIMP_PDB_DRAWABLE, "drawable", "Input drawable" }
};
......@@ -98,6 +97,7 @@ run (const gchar *name,
static GimpParam values[1];
GimpDrawable *drawable;
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
GimpRunMode run_mode;
gint32 image_ID;
......@@ -149,7 +149,7 @@ typedef struct {
double vlo;
} AutostretchData;
static void
static void
find_max (guchar *src, gint bpp, AutostretchData *data)
{
double h, s, v;
......@@ -161,8 +161,8 @@ find_max (guchar *src, gint bpp, AutostretchData *data)
if (v < data->vlo) data->vlo = v;
}
static void
autostretch_hsv_func (guchar *src, guchar *dest, gint bpp,
static void
autostretch_hsv_func (guchar *src, guchar *dest, gint bpp,
AutostretchData *data)
{
double h, s, v;
......@@ -173,7 +173,7 @@ autostretch_hsv_func (guchar *src, guchar *dest, gint bpp,
if (data->vhi != data->vlo)
v = (v - data->vlo) / (data->vhi - data->vlo);
gimp_hsv_to_rgb4(dest, h, s, v);
if (bpp == 4)
dest[3] = src[3];
}
......@@ -211,9 +211,7 @@ autostretch_hsv (GimpDrawable *drawable)
{
AutostretchData data = {0.0, 1.0, 0.0, 1.0};
gimp_rgn_iterate1 (drawable, run_mode, (GimpRgnFunc1) find_max, &data);
gimp_rgn_iterate2 (drawable, run_mode, (GimpRgnFunc2) autostretch_hsv_func,
gimp_rgn_iterate1 (drawable, 0 /* unused */, (GimpRgnFunc1) find_max, &data);
gimp_rgn_iterate2 (drawable, 0 /* unused */, (GimpRgnFunc2) autostretch_hsv_func,
&data);
}
......@@ -49,7 +49,6 @@ GimpPlugInInfo PLUG_IN_INFO =
run, /* run_proc */
};
static GimpRunMode run_mode;
MAIN ()
......@@ -58,8 +57,8 @@ query (void)
{
static GimpParamDef args[] =
{
{ GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" },
{ GIMP_PDB_IMAGE, "image", "Input image" },
{ GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" },
{ GIMP_PDB_IMAGE, "image", "Input image" },
{ GIMP_PDB_DRAWABLE, "drawable", "Input drawable" }
};
......@@ -96,8 +95,8 @@ run (const gchar *name,
static GimpParam values[1];
GimpDrawable *drawable;
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
gint32 image_ID;
GimpRunMode run_mode;
gint32 image_ID;
INIT_I18N();
......@@ -235,7 +234,7 @@ c_astretch (GimpDrawable *drawable)
param.min[0] = param.min[1] = param.min[2] = 255;
param.max[0] = param.max[1] = param.max[2] = 0;
gimp_rgn_iterate1 (drawable, run_mode, find_min_max, &param);
gimp_rgn_iterate1 (drawable, 0 /* unused */, find_min_max, &param);
/* Calculate LUTs with stretched contrast */
for (b = 0; b < param.alpha; b++)
......@@ -250,6 +249,6 @@ c_astretch (GimpDrawable *drawable)
param.lut[param.min[b]][b] = param.min[b];
}
gimp_rgn_iterate2 (drawable, run_mode, c_astretch_func, &param);
gimp_rgn_iterate2 (drawable, 0 /* unused */, c_astretch_func, &param);
}
......@@ -28,7 +28,6 @@
#include "libgimp/stdplugins-intl.h"
static GimpRunMode run_mode;
/* Declare local functions.
*/
......@@ -59,8 +58,8 @@ query (void)
{
static GimpParamDef args[] =
{
{ GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" },
{ GIMP_PDB_IMAGE, "image", "Input image" },
{ GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" },
{ GIMP_PDB_IMAGE, "image", "Input image" },
{ GIMP_PDB_DRAWABLE, "drawable", "Input drawable" }
};
......@@ -98,8 +97,8 @@ run (const gchar *name,
static GimpParam values[1];
GimpDrawable *drawable;
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
gint32 image_ID;
GimpRunMode run_mode;
gint32 image_ID;
INIT_I18N();
......@@ -285,7 +284,6 @@ Color_Enhance (GimpDrawable *drawable)
param.vhi = 0.0;
param.vlo = 1.0;
gimp_rgn_iterate1 (drawable, run_mode, find_vhi_vlo, &param);
gimp_rgn_iterate2 (drawable, run_mode, color_enhance_func, &param);
gimp_rgn_iterate1 (drawable, 0 /* unused */, find_vhi_vlo, &param);
gimp_rgn_iterate2 (drawable, 0 /* unused */, color_enhance_func, &param);
}
......@@ -66,8 +66,6 @@ static GimpRGB button_color[] =
{ 1.0, 1.0, 1.0, 1.0 },
};
static GimpRunMode run_mode;
GimpPlugInInfo PLUG_IN_INFO =
{
NULL,
......@@ -93,10 +91,10 @@ query (void)
{
static GimpParamDef args[] =
{
{ GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" },
{ GIMP_PDB_IMAGE, "image", "Input image" },
{ GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" },
{ GIMP_PDB_IMAGE, "image", "Input image" },
{ GIMP_PDB_DRAWABLE, "drawable", "Input drawable" },
{ GIMP_PDB_COLOR, "color", "Color to apply"}
{ GIMP_PDB_COLOR, "color", "Color to apply"}
};
gimp_install_procedure (PLUG_IN_NAME,
......@@ -126,6 +124,7 @@ run (const gchar *name,
GimpPDBStatusType status;
static GimpParam values[1];
GimpDrawable *drawable;
GimpRunMode run_mode;
INIT_I18N ();
......@@ -175,9 +174,7 @@ run (const gchar *name,
gimp_set_data (PLUG_IN_NAME, &cvals, sizeof (ColorifyVals));
if (run_mode != GIMP_RUN_NONINTERACTIVE)
{
gimp_displays_flush ();
}
gimp_displays_flush ();
}
gimp_drawable_detach (drawable);
......@@ -219,7 +216,7 @@ colorify (GimpDrawable *drawable)
final_blue_lookup[i] = i * cvals.color.b;
}
gimp_rgn_iterate2 (drawable, run_mode, colorify_func, NULL);
gimp_rgn_iterate2 (drawable, 0 /* unused */, colorify_func, NULL);
}
static gboolean
......
......@@ -59,8 +59,6 @@ static void toalpha (GimpDrawable *drawable);
static gboolean colortoalpha_dialog (GimpDrawable *drawable);
static GimpRunMode run_mode;
GimpPlugInInfo PLUG_IN_INFO =
{
NULL, /* init_proc */
......@@ -119,6 +117,7 @@ run (const gchar *name,
GimpDrawable *drawable;
gint32 image_ID;
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
GimpRunMode run_mode;
run_mode = param[0].data.d_int32;
......@@ -301,7 +300,7 @@ toalpha_func (const guchar *src,
static void
toalpha (GimpDrawable *drawable)
{
gimp_rgn_iterate2 (drawable, run_mode, toalpha_func, NULL);
gimp_rgn_iterate2 (drawable, 0 /* unused */, toalpha_func, NULL);
}
static gboolean
......
......@@ -284,7 +284,6 @@ static FP_Params Current =
};
static GimpDrawable *drawable, *mask;
static GimpRunMode run_mode;
static void query (void);
static void run (const gchar *name,
......@@ -340,6 +339,7 @@ run (const gchar *name,
{
GimpParam values[1];
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
GimpRunMode run_mode;
*nreturn_vals = 1;
*return_vals = values;
......@@ -373,7 +373,8 @@ run (const gchar *name,
values[0].data.d_status = status;
if (status==GIMP_PDB_SUCCESS)
if (status == GIMP_PDB_SUCCESS)
gimp_drawable_detach (drawable);
}
......@@ -456,7 +457,7 @@ fp_func (const guchar *src,
static void
fp (GimpDrawable *drawable)
{
gimp_rgn_iterate2 (drawable, run_mode, fp_func, NULL);
gimp_rgn_iterate2 (drawable, 0 /* unused */, fp_func, NULL);
}
/***********************************************************/
......
......@@ -32,65 +32,62 @@ static char rcsid[] = "$Id$";
/* Some useful macros */
#define NSAMPLES 256
#define TILE_CACHE_SIZE 32
#define LUMINOSITY(X) (GIMP_RGB_INTENSITY (X[0], X[1], X[2]) + 0.5)
static GimpRunMode run_mode;
#define NSAMPLES 256
#define LUMINOSITY(X) (GIMP_RGB_INTENSITY (X[0], X[1], X[2]) + 0.5)
/* Declare a local function.
*/
static void query (void);
static void run (const gchar *name,
gint nparams,
const GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals);
static void query (void);
static void run (const gchar *name,
gint nparams,
const GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals);
static void gradmap (GimpDrawable *drawable);
static guchar * get_samples (GimpDrawable *drawable );
static void gradmap (GimpDrawable *drawable);
static guchar * get_samples (GimpDrawable *drawable);
GimpPlugInInfo PLUG_IN_INFO =
{
NULL, /* init_proc */
NULL, /* quit_proc */
NULL, /* init_proc */
NULL, /* quit_proc */
query, /* query_proc */
run, /* run_proc */
run, /* run_proc */
};
MAIN ()
static void
query()
query (void)
{
static GimpParamDef args[]=
{
{ GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" },
{ GIMP_PDB_IMAGE, "image", "Input image (unused)" },
{ GIMP_PDB_DRAWABLE, "drawable", "Input drawable" }
};
{
{ GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" },
{ GIMP_PDB_IMAGE, "image", "Input image (unused)" },
{ GIMP_PDB_DRAWABLE, "drawable", "Input drawable" }
};
gimp_install_procedure ("plug_in_gradmap",
"Map the contents of the specified drawable with "
"active gradient",
" This plug-in maps the contents of the specified "
"drawable with active gradient. It calculates "
"luminosity of each pixel and replaces the pixel "
"by the sample of active gradient at the position "
"proportional to that luminosity. Complete black "
"pixel becomes the leftmost color of the gradient, "
"and complete white becomes the rightmost. Works on "
"both Grayscale and RGB image with/without alpha "
"channel.",
"Eiichi Takamori",
"Eiichi Takamori",
"1997",
N_("_Gradient Map"),
"RGB*, GRAY*",
GIMP_PLUGIN,
G_N_ELEMENTS (args), 0,
args, NULL);
"active gradient",
"This plug-in maps the contents of the specified "
"drawable with active gradient. It calculates "
"luminosity of each pixel and replaces the pixel "
"by the sample of active gradient at the position "
"proportional to that luminosity. Complete black "
"pixel becomes the leftmost color of the gradient, "
"and complete white becomes the rightmost. Works on "
"both Grayscale and RGB image with/without alpha "
"channel.",
"Eiichi Takamori",
"Eiichi Takamori",
"1997",
N_("_Gradient Map"),
"RGB*, GRAY*",
GIMP_PLUGIN,
G_N_ELEMENTS (args), 0,
args, NULL);
gimp_plugin_menu_register ("plug_in_gradmap",
N_("<Image>/Filters/Colors/Map"));
......@@ -106,6 +103,7 @@ run (const gchar *name,
static GimpParam values[1];
GimpDrawable *drawable;
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
GimpRunMode run_mode;
run_mode = param[0].data.d_int32;
......@@ -120,17 +118,17 @@ run (const gchar *name,
/* Get the specified drawable */
drawable = gimp_drawable_get (param[2].data.d_drawable);
/* Make sure that the drawable is gray or RGB color */
/* Make sure that the drawable is gray or RGB color */
if (gimp_drawable_is_rgb (drawable->drawable_id) ||
gimp_drawable_is_gray (drawable->drawable_id))
{
gimp_progress_init (_("Gradient Map..."));
gimp_tile_cache_ntiles (TILE_CACHE_SIZE);
gimp_tile_cache_ntiles (2 * (drawable->width / gimp_tile_width () + 1));
gradmap (drawable);
if (run_mode != GIMP_RUN_NONINTERACTIVE)
gimp_displays_flush ();
gimp_displays_flush ();
}
else
{
......@@ -143,22 +141,23 @@ run (const gchar *name,
gimp_drawable_detach (drawable);
}
typedef struct {
guchar *samples;
gboolean is_rgb;
gboolean has_alpha;
} GradMapParam_t;
typedef struct
{
guchar *samples;
gboolean is_rgb;
gboolean has_alpha;
} GradMapParam;
static void
gradmap_func (const guchar *src,
guchar *dest,
gint bpp,
gpointer data)
guchar *dest,
gint bpp,
gpointer data)
{
GradMapParam_t *param = (GradMapParam_t*) data;
gint lum;
gint b;
guchar *samp;
GradMapParam *param = data;
gint lum;
gint b;
guchar *samp;
lum = (param->is_rgb) ? LUMINOSITY (src) : src[0];
samp = &param->samples[lum * bpp];
......@@ -166,26 +165,26 @@ gradmap_func (const guchar *src,
if (param->has_alpha)
{
for (b = 0; b < bpp - 1; b++)
dest[b] = samp[b];
dest[b] = samp[b];
dest[b] = ((guint)samp[b] * (guint)src[b]) / 255;
}
else
{
for (b = 0; b < bpp; b++)
dest[b] = samp[b];
dest[b] = samp[b];
}
}
static void
gradmap (GimpDrawable *drawable)
{
GradMapParam_t param;
GradMapParam param;
param.is_rgb = gimp_drawable_is_rgb (drawable->drawable_id);
param.has_alpha = gimp_drawable_has_alpha (drawable->drawable_id);
param.samples = get_samples (drawable);
gimp_rgn_iterate2 (drawable, run_mode, gradmap_func, &param);
gimp_rgn_iterate2 (drawable, 0 /* unused */, gradmap_func, &param);
}
/*
......@@ -195,20 +194,20 @@ gradmap (GimpDrawable *drawable)
static guchar *
get_samples (GimpDrawable *drawable)
{
gdouble *f_samples, *f_samp; /* float samples */
guchar *b_samples, *b_samp; /* byte samples */
gint bpp, color, has_alpha, alpha;
gint i, j;
gdouble *f_samples, *f_samp; /* float samples */
guchar *b_samples, *b_samp; /* byte samples */
gint bpp, color, has_alpha, alpha;
gint i, j;
#ifdef __GNUC__
#warning FIXME: "reverse" hardcoded to FALSE.
#endif
f_samples = gimp_gradients_sample_uniform (NSAMPLES, FALSE);
bpp = gimp_drawable_bpp (drawable->drawable_id);
color = gimp_drawable_is_rgb (drawable->drawable_id);
bpp = gimp_drawable_bpp (drawable->drawable_id);
color = gimp_drawable_is_rgb (drawable->drawable_id);
has_alpha = gimp_drawable_has_alpha (drawable->drawable_id);
alpha = (has_alpha ? bpp - 1 : bpp);
alpha = (has_alpha ? bpp - 1 : bpp);
b_samples = g_new (guchar, NSAMPLES * bpp);
......@@ -217,15 +216,16 @@ get_samples (GimpDrawable *drawable)
b_samp = &b_samples[i * bpp];
f_samp = &f_samples[i * 4];
if (color)
for (j = 0; j < 3; j++)
b_samp[j] = f_samp[j] * 255;
for (j = 0; j < 3; j++)
b_samp[j] = f_samp[j] * 255;
else
b_samp[0] = LUMINOSITY (f_samp) * 255;
b_samp[0] = LUMINOSITY (f_samp) * 255;
if (has_alpha)
b_samp[alpha] = f_samp[3] * 255;
b_samp[alpha] = f_samp[3] * 255;
}
g_free (f_samples);
return b_samples;
}
......@@ -29,6 +29,7 @@
* Fix problem with divide by zero
* V 1.03,neo, 22-May-00: Fixed divide by zero in preview code.
*/
#define VERSIO 1.03
static char dversio[] = "v1.03 22-May-00";
static char ident[] = "@(#) GIMP mapcolor plug-in v1.03 22-May-00";
......@@ -131,9 +132,6 @@ static void add_color_button (gint csel_index,
static void color_mapping (GimpDrawable *drawable);
/* The run mode */
static GimpRunMode l_run_mode;
static gchar *csel_title[4] =
{
N_("First Source Color"),
......@@ -216,15 +214,15 @@ img_preview_create_from_drawable (guint maxsize,
gint32 drawable_ID)
{
GimpDrawable *drw;
GimpPixelRgn pixel_rgn;
guint drw_width, drw_height;
guint prv_width, prv_height;
gint src_x, src_y, x, y;
guchar *prv_data, *img_data, *cu_row;
gdouble xfactor, yfactor;
gint tile_height, row_start, row_end;
gint bpp;
IMG_PREVIEW *ip;
GimpPixelRgn pixel_rgn;
guint drw_width, drw_height;
guint prv_width, prv_height;
gint src_x, src_y, x, y;
guchar *prv_data, *img_data, *cu_row;
gdouble xfactor, yfactor;
gint tile_height, row_start, row_end;
gint bpp;
IMG_PREVIEW *ip;
drw_width = gimp_drawable_width (drawable_ID);
drw_height = gimp_drawable_height (drawable_ID);
......@@ -300,21 +298,21 @@ query (void)
{
static GimpParamDef adjust_args[] =
{
{ GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" },
{ GIMP_PDB_IMAGE, "image", "Input image (not used)" },
{ GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" },
{ GIMP_PDB_IMAGE, "image", "Input image (not used)" },
{ GIMP_PDB_DRAWABLE, "drawable", "Input drawable to adjust" }
};
static GimpParamDef map_args[] =
{
{ GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" },
{ GIMP_PDB_IMAGE, "image", "Input image (not used)" },
{ GIMP_PDB_DRAWABLE, "drawable", "Input drawable where colors are to map" },
{ GIMP_PDB_COLOR, "srccolor_1", "First source color" },
{ GIMP_PDB_COLOR, "srccolor_2", "Second source color" },
{ GIMP_PDB_COLOR, "dstcolor_1", "First destination color" },
{ GIMP_PDB_COLOR, "dstcolor_2", "Second destination color" },
{ GIMP_PDB_INT32, "map_mode", "Mapping mode (0: linear, others reserved)" }
{ GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" },
{ GIMP_PDB_IMAGE, "image", "Input image (not used)" },
{ GIMP_PDB_DRAWABLE, "drawable", "Input drawable where colors are to map" },
{ GIMP_PDB_COLOR, "srccolor_1", "First source color" },
{ GIMP_PDB_COLOR, "srccolor_2", "Second source color" },
{ GIMP_PDB_COLOR, "dstcolor_1", "First destination color" },
{ GIMP_PDB_COLOR, "dstcolor_2", "Second destination color" },
{ GIMP_PDB_INT32, "map_mode", "Mapping mode (0: linear, others reserved)" }
};
gimp_install_procedure ("plug_in_color_adjust",
......@@ -368,14 +366,11 @@ run (const gchar *name,
GimpRunMode run_mode;
GimpDrawable *drawable = NULL;
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
guchar *c;
gint j;
c = (guchar *) ident;
INIT_I18N ();