plug-ins: Various warnings/code style fixes for plugins...

After the recent port.
* contrast-retinex: Initialize format & src_buffer to NULL
* curve-bend and map-object: Remove no longer needed functions
* file-load-gif: Fix C++ style comment
This commit is contained in:
Alx Sa 2023-10-04 20:27:17 +00:00
parent 98f0c44881
commit cbf14a7e2d
5 changed files with 26 additions and 125 deletions

View File

@ -374,11 +374,11 @@ retinex (GObject *config,
GimpDrawable *drawable,
GimpPreview *preview)
{
GeglBuffer *src_buffer;
GeglBuffer *src_buffer = NULL;
GeglBuffer *dest_buffer;
const Babl *format;
guchar *src = NULL;
guchar *psrc = NULL;
const Babl *format = NULL;
guchar *src = NULL;
guchar *psrc = NULL;
gint x, y, width, height;
gint size, bytes;
@ -441,7 +441,8 @@ retinex (GObject *config,
format, psrc,
GEGL_AUTO_ROWSTRIDE);
g_object_unref (src_buffer);
if (src_buffer)
g_object_unref (src_buffer);
g_object_unref (dest_buffer);
gimp_progress_update (1.0);

View File

@ -351,14 +351,6 @@ static void p_delta_gint32 (gint32 *val,
gint32 val_to,
gint32 total_steps,
gdouble current_step);
static void p_copy_points (BenderDialog *cd,
int outline,
int xy,
int argc,
const gdouble *floatarray);
static void p_copy_yval (BenderDialog *cd,
int outline,
GBytes *bytes);
static int p_save_pointfile (BenderDialog *cd,
const gchar *filename);
@ -716,8 +708,6 @@ bender_run (GimpProcedure *procedure,
switch (run_mode)
{
case GIMP_RUN_INTERACTIVE:
/* gimp_get_data (PLUG_IN_PROC, &g_bndvals); */
/* Get information from the dialog */
cd = do_dialog (procedure, config, active_drawable);
cd->show_progress = TRUE;
@ -730,24 +720,6 @@ bender_run (GimpProcedure *procedure,
cd->show_progress = TRUE;
cd->drawable = active_drawable;
cd->config = config;
/*p_copy_points (cd, OUTLINE_UPPER, 0,
GIMP_VALUES_GET_INT (args, 5),
GIMP_VALUES_GET_FLOAT_ARRAY (args, 6));
p_copy_points (cd, OUTLINE_UPPER, 1,
GIMP_VALUES_GET_INT (args, 7),
GIMP_VALUES_GET_FLOAT_ARRAY (args, 8));
p_copy_points (cd, OUTLINE_LOWER, 0,
GIMP_VALUES_GET_INT (args, 9),
GIMP_VALUES_GET_FLOAT_ARRAY (args, 10));
p_copy_points (cd, OUTLINE_LOWER, 1,
GIMP_VALUES_GET_INT (args, 11),
GIMP_VALUES_GET_FLOAT_ARRAY (args, 12));
p_copy_yval (cd, OUTLINE_UPPER,
GIMP_VALUES_GET_BYTES (args, 13));
p_copy_yval (cd, OUTLINE_LOWER,
GIMP_VALUES_GET_BYTES (args, 14));*/
break;
case GIMP_RUN_WITH_LAST_VALS:
@ -1041,47 +1013,6 @@ p_delta_gint32 (gint32 *val,
*val = val_from + delta;
}
static void
p_copy_points (BenderDialog *cd,
int outline,
int xy,
int argc,
const gdouble *floatarray)
{
int j;
for (j = 0; j < 17; j++)
{
cd->points[outline][j][xy] = -1;
}
for (j = 0; j < argc; j++)
{
cd->points[outline][j][xy] = floatarray[j];
}
}
static void
p_copy_yval (BenderDialog *cd,
int outline,
GBytes *bytes)
{
const guint8 *array = g_bytes_get_data (bytes, NULL);
guchar fill = MIDDLE;
for (int j = 0; j < 256; j++)
{
if (j < g_bytes_get_size (bytes))
{
fill = cd->curve[outline][j] = array[j];
}
else
{
cd->curve[outline][j] = fill;
}
}
}
/* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
/* curves machinery */
/* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */

View File

@ -557,7 +557,7 @@ load_image (GFile *file,
if (GifScreen.AspectRatio != 0 && GifScreen.AspectRatio != 49)
{
// Byte overflow is allowed per the GIF specification
/* Byte overflow is allowed per the GIF specification */
guint8 par = GifScreen.AspectRatio + 15;
if (par > 0)

View File

@ -132,7 +132,7 @@ map_create_procedure (GimpPlugIn *plug_in,
"Version 1.2.0, July 16 1998");
GIMP_PROC_ARG_CHOICE (procedure, "map-type",
_("Ma_p to"),
_("Map _to"),
_("Type of mapping"),
gimp_choice_new_with_values ("map-plane", MAP_PLANE, _("Plane"), NULL,
"map-sphere", MAP_SPHERE, _("Sphere"), NULL,
@ -233,7 +233,7 @@ map_create_procedure (GimpPlugIn *plug_in,
G_PARAM_READWRITE);
GIMP_PROC_ARG_RGB (procedure, "light-color",
_("Light source color"),
_("Light source _color"),
_("Light source color"),
TRUE, &white,
G_PARAM_READWRITE);
@ -271,32 +271,32 @@ map_create_procedure (GimpPlugIn *plug_in,
G_PARAM_READWRITE);
GIMP_PROC_ARG_DOUBLE (procedure, "ambient-intensity",
_("Ambient"),
_("Ambie_nt"),
_("Material ambient intensity"),
0, 1, 0.3,
G_PARAM_READWRITE);
GIMP_PROC_ARG_DOUBLE (procedure, "diffuse-intensity",
_("Diffuse"),
_("_D_iffuse"),
_("Material diffuse intensity"),
0, 1, 1.0,
G_PARAM_READWRITE);
/* Reflectivity */
GIMP_PROC_ARG_DOUBLE (procedure, "diffuse-reflectivity",
_("Diffuse"),
_("Di_ffuse"),
_("Material diffuse reflectivity"),
0, 1, 0.5,
G_PARAM_READWRITE);
GIMP_PROC_ARG_DOUBLE (procedure, "specular-reflectivity",
_("Specular"),
_("Spec_ular"),
_("Material specular reflectivity"),
0, 1, 0.5,
G_PARAM_READWRITE);
GIMP_PROC_ARG_DOUBLE (procedure, "highlight",
_("Highlight"),
_("Highligh_t"),
_("Material highlight "
"(note, it's exponential)"),
0, G_MAXDOUBLE, 27.0,
@ -308,45 +308,45 @@ map_create_procedure (GimpPlugIn *plug_in,
TRUE,
G_PARAM_READWRITE);
GIMP_PROC_ARG_DOUBLE (procedure, "depth",
_("Depth"),
_("_Depth"),
_("Antialiasing quality. Higher is better, "
"but slower"),
1.0, 5.0, 3.0,
G_PARAM_READWRITE);
GIMP_PROC_ARG_DOUBLE (procedure, "threshold",
_("Threshold"),
_("Thr_eshold"),
_("Stop when pixel differences are smaller than "
"this value"),
0.001, 1000.0, 0.250,
G_PARAM_READWRITE);
GIMP_PROC_ARG_BOOLEAN (procedure, "tiled",
_("Tile so_urce image"),
_("_Tile source image"),
_("Tile source image"),
FALSE,
G_PARAM_READWRITE);
GIMP_PROC_ARG_BOOLEAN (procedure, "new-image",
_("Create new ima_ge"),
_("Create _new image"),
_("Create a new image"),
FALSE,
G_PARAM_READWRITE);
GIMP_PROC_ARG_BOOLEAN (procedure, "new-layer",
_("Create new layer"),
_("Create ne_w layer"),
_("Create a new layer when applying filter"),
FALSE,
G_PARAM_READWRITE);
GIMP_PROC_ARG_BOOLEAN (procedure, "transparent-background",
_("_Transparent background"),
_("Transparent bac_kground"),
_("Make background transparent"),
FALSE,
G_PARAM_READWRITE);
/* Sphere Options */
GIMP_PROC_ARG_DOUBLE (procedure, "sphere-radius",
_("R_adius"),
_("Radi_us"),
_("Sphere radius"),
0, G_MAXDOUBLE, 0.25,
G_PARAM_READWRITE);
@ -414,12 +414,12 @@ map_create_procedure (GimpPlugIn *plug_in,
TRUE,
G_PARAM_READWRITE);
GIMP_PROC_ARG_DOUBLE (procedure, "cylinder-radius",
_("R_adius"),
_("Radi_us"),
_("Cylinder radius"),
0, G_MAXDOUBLE, 0.25,
G_PARAM_READWRITE);
GIMP_PROC_ARG_DOUBLE (procedure, "cylinder-length",
_("Cylinder length"),
_("Cylin_der length"),
_("Cylinder length"),
0, G_MAXDOUBLE, 0.25,
G_PARAM_READWRITE);
@ -519,7 +519,6 @@ map_run (GimpProcedure *procedure,
gpointer run_data)
{
GimpDrawable *drawable;
gint i;
gegl_init (NULL, NULL);

View File

@ -54,13 +54,6 @@ static void lightmenu_callback (GtkWidget *widget,
static void preview_callback (GtkWidget *widget,
gpointer data);
static gint box_constrain (GimpImage *image,
GimpItem *item,
gpointer data);
static gint cylinder_constrain (GimpImage *image,
GimpItem *item,
gpointer data);
/******************************************************/
/* Update angle & position (redraw grid if necessary) */
@ -229,29 +222,6 @@ zoomed_callback (GimpZoomModel *model)
gtk_widget_queue_draw (previewarea);
}
/**********************************************/
/* Main window "Apply" button callback. */
/* Render to GIMP image, close down and exit. */
/**********************************************/
static gint
box_constrain (GimpImage *image,
GimpItem *item,
gpointer data)
{
return (gimp_drawable_is_rgb (GIMP_DRAWABLE (item)) &&
! gimp_drawable_is_indexed (GIMP_DRAWABLE (item)));
}
static gint
cylinder_constrain (GimpImage *image,
GimpItem *item,
gpointer data)
{
return (gimp_drawable_is_rgb (GIMP_DRAWABLE (item)) &&
! gimp_drawable_is_indexed (GIMP_DRAWABLE (item)));
}
/******************************/
/* Preview area event handler */
/******************************/
@ -460,16 +430,16 @@ main_dialog (GimpProcedure *procedure,
gimp_procedure_dialog_get_label (GIMP_PROCEDURE_DIALOG (appwin),
"options-tab", _("O_ptions"), FALSE, TRUE);
gimp_procedure_dialog_get_label (GIMP_PROCEDURE_DIALOG (appwin),
"light-tab", _("_Light"), FALSE, TRUE);
"light-tab", _("Li_ght"), FALSE, TRUE);
gimp_procedure_dialog_get_label (GIMP_PROCEDURE_DIALOG (appwin),
"viewpoint-tab", _("_Viewpoint"), FALSE, TRUE);
gimp_procedure_dialog_get_label (GIMP_PROCEDURE_DIALOG (appwin),
"material-tab", _("_Material"), FALSE, TRUE);
gimp_procedure_dialog_get_label (GIMP_PROCEDURE_DIALOG (appwin),
"orientation-tab", _("O_rientation"),
"orientation-tab", _("Orient_ation"),
FALSE, TRUE);
gimp_procedure_dialog_get_label (GIMP_PROCEDURE_DIALOG (appwin),
"sphere-tab", _("_Sphere"), FALSE, TRUE);
"sphere-tab", _("Sp_here"), FALSE, TRUE);
gimp_procedure_dialog_get_label (GIMP_PROCEDURE_DIALOG (appwin),
"box-tab", _("_Box"), FALSE, TRUE);
gimp_procedure_dialog_get_label (GIMP_PROCEDURE_DIALOG (appwin),