app, libgimp, pdb, plug-ins: plug-in-c-astretch compat PDB proc removed.

For plug-in writers, here is how to replace it:

- (plug-in-c-astretch RUN-NONINTERACTIVE img drawable)
+ (gimp-drawable-merge-new-filter drawable "gegl:stretch-contrast" 0 LAYER-MODE-REPLACE 1.0 "keep-colors" FALSE)
This commit is contained in:
Jehan 2024-12-14 15:23:43 +01:00
parent e5134e67aa
commit f539f8fb62
9 changed files with 8 additions and 130 deletions

View file

@ -30,7 +30,7 @@
#include "internal-procs.h" #include "internal-procs.h"
/* 734 procedures registered total */ /* 733 procedures registered total */
void void
internal_procs_init (GimpPDB *pdb) internal_procs_init (GimpPDB *pdb)

View file

@ -612,44 +612,6 @@ plug_in_bump_map_invoker (GimpProcedure *procedure,
error ? *error : NULL); error ? *error : NULL);
} }
static GimpValueArray *
plug_in_c_astretch_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GimpValueArray *args,
GError **error)
{
gboolean success = TRUE;
GimpDrawable *drawable;
drawable = g_value_get_object (gimp_value_array_index (args, 2));
if (success)
{
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
GIMP_PDB_ITEM_CONTENT, error) &&
gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
{
GeglNode *node =
gegl_node_new_child (NULL,
"operation", "gegl:stretch-contrast",
"keep-colors", (gboolean) FALSE,
NULL);
gimp_drawable_apply_operation (drawable, progress,
C_("undo-type", "Stretch Contrast"),
node);
g_object_unref (node);
}
else
success = FALSE;
}
return gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
}
static GimpValueArray * static GimpValueArray *
plug_in_cubism_invoker (GimpProcedure *procedure, plug_in_cubism_invoker (GimpProcedure *procedure,
Gimp *gimp, Gimp *gimp,
@ -1573,42 +1535,6 @@ register_plug_in_compat_procs (GimpPDB *pdb)
gimp_pdb_register_procedure (pdb, procedure); gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure); g_object_unref (procedure);
/*
* gimp-plug-in-c-astretch
*/
procedure = gimp_procedure_new (plug_in_c_astretch_invoker);
gimp_object_set_static_name (GIMP_OBJECT (procedure),
"plug-in-c-astretch");
gimp_procedure_set_static_help (procedure,
"Stretch contrast to cover the maximum possible range",
"This simple plug-in does an automatic contrast stretch. For each channel in the image, it finds the minimum and maximum values... it uses those values to stretch the individual histograms to the full contrast range. For some images it may do just what you want; for others it may not work that well.",
NULL);
gimp_procedure_set_static_attribution (procedure,
"Compatibility procedure. Please see 'gegl:stretch-contrast' for credits.",
"Compatibility procedure. Please see 'gegl:stretch-contrast' for credits.",
"2013");
gimp_procedure_add_argument (procedure,
g_param_spec_enum ("run-mode",
"run mode",
"The run mode",
GIMP_TYPE_RUN_MODE,
GIMP_RUN_INTERACTIVE,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_image ("image",
"image",
"Input image (unused)",
FALSE,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_drawable ("drawable",
"drawable",
"Input drawable",
FALSE,
GIMP_PARAM_READWRITE));
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/* /*
* gimp-plug-in-cubism * gimp-plug-in-cubism
*/ */

View file

@ -432,6 +432,7 @@ gimp_main (GType plug_in_type,
GIMP_TYPE_ARRAY, GIMP_TYPE_PARAM_ARRAY, GIMP_TYPE_ARRAY, GIMP_TYPE_PARAM_ARRAY,
GIMP_TYPE_INT32_ARRAY, GIMP_TYPE_PARAM_INT32_ARRAY, GIMP_TYPE_INT32_ARRAY, GIMP_TYPE_PARAM_INT32_ARRAY,
GIMP_TYPE_DOUBLE_ARRAY, GIMP_TYPE_PARAM_DOUBLE_ARRAY, GIMP_TYPE_DOUBLE_ARRAY, GIMP_TYPE_PARAM_DOUBLE_ARRAY,
GIMP_TYPE_VALUE_ARRAY, GIMP_TYPE_PARAM_VALUE_ARRAY,
GIMP_TYPE_CORE_OBJECT_ARRAY, GIMP_TYPE_PARAM_CORE_OBJECT_ARRAY, GIMP_TYPE_CORE_OBJECT_ARRAY, GIMP_TYPE_PARAM_CORE_OBJECT_ARRAY,
GIMP_TYPE_DISPLAY, GIMP_TYPE_PARAM_DISPLAY, GIMP_TYPE_DISPLAY, GIMP_TYPE_PARAM_DISPLAY,

View file

@ -225,54 +225,6 @@ CODE
); );
} }
sub plug_in_c_astretch {
$blurb = 'Stretch contrast to cover the maximum possible range';
$help = <<'HELP';
This simple plug-in does an automatic contrast stretch. For each
channel in the image, it finds the minimum and maximum values... it
uses those values to stretch the individual histograms to the full
contrast range. For some images it may do just what you want; for
others it may not work that well.
HELP
&std_pdb_compat('gegl:stretch-contrast');
$date = '2013';
@inargs = (
{ name => 'run_mode', type => 'enum GimpRunMode', dead => 1,
desc => 'The run mode' },
{ name => 'image', type => 'image', dead => 1,
desc => 'Input image (unused)' },
{ name => 'drawable', type => 'drawable',
desc => 'Input drawable' }
);
%invoke = (
code => <<'CODE'
{
if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
GIMP_PDB_ITEM_CONTENT, error) &&
gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
{
GeglNode *node =
gegl_node_new_child (NULL,
"operation", "gegl:stretch-contrast",
"keep-colors", (gboolean) FALSE,
NULL);
gimp_drawable_apply_operation (drawable, progress,
C_("undo-type", "Stretch Contrast"),
node);
g_object_unref (node);
}
else
success = FALSE;
}
CODE
);
}
sub plug_in_cubism { sub plug_in_cubism {
$blurb = 'Convert the image into randomly rotated square blobs'; $blurb = 'Convert the image into randomly rotated square blobs';
@ -1517,7 +1469,6 @@ CODE
@procs = qw(plug_in_autocrop @procs = qw(plug_in_autocrop
plug_in_autocrop_layer plug_in_autocrop_layer
plug_in_bump_map plug_in_bump_map
plug_in_c_astretch
plug_in_cubism plug_in_cubism
plug_in_displace plug_in_displace
plug_in_edge plug_in_edge

View file

@ -37,7 +37,7 @@
(gimp-image-flatten img) (gimp-image-flatten img)
(set! bump-layer (vector-ref (car (gimp-image-get-selected-layers img)) 0)) (set! bump-layer (vector-ref (car (gimp-image-get-selected-layers img)) 0))
(plug-in-c-astretch RUN-NONINTERACTIVE img bump-layer) (gimp-drawable-merge-new-filter bump-layer "gegl:stretch-contrast" 0 LAYER-MODE-REPLACE 1.0 "keep-colors" FALSE)
(plug-in-noisify RUN-NONINTERACTIVE img bump-layer FALSE 0.2 0.2 0.2 0.2) (plug-in-noisify RUN-NONINTERACTIVE img bump-layer FALSE 0.2 0.2 0.2 0.2)
(plug-in-bump-map RUN-NONINTERACTIVE img tdrawable bump-layer azimuth elevation depth 0 0 0 0 FALSE FALSE 0) (plug-in-bump-map RUN-NONINTERACTIVE img tdrawable bump-layer azimuth elevation depth 0 0 0 0 FALSE FALSE 0)

View file

@ -39,7 +39,7 @@
(gimp-image-flatten img) (gimp-image-flatten img)
(set! bump-layer (vector-ref (cadr (gimp-image-get-selected-layers img)) 0)) (set! bump-layer (vector-ref (cadr (gimp-image-get-selected-layers img)) 0))
(plug-in-c-astretch RUN-NONINTERACTIVE img bump-layer) (gimp-drawable-merge-new-filter bump-layer "gegl:stretch-contrast" 0 LAYER-MODE-REPLACE 1.0 "keep-colors" FALSE)
(plug-in-noisify RUN-NONINTERACTIVE img bump-layer FALSE 0.2 0.2 0.2 0.2) (plug-in-noisify RUN-NONINTERACTIVE img bump-layer FALSE 0.2 0.2 0.2 0.2)
(plug-in-bump-map RUN-NONINTERACTIVE img tdrawable bump-layer azimuth elevation depth 0 0 0 0 FALSE FALSE 0) (plug-in-bump-map RUN-NONINTERACTIVE img tdrawable bump-layer azimuth elevation depth 0 0 0 0 FALSE FALSE 0)

View file

@ -40,7 +40,7 @@
(gimp-image-flatten img) (gimp-image-flatten img)
(set! bump-layer (car (list (vector-ref (cadr (gimp-image-get-selected-layers img)) 0)))) (set! bump-layer (car (list (vector-ref (cadr (gimp-image-get-selected-layers img)) 0))))
(plug-in-c-astretch RUN-NONINTERACTIVE img bump-layer) (gimp-drawable-merge-new-filter bump-layer "gegl:stretch-contrast" 0 LAYER-MODE-REPLACE 1.0 "keep-colors" FALSE)
(plug-in-noisify RUN-NONINTERACTIVE img bump-layer FALSE 0.2 0.2 0.2 0.2) (plug-in-noisify RUN-NONINTERACTIVE img bump-layer FALSE 0.2 0.2 0.2 0.2)
(plug-in-bump-map RUN-NONINTERACTIVE img tdrawable bump-layer azimuth elevation depth 0 0 0 0 FALSE FALSE 0) (plug-in-bump-map RUN-NONINTERACTIVE img tdrawable bump-layer azimuth elevation depth 0 0 0 0 FALSE FALSE 0)

View file

@ -46,7 +46,7 @@
; We still need cadr even in v3 language ; We still need cadr even in v3 language
(set! bump-layer (vector-ref (cadr (gimp-image-get-selected-layers img)) 0)) (set! bump-layer (vector-ref (cadr (gimp-image-get-selected-layers img)) 0))
(plug-in-c-astretch RUN-NONINTERACTIVE img bump-layer) (gimp-drawable-merge-new-filter bump-layer "gegl:stretch-contrast" 0 LAYER-MODE-REPLACE 1.0 "keep-colors" FALSE)
(plug-in-noisify RUN-NONINTERACTIVE img bump-layer FALSE 0.2 0.2 0.2 0.2) (plug-in-noisify RUN-NONINTERACTIVE img bump-layer FALSE 0.2 0.2 0.2 0.2)
(plug-in-bump-map RUN-NONINTERACTIVE img tdrawable bump-layer azimuth elevation depth 0 0 0 0 FALSE FALSE 0) (plug-in-bump-map RUN-NONINTERACTIVE img tdrawable bump-layer azimuth elevation depth 0 0 0 0 FALSE FALSE 0)

View file

@ -284,12 +284,12 @@
(gimp-context-set-background '(255 255 255)) (gimp-context-set-background '(255 255 255))
(gimp-drawable-edit-fill drawable FILL-BACKGROUND) (gimp-drawable-edit-fill drawable FILL-BACKGROUND)
(plug-in-noisify RUN-NONINTERACTIVE img drawable FALSE dense dense dense dense) (plug-in-noisify RUN-NONINTERACTIVE img drawable FALSE dense dense dense dense)
(plug-in-c-astretch RUN-NONINTERACTIVE img drawable) (gimp-drawable-merge-new-filter drawable "gegl:stretch-contrast" 0 LAYER-MODE-REPLACE 1.0 "keep-colors" FALSE)
(cond ((eq? orientation 'horizontal) (cond ((eq? orientation 'horizontal)
(plug-in-gauss RUN-NONINTERACTIVE img drawable (* 0.32 length) 0 0)) (plug-in-gauss RUN-NONINTERACTIVE img drawable (* 0.32 length) 0 0))
((eq? orientation 'vertical) ((eq? orientation 'vertical)
(plug-in-gauss RUN-NONINTERACTIVE img drawable 0 (* 0.32 length) 0))) (plug-in-gauss RUN-NONINTERACTIVE img drawable 0 (* 0.32 length) 0)))
(plug-in-c-astretch RUN-NONINTERACTIVE img drawable) (gimp-drawable-merge-new-filter drawable "gegl:stretch-contrast" 0 LAYER-MODE-REPLACE 1.0 "keep-colors" FALSE)
drawable)) drawable))
(define (create-complete-weave width (define (create-complete-weave width