2006-12-10 05:33:38 +08:00
/* GIMP - The GNU Image Manipulation Program
2003-07-03 08:47:26 +08:00
* Copyright ( C ) 1995 - 2003 Spencer Kimball and Peter Mattis
1999-04-09 14:00:11 +08:00
*
2009-01-18 06:28:01 +08:00
* This program is free software : you can redistribute it and / or modify
1999-04-09 14:00:11 +08:00
* it under the terms of the GNU General Public License as published by
2009-01-18 06:28:01 +08:00
* the Free Software Foundation ; either version 3 of the License , or
1999-04-09 14:00:11 +08:00
* ( at your option ) any later version .
*
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
*
* You should have received a copy of the GNU General Public License
2009-01-18 06:28:01 +08:00
* along with this program . If not , see < http : //www.gnu.org/licenses/>.
1999-04-09 14:00:11 +08:00
*/
2007-01-09 18:52:47 +08:00
/* NOTE: This file is auto-generated by pdbgen.pl. */
1999-04-11 05:51:25 +08:00
2000-12-29 23:22:01 +08:00
# include "config.h"
2008-10-10 04:24:04 +08:00
# include <gegl.h>
2000-12-29 23:22:01 +08:00
2012-05-03 09:36:22 +08:00
# include <gdk-pixbuf/gdk-pixbuf.h>
2013-06-12 08:01:24 +08:00
# include "libgimpmath/gimpmath.h"
2012-05-04 06:50:23 +08:00
# include "libgimpbase/gimpbase.h"
2001-08-17 22:27:31 +08:00
# include "pdb-types.h"
1999-04-11 05:51:25 +08:00
2013-06-12 08:01:24 +08:00
# include "core/gimp.h"
2001-05-09 10:32:03 +08:00
# include "core/gimpdrawable-equalize.h"
2003-09-01 02:19:13 +08:00
# include "core/gimpdrawable-histogram.h"
2004-10-30 06:18:49 +08:00
# include "core/gimpdrawable-levels.h"
2012-03-14 08:35:54 +08:00
# include "core/gimpdrawable-operation.h"
2001-05-09 10:32:03 +08:00
# include "core/gimpdrawable.h"
2012-03-25 05:29:53 +08:00
# include "core/gimphistogram.h"
2008-02-08 01:08:54 +08:00
# include "core/gimpparamspecs.h"
2012-05-11 03:22:44 +08:00
# include "operations/gimpbrightnesscontrastconfig.h"
# include "operations/gimpcolorbalanceconfig.h"
# include "operations/gimpcolorizeconfig.h"
# include "operations/gimpcurvesconfig.h"
# include "operations/gimphuesaturationconfig.h"
# include "operations/gimplevelsconfig.h"
2013-06-12 08:01:24 +08:00
# include "plug-in/gimpplugin.h"
# include "plug-in/gimppluginmanager.h"
2003-02-14 22:14:29 +08:00
2008-02-08 01:08:54 +08:00
# include "gimppdb.h"
# include "gimppdb-utils.h"
# include "gimpprocedure.h"
2008-04-04 19:15:55 +08:00
# include "internal-procs.h"
2006-11-01 03:02:56 +08:00
2008-02-08 01:08:54 +08:00
# include "gimp-intl.h"
1999-04-11 05:51:25 +08:00
2012-05-04 06:50:23 +08:00
static GimpValueArray *
2012-05-29 01:55:28 +08:00
brightness_contrast_invoker ( GimpProcedure * procedure ,
2012-05-04 06:50:23 +08:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
1999-04-11 05:51:25 +08:00
{
gboolean success = TRUE ;
GimpDrawable * drawable ;
gint32 brightness ;
gint32 contrast ;
2012-05-04 06:50:23 +08:00
drawable = gimp_value_get_drawable ( gimp_value_array_index ( args , 0 ) , gimp ) ;
brightness = g_value_get_int ( gimp_value_array_index ( args , 1 ) ) ;
contrast = g_value_get_int ( gimp_value_array_index ( args , 2 ) ) ;
1999-04-11 05:51:25 +08:00
if ( success )
{
2012-11-09 03:46:18 +08:00
if ( gimp_pdb_item_is_attached ( GIMP_ITEM ( drawable ) , NULL ,
GIMP_PDB_ITEM_CONTENT , error ) & &
2012-03-21 04:33:55 +08:00
gimp_pdb_item_is_not_group ( GIMP_ITEM ( drawable ) , error ) )
2012-03-16 22:43:47 +08:00
{
GObject * config = g_object_new ( GIMP_TYPE_BRIGHTNESS_CONTRAST_CONFIG ,
" brightness " , brightness / 127.0 ,
" contrast " , contrast / 127.0 ,
NULL ) ;
gimp_drawable_apply_operation_by_name ( drawable , progress ,
C_ ( " undo-type " , " Brightness-Contrast " ) ,
" gimp:brightness-contrast " ,
2012-03-26 05:10:30 +08:00
config ) ;
2012-03-16 22:43:47 +08:00
g_object_unref ( config ) ;
}
else
success = FALSE ;
1999-04-11 05:51:25 +08:00
}
1999-04-09 14:00:11 +08:00
2008-08-16 21:57:57 +08:00
return gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
1999-04-11 05:51:25 +08:00
}
1999-04-09 14:00:11 +08:00
2012-05-04 06:50:23 +08:00
static GimpValueArray *
2012-05-29 01:55:28 +08:00
levels_invoker ( GimpProcedure * procedure ,
2012-05-04 06:50:23 +08:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
1999-04-09 14:00:11 +08:00
{
1999-04-11 05:51:25 +08:00
gboolean success = TRUE ;
GimpDrawable * drawable ;
gint32 channel ;
More color correction stuff cleanup:
2002-09-04 Michael Natterer <mitch@gimp.org>
More color correction stuff cleanup:
* app/base/Makefile.am
* app/base/base-types.h
* app/base/levels.[ch]: new files containing levels_lut_func(), a
new "Levels" parameter struct and the "auto levels" stuff.
* app/base/lut-funcs.[ch]: removed the levels stuff here, added
lots of g_return_if_fail().
* app/base/color-balance.[ch]
* app/base/hue-saturation.[ch]: added init() and reset() functions
so we don't need to duplicate this code in the tool and the pdb
wrappers.
* app/base/curves.[ch]: s/gint/GimpHistogramChannel/g, made
curves_channel_reset() initialize the curves array.
* app/tools/gimpcolorbalancetool.[ch]: use the new functions,
moved the "Range" frame to the top, added a per-range "Reset"
button, made the global "Reset" button reset all ranges and
the "Preserve Luminosity" toggle.
* app/tools/gimpcurvestool.[ch]: don't initialize the curves
array manually, as curves_channel_reset() does that,
s/gint/GimpHistogramChannel/g.
* app/tools/gimphuesaturationtool.c: use the new functions, added
a per-channel "Reset" button and made the global "Reset" button
reset all channels, cleaned up the GUI update function.
* app/tools/gimplevelstool.[ch]: changed to use the new Levels
parameter struct and it's utility functions. Removed stuff
which now lives in base/levels.c
* app/tools/gimpimagemaptool.c: align the "Preview" button
bottom-left, not bottom-right.
* tools/pdbgen/pdb/color.pdb: use the new stuff and removed
uglyness because using the "Levels" struct makes the code more
straightforward.
* app/pdb/color_cmds.c: regenerated.
2002-09-04 23:25:15 +08:00
gint32 low_input ;
gint32 high_input ;
gdouble gamma ;
gint32 low_output ;
gint32 high_output ;
1999-04-09 14:00:11 +08:00
2012-05-04 06:50:23 +08:00
drawable = gimp_value_get_drawable ( gimp_value_array_index ( args , 0 ) , gimp ) ;
channel = g_value_get_enum ( gimp_value_array_index ( args , 1 ) ) ;
low_input = g_value_get_int ( gimp_value_array_index ( args , 2 ) ) ;
high_input = g_value_get_int ( gimp_value_array_index ( args , 3 ) ) ;
gamma = g_value_get_double ( gimp_value_array_index ( args , 4 ) ) ;
low_output = g_value_get_int ( gimp_value_array_index ( args , 5 ) ) ;
high_output = g_value_get_int ( gimp_value_array_index ( args , 6 ) ) ;
1999-04-09 14:00:11 +08:00
1999-04-11 05:51:25 +08:00
if ( success )
{
2012-11-09 03:46:18 +08:00
if ( gimp_pdb_item_is_attached ( GIMP_ITEM ( drawable ) , NULL ,
GIMP_PDB_ITEM_CONTENT , error ) & &
2012-03-23 17:25:34 +08:00
gimp_pdb_item_is_not_group ( GIMP_ITEM ( drawable ) , error ) & &
2015-11-02 15:53:50 +08:00
channel ! = GIMP_HISTOGRAM_LUMINANCE & &
2012-03-23 17:25:34 +08:00
( gimp_drawable_has_alpha ( drawable ) | | channel ! = GIMP_HISTOGRAM_ALPHA ) & &
( ! gimp_drawable_is_gray ( drawable ) | |
channel = = GIMP_HISTOGRAM_VALUE | | channel = = GIMP_HISTOGRAM_ALPHA ) )
{
GObject * config = g_object_new ( GIMP_TYPE_LEVELS_CONFIG ,
" channel " , channel ,
NULL ) ;
2004-03-27 00:38:44 +08:00
2012-03-23 17:25:34 +08:00
g_object_set ( config ,
" low-input " , low_input / 255.0 ,
" high-input " , high_input / 255.0 ,
" gamma " , gamma ,
" low-output " , low_output / 255.0 ,
" high-output " , high_output / 255.0 ,
NULL ) ;
gimp_drawable_apply_operation_by_name ( drawable , progress ,
C_ ( " undo-type " , " Levels " ) ,
" gimp:levels " ,
2012-03-26 05:10:30 +08:00
config ) ;
2012-03-23 17:25:34 +08:00
g_object_unref ( config ) ;
}
else
success = TRUE ;
1999-04-09 14:00:11 +08:00
}
2008-08-16 21:57:57 +08:00
return gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
1999-04-09 14:00:11 +08:00
}
2012-05-04 06:50:23 +08:00
static GimpValueArray *
2012-05-29 01:55:28 +08:00
levels_auto_invoker ( GimpProcedure * procedure ,
2012-05-04 06:50:23 +08:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
2003-08-31 23:42:39 +08:00
{
gboolean success = TRUE ;
GimpDrawable * drawable ;
2012-05-04 06:50:23 +08:00
drawable = gimp_value_get_drawable ( gimp_value_array_index ( args , 0 ) , gimp ) ;
2003-08-31 23:42:39 +08:00
if ( success )
{
2012-11-09 03:46:18 +08:00
if ( gimp_pdb_item_is_attached ( GIMP_ITEM ( drawable ) , NULL ,
GIMP_PDB_ITEM_CONTENT , error ) & &
2012-03-23 17:25:34 +08:00
gimp_pdb_item_is_not_group ( GIMP_ITEM ( drawable ) , error ) )
{
gimp_drawable_levels_stretch ( drawable , progress ) ;
}
else
2004-03-27 00:49:18 +08:00
success = FALSE ;
2003-08-31 23:42:39 +08:00
}
2008-08-16 21:57:57 +08:00
return gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
2003-08-31 23:42:39 +08:00
}
2012-05-04 06:50:23 +08:00
static GimpValueArray *
2012-05-29 01:55:28 +08:00
levels_stretch_invoker ( GimpProcedure * procedure ,
2012-05-04 06:50:23 +08:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
2004-11-02 00:20:47 +08:00
{
gboolean success = TRUE ;
GimpDrawable * drawable ;
2012-05-04 06:50:23 +08:00
drawable = gimp_value_get_drawable ( gimp_value_array_index ( args , 0 ) , gimp ) ;
2004-11-02 00:20:47 +08:00
if ( success )
{
2012-11-09 03:46:18 +08:00
if ( gimp_pdb_item_is_attached ( GIMP_ITEM ( drawable ) , NULL ,
GIMP_PDB_ITEM_CONTENT , error ) & &
2012-03-23 17:25:34 +08:00
gimp_pdb_item_is_not_group ( GIMP_ITEM ( drawable ) , error ) )
{
gimp_drawable_levels_stretch ( drawable , progress ) ;
}
else
2004-11-02 00:20:47 +08:00
success = FALSE ;
}
2008-08-16 21:57:57 +08:00
return gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
2004-11-02 00:20:47 +08:00
}
2012-05-04 06:50:23 +08:00
static GimpValueArray *
2012-05-29 01:55:28 +08:00
posterize_invoker ( GimpProcedure * procedure ,
2012-05-04 06:50:23 +08:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
1999-04-09 14:00:11 +08:00
{
1999-04-11 05:51:25 +08:00
gboolean success = TRUE ;
1999-04-09 14:00:11 +08:00
GimpDrawable * drawable ;
1999-04-11 05:51:25 +08:00
gint32 levels ;
2012-05-04 06:50:23 +08:00
drawable = gimp_value_get_drawable ( gimp_value_array_index ( args , 0 ) , gimp ) ;
levels = g_value_get_int ( gimp_value_array_index ( args , 1 ) ) ;
1999-04-11 05:51:25 +08:00
1999-04-09 14:00:11 +08:00
if ( success )
{
2012-11-09 03:46:18 +08:00
if ( gimp_pdb_item_is_attached ( GIMP_ITEM ( drawable ) , NULL ,
GIMP_PDB_ITEM_CONTENT , error ) & &
2012-03-21 04:33:55 +08:00
gimp_pdb_item_is_not_group ( GIMP_ITEM ( drawable ) , error ) )
2012-03-14 08:35:54 +08:00
{
2016-01-17 04:41:00 +08:00
GeglNode * node =
gegl_node_new_child ( NULL ,
" operation " , " gimp:posterize " ,
" levels " , levels ,
NULL ) ;
gimp_drawable_apply_operation ( drawable , progress ,
C_ ( " undo-type " , " Posterize " ) ,
node ) ;
g_object_unref ( node ) ;
2012-03-14 08:35:54 +08:00
}
else
success = FALSE ;
1999-04-09 14:00:11 +08:00
}
2008-08-16 21:57:57 +08:00
return gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
1999-04-09 14:00:11 +08:00
}
2012-05-04 06:50:23 +08:00
static GimpValueArray *
2012-05-29 01:55:28 +08:00
desaturate_invoker ( GimpProcedure * procedure ,
2012-05-04 06:50:23 +08:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
moved a bunch of PDB stuff here
* app/color_cmds.c: moved a bunch of PDB stuff here
* app/color_balance.[ch]: removed PDB proc, exported TransferMode
enum, ColorBalanceDialog, color_balance_create_lookup_tables, and
color_balance
* app/curves.[ch]: removed PDB procs, exported SMOOTH and GFREE
#defines, CurvesDialog, curves_lut_func and curves_calculate_curve
* app/desaturate.[ch]: removed PDB proc, exported desaturate
* app/equalize.[ch]: removed PDB proc, exported equalize
* app/histogram_tool.[ch]: removed PDB proc, exported HISTOGRAM_WIDTH
and HISTOGRAM_HEIGHT #defines, HistogramToolDialog,
histogram_tool_histogram_range
* app/hue_saturation.[ch]: removed PDB proc, exported HueRange enum,
HueSaturationDialog, hue_saturation_calculate_transfers,
hue_saturation
* app/invert.[ch]: remove PDB proc, export invert
* app/threshold.[ch]: remove PDB proc, export ThresholdDialog and
threshold_2
* internal_procs.c: changes for pdbgen
* app/gimprc.c: removed leftover declaration
* app/image_map.h: add #include "gimpdrawableF.h"
* app/lut_funcs.h: add ALPHA_LUT to ChannelLutType
-Yosh
1999-04-21 13:39:57 +08:00
{
gboolean success = TRUE ;
GimpDrawable * drawable ;
2012-05-04 06:50:23 +08:00
drawable = gimp_value_get_drawable ( gimp_value_array_index ( args , 0 ) , gimp ) ;
moved a bunch of PDB stuff here
* app/color_cmds.c: moved a bunch of PDB stuff here
* app/color_balance.[ch]: removed PDB proc, exported TransferMode
enum, ColorBalanceDialog, color_balance_create_lookup_tables, and
color_balance
* app/curves.[ch]: removed PDB procs, exported SMOOTH and GFREE
#defines, CurvesDialog, curves_lut_func and curves_calculate_curve
* app/desaturate.[ch]: removed PDB proc, exported desaturate
* app/equalize.[ch]: removed PDB proc, exported equalize
* app/histogram_tool.[ch]: removed PDB proc, exported HISTOGRAM_WIDTH
and HISTOGRAM_HEIGHT #defines, HistogramToolDialog,
histogram_tool_histogram_range
* app/hue_saturation.[ch]: removed PDB proc, exported HueRange enum,
HueSaturationDialog, hue_saturation_calculate_transfers,
hue_saturation
* app/invert.[ch]: remove PDB proc, export invert
* app/threshold.[ch]: remove PDB proc, export ThresholdDialog and
threshold_2
* internal_procs.c: changes for pdbgen
* app/gimprc.c: removed leftover declaration
* app/image_map.h: add #include "gimpdrawableF.h"
* app/lut_funcs.h: add ALPHA_LUT to ChannelLutType
-Yosh
1999-04-21 13:39:57 +08:00
if ( success )
{
2012-11-09 03:46:18 +08:00
if ( gimp_pdb_item_is_attached ( GIMP_ITEM ( drawable ) , NULL ,
GIMP_PDB_ITEM_CONTENT , error ) & &
2012-03-14 08:35:54 +08:00
gimp_pdb_item_is_not_group ( GIMP_ITEM ( drawable ) , error ) & &
gimp_drawable_is_rgb ( drawable ) )
{
2016-01-17 05:38:12 +08:00
GeglNode * node =
gegl_node_new_child ( NULL ,
" operation " , " gimp:desaturate " ,
" mode " , GIMP_DESATURATE_LIGHTNESS ,
NULL ) ;
2004-11-16 21:41:55 +08:00
2016-01-17 05:38:12 +08:00
gimp_drawable_apply_operation ( drawable , progress ,
C_ ( " undo-type " , " Desaturate " ) ,
node ) ;
g_object_unref ( node ) ;
2012-03-14 08:35:54 +08:00
}
else
success = FALSE ;
moved a bunch of PDB stuff here
* app/color_cmds.c: moved a bunch of PDB stuff here
* app/color_balance.[ch]: removed PDB proc, exported TransferMode
enum, ColorBalanceDialog, color_balance_create_lookup_tables, and
color_balance
* app/curves.[ch]: removed PDB procs, exported SMOOTH and GFREE
#defines, CurvesDialog, curves_lut_func and curves_calculate_curve
* app/desaturate.[ch]: removed PDB proc, exported desaturate
* app/equalize.[ch]: removed PDB proc, exported equalize
* app/histogram_tool.[ch]: removed PDB proc, exported HISTOGRAM_WIDTH
and HISTOGRAM_HEIGHT #defines, HistogramToolDialog,
histogram_tool_histogram_range
* app/hue_saturation.[ch]: removed PDB proc, exported HueRange enum,
HueSaturationDialog, hue_saturation_calculate_transfers,
hue_saturation
* app/invert.[ch]: remove PDB proc, export invert
* app/threshold.[ch]: remove PDB proc, export ThresholdDialog and
threshold_2
* internal_procs.c: changes for pdbgen
* app/gimprc.c: removed leftover declaration
* app/image_map.h: add #include "gimpdrawableF.h"
* app/lut_funcs.h: add ALPHA_LUT to ChannelLutType
-Yosh
1999-04-21 13:39:57 +08:00
}
2008-08-16 21:57:57 +08:00
return gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
moved a bunch of PDB stuff here
* app/color_cmds.c: moved a bunch of PDB stuff here
* app/color_balance.[ch]: removed PDB proc, exported TransferMode
enum, ColorBalanceDialog, color_balance_create_lookup_tables, and
color_balance
* app/curves.[ch]: removed PDB procs, exported SMOOTH and GFREE
#defines, CurvesDialog, curves_lut_func and curves_calculate_curve
* app/desaturate.[ch]: removed PDB proc, exported desaturate
* app/equalize.[ch]: removed PDB proc, exported equalize
* app/histogram_tool.[ch]: removed PDB proc, exported HISTOGRAM_WIDTH
and HISTOGRAM_HEIGHT #defines, HistogramToolDialog,
histogram_tool_histogram_range
* app/hue_saturation.[ch]: removed PDB proc, exported HueRange enum,
HueSaturationDialog, hue_saturation_calculate_transfers,
hue_saturation
* app/invert.[ch]: remove PDB proc, export invert
* app/threshold.[ch]: remove PDB proc, export ThresholdDialog and
threshold_2
* internal_procs.c: changes for pdbgen
* app/gimprc.c: removed leftover declaration
* app/image_map.h: add #include "gimpdrawableF.h"
* app/lut_funcs.h: add ALPHA_LUT to ChannelLutType
-Yosh
1999-04-21 13:39:57 +08:00
}
2012-05-04 06:50:23 +08:00
static GimpValueArray *
2012-05-29 01:55:28 +08:00
desaturate_full_invoker ( GimpProcedure * procedure ,
2012-05-04 06:50:23 +08:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
2005-04-20 04:31:30 +08:00
{
gboolean success = TRUE ;
GimpDrawable * drawable ;
gint32 desaturate_mode ;
2012-05-04 06:50:23 +08:00
drawable = gimp_value_get_drawable ( gimp_value_array_index ( args , 0 ) , gimp ) ;
desaturate_mode = g_value_get_enum ( gimp_value_array_index ( args , 1 ) ) ;
2005-04-20 04:31:30 +08:00
if ( success )
{
2012-11-09 03:46:18 +08:00
if ( gimp_pdb_item_is_attached ( GIMP_ITEM ( drawable ) , NULL ,
GIMP_PDB_ITEM_CONTENT , error ) & &
2012-03-14 08:35:54 +08:00
gimp_pdb_item_is_not_group ( GIMP_ITEM ( drawable ) , error ) & &
gimp_drawable_is_rgb ( drawable ) )
{
2016-01-17 05:38:12 +08:00
GeglNode * node =
gegl_node_new_child ( NULL ,
" operation " , " gimp:desaturate " ,
" mode " , desaturate_mode ,
NULL ) ;
2005-04-20 04:31:30 +08:00
2016-01-17 05:38:12 +08:00
gimp_drawable_apply_operation ( drawable , progress ,
C_ ( " undo-type " , " Desaturate " ) ,
node ) ;
g_object_unref ( node ) ;
2012-03-14 08:35:54 +08:00
}
else
success = FALSE ;
2005-04-20 04:31:30 +08:00
}
2008-08-16 21:57:57 +08:00
return gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
2005-04-20 04:31:30 +08:00
}
2012-05-04 06:50:23 +08:00
static GimpValueArray *
2012-05-29 01:55:28 +08:00
equalize_invoker ( GimpProcedure * procedure ,
2012-05-04 06:50:23 +08:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
moved a bunch of PDB stuff here
* app/color_cmds.c: moved a bunch of PDB stuff here
* app/color_balance.[ch]: removed PDB proc, exported TransferMode
enum, ColorBalanceDialog, color_balance_create_lookup_tables, and
color_balance
* app/curves.[ch]: removed PDB procs, exported SMOOTH and GFREE
#defines, CurvesDialog, curves_lut_func and curves_calculate_curve
* app/desaturate.[ch]: removed PDB proc, exported desaturate
* app/equalize.[ch]: removed PDB proc, exported equalize
* app/histogram_tool.[ch]: removed PDB proc, exported HISTOGRAM_WIDTH
and HISTOGRAM_HEIGHT #defines, HistogramToolDialog,
histogram_tool_histogram_range
* app/hue_saturation.[ch]: removed PDB proc, exported HueRange enum,
HueSaturationDialog, hue_saturation_calculate_transfers,
hue_saturation
* app/invert.[ch]: remove PDB proc, export invert
* app/threshold.[ch]: remove PDB proc, export ThresholdDialog and
threshold_2
* internal_procs.c: changes for pdbgen
* app/gimprc.c: removed leftover declaration
* app/image_map.h: add #include "gimpdrawableF.h"
* app/lut_funcs.h: add ALPHA_LUT to ChannelLutType
-Yosh
1999-04-21 13:39:57 +08:00
{
gboolean success = TRUE ;
GimpDrawable * drawable ;
gboolean mask_only ;
2012-05-04 06:50:23 +08:00
drawable = gimp_value_get_drawable ( gimp_value_array_index ( args , 0 ) , gimp ) ;
mask_only = g_value_get_boolean ( gimp_value_array_index ( args , 1 ) ) ;
moved a bunch of PDB stuff here
* app/color_cmds.c: moved a bunch of PDB stuff here
* app/color_balance.[ch]: removed PDB proc, exported TransferMode
enum, ColorBalanceDialog, color_balance_create_lookup_tables, and
color_balance
* app/curves.[ch]: removed PDB procs, exported SMOOTH and GFREE
#defines, CurvesDialog, curves_lut_func and curves_calculate_curve
* app/desaturate.[ch]: removed PDB proc, exported desaturate
* app/equalize.[ch]: removed PDB proc, exported equalize
* app/histogram_tool.[ch]: removed PDB proc, exported HISTOGRAM_WIDTH
and HISTOGRAM_HEIGHT #defines, HistogramToolDialog,
histogram_tool_histogram_range
* app/hue_saturation.[ch]: removed PDB proc, exported HueRange enum,
HueSaturationDialog, hue_saturation_calculate_transfers,
hue_saturation
* app/invert.[ch]: remove PDB proc, export invert
* app/threshold.[ch]: remove PDB proc, export ThresholdDialog and
threshold_2
* internal_procs.c: changes for pdbgen
* app/gimprc.c: removed leftover declaration
* app/image_map.h: add #include "gimpdrawableF.h"
* app/lut_funcs.h: add ALPHA_LUT to ChannelLutType
-Yosh
1999-04-21 13:39:57 +08:00
if ( success )
{
2012-11-09 03:46:18 +08:00
if ( ! gimp_pdb_item_is_attached ( GIMP_ITEM ( drawable ) , NULL ,
GIMP_PDB_ITEM_CONTENT , error ) | |
2012-04-23 06:47:32 +08:00
! gimp_pdb_item_is_not_group ( GIMP_ITEM ( drawable ) , error ) )
2004-03-27 00:49:18 +08:00
success = FALSE ;
2004-11-16 21:41:55 +08:00
if ( success )
gimp_drawable_equalize ( drawable , mask_only ) ;
moved a bunch of PDB stuff here
* app/color_cmds.c: moved a bunch of PDB stuff here
* app/color_balance.[ch]: removed PDB proc, exported TransferMode
enum, ColorBalanceDialog, color_balance_create_lookup_tables, and
color_balance
* app/curves.[ch]: removed PDB procs, exported SMOOTH and GFREE
#defines, CurvesDialog, curves_lut_func and curves_calculate_curve
* app/desaturate.[ch]: removed PDB proc, exported desaturate
* app/equalize.[ch]: removed PDB proc, exported equalize
* app/histogram_tool.[ch]: removed PDB proc, exported HISTOGRAM_WIDTH
and HISTOGRAM_HEIGHT #defines, HistogramToolDialog,
histogram_tool_histogram_range
* app/hue_saturation.[ch]: removed PDB proc, exported HueRange enum,
HueSaturationDialog, hue_saturation_calculate_transfers,
hue_saturation
* app/invert.[ch]: remove PDB proc, export invert
* app/threshold.[ch]: remove PDB proc, export ThresholdDialog and
threshold_2
* internal_procs.c: changes for pdbgen
* app/gimprc.c: removed leftover declaration
* app/image_map.h: add #include "gimpdrawableF.h"
* app/lut_funcs.h: add ALPHA_LUT to ChannelLutType
-Yosh
1999-04-21 13:39:57 +08:00
}
2008-08-16 21:57:57 +08:00
return gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
moved a bunch of PDB stuff here
* app/color_cmds.c: moved a bunch of PDB stuff here
* app/color_balance.[ch]: removed PDB proc, exported TransferMode
enum, ColorBalanceDialog, color_balance_create_lookup_tables, and
color_balance
* app/curves.[ch]: removed PDB procs, exported SMOOTH and GFREE
#defines, CurvesDialog, curves_lut_func and curves_calculate_curve
* app/desaturate.[ch]: removed PDB proc, exported desaturate
* app/equalize.[ch]: removed PDB proc, exported equalize
* app/histogram_tool.[ch]: removed PDB proc, exported HISTOGRAM_WIDTH
and HISTOGRAM_HEIGHT #defines, HistogramToolDialog,
histogram_tool_histogram_range
* app/hue_saturation.[ch]: removed PDB proc, exported HueRange enum,
HueSaturationDialog, hue_saturation_calculate_transfers,
hue_saturation
* app/invert.[ch]: remove PDB proc, export invert
* app/threshold.[ch]: remove PDB proc, export ThresholdDialog and
threshold_2
* internal_procs.c: changes for pdbgen
* app/gimprc.c: removed leftover declaration
* app/image_map.h: add #include "gimpdrawableF.h"
* app/lut_funcs.h: add ALPHA_LUT to ChannelLutType
-Yosh
1999-04-21 13:39:57 +08:00
}
2012-05-04 06:50:23 +08:00
static GimpValueArray *
2012-05-29 01:55:28 +08:00
invert_invoker ( GimpProcedure * procedure ,
2012-05-04 06:50:23 +08:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
moved a bunch of PDB stuff here
* app/color_cmds.c: moved a bunch of PDB stuff here
* app/color_balance.[ch]: removed PDB proc, exported TransferMode
enum, ColorBalanceDialog, color_balance_create_lookup_tables, and
color_balance
* app/curves.[ch]: removed PDB procs, exported SMOOTH and GFREE
#defines, CurvesDialog, curves_lut_func and curves_calculate_curve
* app/desaturate.[ch]: removed PDB proc, exported desaturate
* app/equalize.[ch]: removed PDB proc, exported equalize
* app/histogram_tool.[ch]: removed PDB proc, exported HISTOGRAM_WIDTH
and HISTOGRAM_HEIGHT #defines, HistogramToolDialog,
histogram_tool_histogram_range
* app/hue_saturation.[ch]: removed PDB proc, exported HueRange enum,
HueSaturationDialog, hue_saturation_calculate_transfers,
hue_saturation
* app/invert.[ch]: remove PDB proc, export invert
* app/threshold.[ch]: remove PDB proc, export ThresholdDialog and
threshold_2
* internal_procs.c: changes for pdbgen
* app/gimprc.c: removed leftover declaration
* app/image_map.h: add #include "gimpdrawableF.h"
* app/lut_funcs.h: add ALPHA_LUT to ChannelLutType
-Yosh
1999-04-21 13:39:57 +08:00
{
gboolean success = TRUE ;
GimpDrawable * drawable ;
2012-05-04 06:50:23 +08:00
drawable = gimp_value_get_drawable ( gimp_value_array_index ( args , 0 ) , gimp ) ;
moved a bunch of PDB stuff here
* app/color_cmds.c: moved a bunch of PDB stuff here
* app/color_balance.[ch]: removed PDB proc, exported TransferMode
enum, ColorBalanceDialog, color_balance_create_lookup_tables, and
color_balance
* app/curves.[ch]: removed PDB procs, exported SMOOTH and GFREE
#defines, CurvesDialog, curves_lut_func and curves_calculate_curve
* app/desaturate.[ch]: removed PDB proc, exported desaturate
* app/equalize.[ch]: removed PDB proc, exported equalize
* app/histogram_tool.[ch]: removed PDB proc, exported HISTOGRAM_WIDTH
and HISTOGRAM_HEIGHT #defines, HistogramToolDialog,
histogram_tool_histogram_range
* app/hue_saturation.[ch]: removed PDB proc, exported HueRange enum,
HueSaturationDialog, hue_saturation_calculate_transfers,
hue_saturation
* app/invert.[ch]: remove PDB proc, export invert
* app/threshold.[ch]: remove PDB proc, export ThresholdDialog and
threshold_2
* internal_procs.c: changes for pdbgen
* app/gimprc.c: removed leftover declaration
* app/image_map.h: add #include "gimpdrawableF.h"
* app/lut_funcs.h: add ALPHA_LUT to ChannelLutType
-Yosh
1999-04-21 13:39:57 +08:00
if ( success )
{
2012-11-09 03:46:18 +08:00
if ( gimp_pdb_item_is_attached ( GIMP_ITEM ( drawable ) , NULL ,
GIMP_PDB_ITEM_CONTENT , error ) & &
2012-04-23 06:47:32 +08:00
gimp_pdb_item_is_not_group ( GIMP_ITEM ( drawable ) , error ) )
2012-03-14 17:26:33 +08:00
{
gimp_drawable_apply_operation_by_name ( drawable , progress ,
_ ( " Invert " ) ,
2013-06-24 06:45:04 +08:00
" gegl:invert-gamma " ,
2012-03-26 05:10:30 +08:00
NULL ) ;
2012-03-14 17:26:33 +08:00
}
else
2004-03-27 00:49:18 +08:00
success = FALSE ;
moved a bunch of PDB stuff here
* app/color_cmds.c: moved a bunch of PDB stuff here
* app/color_balance.[ch]: removed PDB proc, exported TransferMode
enum, ColorBalanceDialog, color_balance_create_lookup_tables, and
color_balance
* app/curves.[ch]: removed PDB procs, exported SMOOTH and GFREE
#defines, CurvesDialog, curves_lut_func and curves_calculate_curve
* app/desaturate.[ch]: removed PDB proc, exported desaturate
* app/equalize.[ch]: removed PDB proc, exported equalize
* app/histogram_tool.[ch]: removed PDB proc, exported HISTOGRAM_WIDTH
and HISTOGRAM_HEIGHT #defines, HistogramToolDialog,
histogram_tool_histogram_range
* app/hue_saturation.[ch]: removed PDB proc, exported HueRange enum,
HueSaturationDialog, hue_saturation_calculate_transfers,
hue_saturation
* app/invert.[ch]: remove PDB proc, export invert
* app/threshold.[ch]: remove PDB proc, export ThresholdDialog and
threshold_2
* internal_procs.c: changes for pdbgen
* app/gimprc.c: removed leftover declaration
* app/image_map.h: add #include "gimpdrawableF.h"
* app/lut_funcs.h: add ALPHA_LUT to ChannelLutType
-Yosh
1999-04-21 13:39:57 +08:00
}
2008-08-16 21:57:57 +08:00
return gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
moved a bunch of PDB stuff here
* app/color_cmds.c: moved a bunch of PDB stuff here
* app/color_balance.[ch]: removed PDB proc, exported TransferMode
enum, ColorBalanceDialog, color_balance_create_lookup_tables, and
color_balance
* app/curves.[ch]: removed PDB procs, exported SMOOTH and GFREE
#defines, CurvesDialog, curves_lut_func and curves_calculate_curve
* app/desaturate.[ch]: removed PDB proc, exported desaturate
* app/equalize.[ch]: removed PDB proc, exported equalize
* app/histogram_tool.[ch]: removed PDB proc, exported HISTOGRAM_WIDTH
and HISTOGRAM_HEIGHT #defines, HistogramToolDialog,
histogram_tool_histogram_range
* app/hue_saturation.[ch]: removed PDB proc, exported HueRange enum,
HueSaturationDialog, hue_saturation_calculate_transfers,
hue_saturation
* app/invert.[ch]: remove PDB proc, export invert
* app/threshold.[ch]: remove PDB proc, export ThresholdDialog and
threshold_2
* internal_procs.c: changes for pdbgen
* app/gimprc.c: removed leftover declaration
* app/image_map.h: add #include "gimpdrawableF.h"
* app/lut_funcs.h: add ALPHA_LUT to ChannelLutType
-Yosh
1999-04-21 13:39:57 +08:00
}
2012-05-04 06:50:23 +08:00
static GimpValueArray *
2012-05-29 01:55:28 +08:00
curves_spline_invoker ( GimpProcedure * procedure ,
2012-05-04 06:50:23 +08:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
moved a bunch of PDB stuff here
* app/color_cmds.c: moved a bunch of PDB stuff here
* app/color_balance.[ch]: removed PDB proc, exported TransferMode
enum, ColorBalanceDialog, color_balance_create_lookup_tables, and
color_balance
* app/curves.[ch]: removed PDB procs, exported SMOOTH and GFREE
#defines, CurvesDialog, curves_lut_func and curves_calculate_curve
* app/desaturate.[ch]: removed PDB proc, exported desaturate
* app/equalize.[ch]: removed PDB proc, exported equalize
* app/histogram_tool.[ch]: removed PDB proc, exported HISTOGRAM_WIDTH
and HISTOGRAM_HEIGHT #defines, HistogramToolDialog,
histogram_tool_histogram_range
* app/hue_saturation.[ch]: removed PDB proc, exported HueRange enum,
HueSaturationDialog, hue_saturation_calculate_transfers,
hue_saturation
* app/invert.[ch]: remove PDB proc, export invert
* app/threshold.[ch]: remove PDB proc, export ThresholdDialog and
threshold_2
* internal_procs.c: changes for pdbgen
* app/gimprc.c: removed leftover declaration
* app/image_map.h: add #include "gimpdrawableF.h"
* app/lut_funcs.h: add ALPHA_LUT to ChannelLutType
-Yosh
1999-04-21 13:39:57 +08:00
{
gboolean success = TRUE ;
GimpDrawable * drawable ;
gint32 channel ;
gint32 num_points ;
2006-04-03 00:03:32 +08:00
const guint8 * control_pts ;
moved a bunch of PDB stuff here
* app/color_cmds.c: moved a bunch of PDB stuff here
* app/color_balance.[ch]: removed PDB proc, exported TransferMode
enum, ColorBalanceDialog, color_balance_create_lookup_tables, and
color_balance
* app/curves.[ch]: removed PDB procs, exported SMOOTH and GFREE
#defines, CurvesDialog, curves_lut_func and curves_calculate_curve
* app/desaturate.[ch]: removed PDB proc, exported desaturate
* app/equalize.[ch]: removed PDB proc, exported equalize
* app/histogram_tool.[ch]: removed PDB proc, exported HISTOGRAM_WIDTH
and HISTOGRAM_HEIGHT #defines, HistogramToolDialog,
histogram_tool_histogram_range
* app/hue_saturation.[ch]: removed PDB proc, exported HueRange enum,
HueSaturationDialog, hue_saturation_calculate_transfers,
hue_saturation
* app/invert.[ch]: remove PDB proc, export invert
* app/threshold.[ch]: remove PDB proc, export ThresholdDialog and
threshold_2
* internal_procs.c: changes for pdbgen
* app/gimprc.c: removed leftover declaration
* app/image_map.h: add #include "gimpdrawableF.h"
* app/lut_funcs.h: add ALPHA_LUT to ChannelLutType
-Yosh
1999-04-21 13:39:57 +08:00
2012-05-04 06:50:23 +08:00
drawable = gimp_value_get_drawable ( gimp_value_array_index ( args , 0 ) , gimp ) ;
channel = g_value_get_enum ( gimp_value_array_index ( args , 1 ) ) ;
num_points = g_value_get_int ( gimp_value_array_index ( args , 2 ) ) ;
control_pts = gimp_value_get_int8array ( gimp_value_array_index ( args , 3 ) ) ;
moved a bunch of PDB stuff here
* app/color_cmds.c: moved a bunch of PDB stuff here
* app/color_balance.[ch]: removed PDB proc, exported TransferMode
enum, ColorBalanceDialog, color_balance_create_lookup_tables, and
color_balance
* app/curves.[ch]: removed PDB procs, exported SMOOTH and GFREE
#defines, CurvesDialog, curves_lut_func and curves_calculate_curve
* app/desaturate.[ch]: removed PDB proc, exported desaturate
* app/equalize.[ch]: removed PDB proc, exported equalize
* app/histogram_tool.[ch]: removed PDB proc, exported HISTOGRAM_WIDTH
and HISTOGRAM_HEIGHT #defines, HistogramToolDialog,
histogram_tool_histogram_range
* app/hue_saturation.[ch]: removed PDB proc, exported HueRange enum,
HueSaturationDialog, hue_saturation_calculate_transfers,
hue_saturation
* app/invert.[ch]: remove PDB proc, export invert
* app/threshold.[ch]: remove PDB proc, export ThresholdDialog and
threshold_2
* internal_procs.c: changes for pdbgen
* app/gimprc.c: removed leftover declaration
* app/image_map.h: add #include "gimpdrawableF.h"
* app/lut_funcs.h: add ALPHA_LUT to ChannelLutType
-Yosh
1999-04-21 13:39:57 +08:00
if ( success )
{
2012-11-09 03:46:18 +08:00
if ( gimp_pdb_item_is_attached ( GIMP_ITEM ( drawable ) , NULL ,
GIMP_PDB_ITEM_CONTENT , error ) & &
2012-03-23 16:55:35 +08:00
gimp_pdb_item_is_not_group ( GIMP_ITEM ( drawable ) , error ) & &
! ( num_points & 1 ) & &
( gimp_drawable_has_alpha ( drawable ) | | channel ! = GIMP_HISTOGRAM_ALPHA ) & &
( ! gimp_drawable_is_gray ( drawable ) | |
2015-11-02 15:53:50 +08:00
channel = = GIMP_HISTOGRAM_VALUE | | channel = = GIMP_HISTOGRAM_ALPHA ) & &
channel ! = GIMP_HISTOGRAM_LUMINANCE )
2012-03-23 16:55:35 +08:00
{
2014-06-18 03:10:33 +08:00
GObject * config = gimp_curves_config_new_spline_cruft ( channel ,
control_pts ,
num_points / 2 ) ;
2004-03-27 00:38:44 +08:00
2012-03-23 16:55:35 +08:00
gimp_drawable_apply_operation_by_name ( drawable , progress ,
C_ ( " undo-type " , " Curves " ) ,
" gimp:curves " ,
2012-03-26 05:10:30 +08:00
config ) ;
2012-03-23 16:55:35 +08:00
g_object_unref ( config ) ;
}
else
success = FALSE ;
moved a bunch of PDB stuff here
* app/color_cmds.c: moved a bunch of PDB stuff here
* app/color_balance.[ch]: removed PDB proc, exported TransferMode
enum, ColorBalanceDialog, color_balance_create_lookup_tables, and
color_balance
* app/curves.[ch]: removed PDB procs, exported SMOOTH and GFREE
#defines, CurvesDialog, curves_lut_func and curves_calculate_curve
* app/desaturate.[ch]: removed PDB proc, exported desaturate
* app/equalize.[ch]: removed PDB proc, exported equalize
* app/histogram_tool.[ch]: removed PDB proc, exported HISTOGRAM_WIDTH
and HISTOGRAM_HEIGHT #defines, HistogramToolDialog,
histogram_tool_histogram_range
* app/hue_saturation.[ch]: removed PDB proc, exported HueRange enum,
HueSaturationDialog, hue_saturation_calculate_transfers,
hue_saturation
* app/invert.[ch]: remove PDB proc, export invert
* app/threshold.[ch]: remove PDB proc, export ThresholdDialog and
threshold_2
* internal_procs.c: changes for pdbgen
* app/gimprc.c: removed leftover declaration
* app/image_map.h: add #include "gimpdrawableF.h"
* app/lut_funcs.h: add ALPHA_LUT to ChannelLutType
-Yosh
1999-04-21 13:39:57 +08:00
}
2008-08-16 21:57:57 +08:00
return gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
moved a bunch of PDB stuff here
* app/color_cmds.c: moved a bunch of PDB stuff here
* app/color_balance.[ch]: removed PDB proc, exported TransferMode
enum, ColorBalanceDialog, color_balance_create_lookup_tables, and
color_balance
* app/curves.[ch]: removed PDB procs, exported SMOOTH and GFREE
#defines, CurvesDialog, curves_lut_func and curves_calculate_curve
* app/desaturate.[ch]: removed PDB proc, exported desaturate
* app/equalize.[ch]: removed PDB proc, exported equalize
* app/histogram_tool.[ch]: removed PDB proc, exported HISTOGRAM_WIDTH
and HISTOGRAM_HEIGHT #defines, HistogramToolDialog,
histogram_tool_histogram_range
* app/hue_saturation.[ch]: removed PDB proc, exported HueRange enum,
HueSaturationDialog, hue_saturation_calculate_transfers,
hue_saturation
* app/invert.[ch]: remove PDB proc, export invert
* app/threshold.[ch]: remove PDB proc, export ThresholdDialog and
threshold_2
* internal_procs.c: changes for pdbgen
* app/gimprc.c: removed leftover declaration
* app/image_map.h: add #include "gimpdrawableF.h"
* app/lut_funcs.h: add ALPHA_LUT to ChannelLutType
-Yosh
1999-04-21 13:39:57 +08:00
}
2012-05-04 06:50:23 +08:00
static GimpValueArray *
2012-05-29 01:55:28 +08:00
curves_explicit_invoker ( GimpProcedure * procedure ,
2012-05-04 06:50:23 +08:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
moved a bunch of PDB stuff here
* app/color_cmds.c: moved a bunch of PDB stuff here
* app/color_balance.[ch]: removed PDB proc, exported TransferMode
enum, ColorBalanceDialog, color_balance_create_lookup_tables, and
color_balance
* app/curves.[ch]: removed PDB procs, exported SMOOTH and GFREE
#defines, CurvesDialog, curves_lut_func and curves_calculate_curve
* app/desaturate.[ch]: removed PDB proc, exported desaturate
* app/equalize.[ch]: removed PDB proc, exported equalize
* app/histogram_tool.[ch]: removed PDB proc, exported HISTOGRAM_WIDTH
and HISTOGRAM_HEIGHT #defines, HistogramToolDialog,
histogram_tool_histogram_range
* app/hue_saturation.[ch]: removed PDB proc, exported HueRange enum,
HueSaturationDialog, hue_saturation_calculate_transfers,
hue_saturation
* app/invert.[ch]: remove PDB proc, export invert
* app/threshold.[ch]: remove PDB proc, export ThresholdDialog and
threshold_2
* internal_procs.c: changes for pdbgen
* app/gimprc.c: removed leftover declaration
* app/image_map.h: add #include "gimpdrawableF.h"
* app/lut_funcs.h: add ALPHA_LUT to ChannelLutType
-Yosh
1999-04-21 13:39:57 +08:00
{
gboolean success = TRUE ;
GimpDrawable * drawable ;
gint32 channel ;
gint32 num_bytes ;
2006-04-03 00:03:32 +08:00
const guint8 * curve ;
moved a bunch of PDB stuff here
* app/color_cmds.c: moved a bunch of PDB stuff here
* app/color_balance.[ch]: removed PDB proc, exported TransferMode
enum, ColorBalanceDialog, color_balance_create_lookup_tables, and
color_balance
* app/curves.[ch]: removed PDB procs, exported SMOOTH and GFREE
#defines, CurvesDialog, curves_lut_func and curves_calculate_curve
* app/desaturate.[ch]: removed PDB proc, exported desaturate
* app/equalize.[ch]: removed PDB proc, exported equalize
* app/histogram_tool.[ch]: removed PDB proc, exported HISTOGRAM_WIDTH
and HISTOGRAM_HEIGHT #defines, HistogramToolDialog,
histogram_tool_histogram_range
* app/hue_saturation.[ch]: removed PDB proc, exported HueRange enum,
HueSaturationDialog, hue_saturation_calculate_transfers,
hue_saturation
* app/invert.[ch]: remove PDB proc, export invert
* app/threshold.[ch]: remove PDB proc, export ThresholdDialog and
threshold_2
* internal_procs.c: changes for pdbgen
* app/gimprc.c: removed leftover declaration
* app/image_map.h: add #include "gimpdrawableF.h"
* app/lut_funcs.h: add ALPHA_LUT to ChannelLutType
-Yosh
1999-04-21 13:39:57 +08:00
2012-05-04 06:50:23 +08:00
drawable = gimp_value_get_drawable ( gimp_value_array_index ( args , 0 ) , gimp ) ;
channel = g_value_get_enum ( gimp_value_array_index ( args , 1 ) ) ;
num_bytes = g_value_get_int ( gimp_value_array_index ( args , 2 ) ) ;
curve = gimp_value_get_int8array ( gimp_value_array_index ( args , 3 ) ) ;
moved a bunch of PDB stuff here
* app/color_cmds.c: moved a bunch of PDB stuff here
* app/color_balance.[ch]: removed PDB proc, exported TransferMode
enum, ColorBalanceDialog, color_balance_create_lookup_tables, and
color_balance
* app/curves.[ch]: removed PDB procs, exported SMOOTH and GFREE
#defines, CurvesDialog, curves_lut_func and curves_calculate_curve
* app/desaturate.[ch]: removed PDB proc, exported desaturate
* app/equalize.[ch]: removed PDB proc, exported equalize
* app/histogram_tool.[ch]: removed PDB proc, exported HISTOGRAM_WIDTH
and HISTOGRAM_HEIGHT #defines, HistogramToolDialog,
histogram_tool_histogram_range
* app/hue_saturation.[ch]: removed PDB proc, exported HueRange enum,
HueSaturationDialog, hue_saturation_calculate_transfers,
hue_saturation
* app/invert.[ch]: remove PDB proc, export invert
* app/threshold.[ch]: remove PDB proc, export ThresholdDialog and
threshold_2
* internal_procs.c: changes for pdbgen
* app/gimprc.c: removed leftover declaration
* app/image_map.h: add #include "gimpdrawableF.h"
* app/lut_funcs.h: add ALPHA_LUT to ChannelLutType
-Yosh
1999-04-21 13:39:57 +08:00
if ( success )
{
2012-11-09 03:46:18 +08:00
if ( gimp_pdb_item_is_attached ( GIMP_ITEM ( drawable ) , NULL ,
GIMP_PDB_ITEM_CONTENT , error ) & &
2012-03-23 16:55:35 +08:00
gimp_pdb_item_is_not_group ( GIMP_ITEM ( drawable ) , error ) & &
( num_bytes = = 256 ) & &
( gimp_drawable_has_alpha ( drawable ) | | channel ! = GIMP_HISTOGRAM_ALPHA ) & &
( ! gimp_drawable_is_gray ( drawable ) | |
2015-11-02 15:53:50 +08:00
channel = = GIMP_HISTOGRAM_VALUE | | channel = = GIMP_HISTOGRAM_ALPHA ) & &
channel ! = GIMP_HISTOGRAM_LUMINANCE )
2012-03-23 16:55:35 +08:00
{
2014-06-18 03:10:33 +08:00
GObject * config = gimp_curves_config_new_explicit_cruft ( channel ,
curve ,
num_bytes ) ;
2004-03-27 00:38:44 +08:00
2012-03-23 16:55:35 +08:00
gimp_drawable_apply_operation_by_name ( drawable , progress ,
C_ ( " undo-type " , " Curves " ) ,
" gimp:curves " ,
2012-03-26 05:10:30 +08:00
config ) ;
2012-03-23 16:55:35 +08:00
g_object_unref ( config ) ;
}
else
success = FALSE ;
moved a bunch of PDB stuff here
* app/color_cmds.c: moved a bunch of PDB stuff here
* app/color_balance.[ch]: removed PDB proc, exported TransferMode
enum, ColorBalanceDialog, color_balance_create_lookup_tables, and
color_balance
* app/curves.[ch]: removed PDB procs, exported SMOOTH and GFREE
#defines, CurvesDialog, curves_lut_func and curves_calculate_curve
* app/desaturate.[ch]: removed PDB proc, exported desaturate
* app/equalize.[ch]: removed PDB proc, exported equalize
* app/histogram_tool.[ch]: removed PDB proc, exported HISTOGRAM_WIDTH
and HISTOGRAM_HEIGHT #defines, HistogramToolDialog,
histogram_tool_histogram_range
* app/hue_saturation.[ch]: removed PDB proc, exported HueRange enum,
HueSaturationDialog, hue_saturation_calculate_transfers,
hue_saturation
* app/invert.[ch]: remove PDB proc, export invert
* app/threshold.[ch]: remove PDB proc, export ThresholdDialog and
threshold_2
* internal_procs.c: changes for pdbgen
* app/gimprc.c: removed leftover declaration
* app/image_map.h: add #include "gimpdrawableF.h"
* app/lut_funcs.h: add ALPHA_LUT to ChannelLutType
-Yosh
1999-04-21 13:39:57 +08:00
}
2008-08-16 21:57:57 +08:00
return gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
moved a bunch of PDB stuff here
* app/color_cmds.c: moved a bunch of PDB stuff here
* app/color_balance.[ch]: removed PDB proc, exported TransferMode
enum, ColorBalanceDialog, color_balance_create_lookup_tables, and
color_balance
* app/curves.[ch]: removed PDB procs, exported SMOOTH and GFREE
#defines, CurvesDialog, curves_lut_func and curves_calculate_curve
* app/desaturate.[ch]: removed PDB proc, exported desaturate
* app/equalize.[ch]: removed PDB proc, exported equalize
* app/histogram_tool.[ch]: removed PDB proc, exported HISTOGRAM_WIDTH
and HISTOGRAM_HEIGHT #defines, HistogramToolDialog,
histogram_tool_histogram_range
* app/hue_saturation.[ch]: removed PDB proc, exported HueRange enum,
HueSaturationDialog, hue_saturation_calculate_transfers,
hue_saturation
* app/invert.[ch]: remove PDB proc, export invert
* app/threshold.[ch]: remove PDB proc, export ThresholdDialog and
threshold_2
* internal_procs.c: changes for pdbgen
* app/gimprc.c: removed leftover declaration
* app/image_map.h: add #include "gimpdrawableF.h"
* app/lut_funcs.h: add ALPHA_LUT to ChannelLutType
-Yosh
1999-04-21 13:39:57 +08:00
}
2012-05-04 06:50:23 +08:00
static GimpValueArray *
2012-05-29 01:55:28 +08:00
color_balance_invoker ( GimpProcedure * procedure ,
2012-05-04 06:50:23 +08:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
moved a bunch of PDB stuff here
* app/color_cmds.c: moved a bunch of PDB stuff here
* app/color_balance.[ch]: removed PDB proc, exported TransferMode
enum, ColorBalanceDialog, color_balance_create_lookup_tables, and
color_balance
* app/curves.[ch]: removed PDB procs, exported SMOOTH and GFREE
#defines, CurvesDialog, curves_lut_func and curves_calculate_curve
* app/desaturate.[ch]: removed PDB proc, exported desaturate
* app/equalize.[ch]: removed PDB proc, exported equalize
* app/histogram_tool.[ch]: removed PDB proc, exported HISTOGRAM_WIDTH
and HISTOGRAM_HEIGHT #defines, HistogramToolDialog,
histogram_tool_histogram_range
* app/hue_saturation.[ch]: removed PDB proc, exported HueRange enum,
HueSaturationDialog, hue_saturation_calculate_transfers,
hue_saturation
* app/invert.[ch]: remove PDB proc, export invert
* app/threshold.[ch]: remove PDB proc, export ThresholdDialog and
threshold_2
* internal_procs.c: changes for pdbgen
* app/gimprc.c: removed leftover declaration
* app/image_map.h: add #include "gimpdrawableF.h"
* app/lut_funcs.h: add ALPHA_LUT to ChannelLutType
-Yosh
1999-04-21 13:39:57 +08:00
{
gboolean success = TRUE ;
GimpDrawable * drawable ;
gint32 transfer_mode ;
gboolean preserve_lum ;
gdouble cyan_red ;
gdouble magenta_green ;
gdouble yellow_blue ;
2012-05-04 06:50:23 +08:00
drawable = gimp_value_get_drawable ( gimp_value_array_index ( args , 0 ) , gimp ) ;
transfer_mode = g_value_get_enum ( gimp_value_array_index ( args , 1 ) ) ;
preserve_lum = g_value_get_boolean ( gimp_value_array_index ( args , 2 ) ) ;
cyan_red = g_value_get_double ( gimp_value_array_index ( args , 3 ) ) ;
magenta_green = g_value_get_double ( gimp_value_array_index ( args , 4 ) ) ;
yellow_blue = g_value_get_double ( gimp_value_array_index ( args , 5 ) ) ;
moved a bunch of PDB stuff here
* app/color_cmds.c: moved a bunch of PDB stuff here
* app/color_balance.[ch]: removed PDB proc, exported TransferMode
enum, ColorBalanceDialog, color_balance_create_lookup_tables, and
color_balance
* app/curves.[ch]: removed PDB procs, exported SMOOTH and GFREE
#defines, CurvesDialog, curves_lut_func and curves_calculate_curve
* app/desaturate.[ch]: removed PDB proc, exported desaturate
* app/equalize.[ch]: removed PDB proc, exported equalize
* app/histogram_tool.[ch]: removed PDB proc, exported HISTOGRAM_WIDTH
and HISTOGRAM_HEIGHT #defines, HistogramToolDialog,
histogram_tool_histogram_range
* app/hue_saturation.[ch]: removed PDB proc, exported HueRange enum,
HueSaturationDialog, hue_saturation_calculate_transfers,
hue_saturation
* app/invert.[ch]: remove PDB proc, export invert
* app/threshold.[ch]: remove PDB proc, export ThresholdDialog and
threshold_2
* internal_procs.c: changes for pdbgen
* app/gimprc.c: removed leftover declaration
* app/image_map.h: add #include "gimpdrawableF.h"
* app/lut_funcs.h: add ALPHA_LUT to ChannelLutType
-Yosh
1999-04-21 13:39:57 +08:00
if ( success )
{
2012-11-09 03:46:18 +08:00
if ( gimp_pdb_item_is_attached ( GIMP_ITEM ( drawable ) , NULL ,
GIMP_PDB_ITEM_CONTENT , error ) & &
2012-03-28 03:56:29 +08:00
gimp_pdb_item_is_not_group ( GIMP_ITEM ( drawable ) , error ) )
{
2014-01-13 05:11:15 +08:00
GObject * config = g_object_new ( GIMP_TYPE_COLOR_BALANCE_CONFIG ,
2012-03-28 03:56:29 +08:00
" range " , transfer_mode ,
" preserve-luminosity " , preserve_lum ,
NULL ) ;
2004-03-27 00:38:44 +08:00
2012-03-28 03:56:29 +08:00
g_object_set ( config ,
" cyan-red " , cyan_red / 100.0 ,
" magenta-green " , magenta_green / 100.0 ,
" yellow-blue " , yellow_blue / 100.0 ,
NULL ) ;
gimp_drawable_apply_operation_by_name ( drawable , progress ,
C_ ( " undo-type " , " Color Balance " ) ,
" gimp:color-balance " ,
config ) ;
g_object_unref ( config ) ;
}
else
success = FALSE ;
moved a bunch of PDB stuff here
* app/color_cmds.c: moved a bunch of PDB stuff here
* app/color_balance.[ch]: removed PDB proc, exported TransferMode
enum, ColorBalanceDialog, color_balance_create_lookup_tables, and
color_balance
* app/curves.[ch]: removed PDB procs, exported SMOOTH and GFREE
#defines, CurvesDialog, curves_lut_func and curves_calculate_curve
* app/desaturate.[ch]: removed PDB proc, exported desaturate
* app/equalize.[ch]: removed PDB proc, exported equalize
* app/histogram_tool.[ch]: removed PDB proc, exported HISTOGRAM_WIDTH
and HISTOGRAM_HEIGHT #defines, HistogramToolDialog,
histogram_tool_histogram_range
* app/hue_saturation.[ch]: removed PDB proc, exported HueRange enum,
HueSaturationDialog, hue_saturation_calculate_transfers,
hue_saturation
* app/invert.[ch]: remove PDB proc, export invert
* app/threshold.[ch]: remove PDB proc, export ThresholdDialog and
threshold_2
* internal_procs.c: changes for pdbgen
* app/gimprc.c: removed leftover declaration
* app/image_map.h: add #include "gimpdrawableF.h"
* app/lut_funcs.h: add ALPHA_LUT to ChannelLutType
-Yosh
1999-04-21 13:39:57 +08:00
}
2008-08-16 21:57:57 +08:00
return gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
moved a bunch of PDB stuff here
* app/color_cmds.c: moved a bunch of PDB stuff here
* app/color_balance.[ch]: removed PDB proc, exported TransferMode
enum, ColorBalanceDialog, color_balance_create_lookup_tables, and
color_balance
* app/curves.[ch]: removed PDB procs, exported SMOOTH and GFREE
#defines, CurvesDialog, curves_lut_func and curves_calculate_curve
* app/desaturate.[ch]: removed PDB proc, exported desaturate
* app/equalize.[ch]: removed PDB proc, exported equalize
* app/histogram_tool.[ch]: removed PDB proc, exported HISTOGRAM_WIDTH
and HISTOGRAM_HEIGHT #defines, HistogramToolDialog,
histogram_tool_histogram_range
* app/hue_saturation.[ch]: removed PDB proc, exported HueRange enum,
HueSaturationDialog, hue_saturation_calculate_transfers,
hue_saturation
* app/invert.[ch]: remove PDB proc, export invert
* app/threshold.[ch]: remove PDB proc, export ThresholdDialog and
threshold_2
* internal_procs.c: changes for pdbgen
* app/gimprc.c: removed leftover declaration
* app/image_map.h: add #include "gimpdrawableF.h"
* app/lut_funcs.h: add ALPHA_LUT to ChannelLutType
-Yosh
1999-04-21 13:39:57 +08:00
}
2012-05-04 06:50:23 +08:00
static GimpValueArray *
2012-05-29 01:55:28 +08:00
colorize_invoker ( GimpProcedure * procedure ,
2012-05-04 06:50:23 +08:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
2004-10-03 20:57:06 +08:00
{
gboolean success = TRUE ;
GimpDrawable * drawable ;
gdouble hue ;
gdouble saturation ;
gdouble lightness ;
2012-05-04 06:50:23 +08:00
drawable = gimp_value_get_drawable ( gimp_value_array_index ( args , 0 ) , gimp ) ;
hue = g_value_get_double ( gimp_value_array_index ( args , 1 ) ) ;
saturation = g_value_get_double ( gimp_value_array_index ( args , 2 ) ) ;
lightness = g_value_get_double ( gimp_value_array_index ( args , 3 ) ) ;
2004-10-03 20:57:06 +08:00
if ( success )
{
2012-11-09 03:46:18 +08:00
if ( gimp_pdb_item_is_attached ( GIMP_ITEM ( drawable ) , NULL ,
GIMP_PDB_ITEM_CONTENT , error ) & &
2012-03-14 08:35:54 +08:00
gimp_pdb_item_is_not_group ( GIMP_ITEM ( drawable ) , error ) & &
2012-03-21 04:33:55 +08:00
! gimp_drawable_is_gray ( drawable ) )
2012-03-14 08:35:54 +08:00
{
GObject * config = g_object_new ( GIMP_TYPE_COLORIZE_CONFIG ,
" hue " , hue / 360.0 ,
" saturation " , saturation / 100.0 ,
" lightness " , lightness / 100.0 ,
NULL ) ;
2012-03-14 17:15:28 +08:00
gimp_drawable_apply_operation_by_name ( drawable , progress ,
C_ ( " undo-type " , " Colorize " ) ,
" gimp:colorize " ,
2012-03-26 05:10:30 +08:00
config ) ;
2012-03-14 08:35:54 +08:00
g_object_unref ( config ) ;
}
else
2004-10-03 20:57:06 +08:00
success = FALSE ;
}
2008-08-16 21:57:57 +08:00
return gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
2004-10-03 20:57:06 +08:00
}
2012-05-04 06:50:23 +08:00
static GimpValueArray *
2012-05-29 01:55:28 +08:00
histogram_invoker ( GimpProcedure * procedure ,
2012-05-04 06:50:23 +08:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
moved a bunch of PDB stuff here
* app/color_cmds.c: moved a bunch of PDB stuff here
* app/color_balance.[ch]: removed PDB proc, exported TransferMode
enum, ColorBalanceDialog, color_balance_create_lookup_tables, and
color_balance
* app/curves.[ch]: removed PDB procs, exported SMOOTH and GFREE
#defines, CurvesDialog, curves_lut_func and curves_calculate_curve
* app/desaturate.[ch]: removed PDB proc, exported desaturate
* app/equalize.[ch]: removed PDB proc, exported equalize
* app/histogram_tool.[ch]: removed PDB proc, exported HISTOGRAM_WIDTH
and HISTOGRAM_HEIGHT #defines, HistogramToolDialog,
histogram_tool_histogram_range
* app/hue_saturation.[ch]: removed PDB proc, exported HueRange enum,
HueSaturationDialog, hue_saturation_calculate_transfers,
hue_saturation
* app/invert.[ch]: remove PDB proc, export invert
* app/threshold.[ch]: remove PDB proc, export ThresholdDialog and
threshold_2
* internal_procs.c: changes for pdbgen
* app/gimprc.c: removed leftover declaration
* app/image_map.h: add #include "gimpdrawableF.h"
* app/lut_funcs.h: add ALPHA_LUT to ChannelLutType
-Yosh
1999-04-21 13:39:57 +08:00
{
gboolean success = TRUE ;
2012-05-04 06:50:23 +08:00
GimpValueArray * return_vals ;
moved a bunch of PDB stuff here
* app/color_cmds.c: moved a bunch of PDB stuff here
* app/color_balance.[ch]: removed PDB proc, exported TransferMode
enum, ColorBalanceDialog, color_balance_create_lookup_tables, and
color_balance
* app/curves.[ch]: removed PDB procs, exported SMOOTH and GFREE
#defines, CurvesDialog, curves_lut_func and curves_calculate_curve
* app/desaturate.[ch]: removed PDB proc, exported desaturate
* app/equalize.[ch]: removed PDB proc, exported equalize
* app/histogram_tool.[ch]: removed PDB proc, exported HISTOGRAM_WIDTH
and HISTOGRAM_HEIGHT #defines, HistogramToolDialog,
histogram_tool_histogram_range
* app/hue_saturation.[ch]: removed PDB proc, exported HueRange enum,
HueSaturationDialog, hue_saturation_calculate_transfers,
hue_saturation
* app/invert.[ch]: remove PDB proc, export invert
* app/threshold.[ch]: remove PDB proc, export ThresholdDialog and
threshold_2
* internal_procs.c: changes for pdbgen
* app/gimprc.c: removed leftover declaration
* app/image_map.h: add #include "gimpdrawableF.h"
* app/lut_funcs.h: add ALPHA_LUT to ChannelLutType
-Yosh
1999-04-21 13:39:57 +08:00
GimpDrawable * drawable ;
gint32 channel ;
gint32 start_range ;
gint32 end_range ;
2006-03-15 23:32:39 +08:00
gdouble mean = 0.0 ;
gdouble std_dev = 0.0 ;
gdouble median = 0.0 ;
gdouble pixels = 0.0 ;
gdouble count = 0.0 ;
gdouble percentile = 0.0 ;
moved a bunch of PDB stuff here
* app/color_cmds.c: moved a bunch of PDB stuff here
* app/color_balance.[ch]: removed PDB proc, exported TransferMode
enum, ColorBalanceDialog, color_balance_create_lookup_tables, and
color_balance
* app/curves.[ch]: removed PDB procs, exported SMOOTH and GFREE
#defines, CurvesDialog, curves_lut_func and curves_calculate_curve
* app/desaturate.[ch]: removed PDB proc, exported desaturate
* app/equalize.[ch]: removed PDB proc, exported equalize
* app/histogram_tool.[ch]: removed PDB proc, exported HISTOGRAM_WIDTH
and HISTOGRAM_HEIGHT #defines, HistogramToolDialog,
histogram_tool_histogram_range
* app/hue_saturation.[ch]: removed PDB proc, exported HueRange enum,
HueSaturationDialog, hue_saturation_calculate_transfers,
hue_saturation
* app/invert.[ch]: remove PDB proc, export invert
* app/threshold.[ch]: remove PDB proc, export ThresholdDialog and
threshold_2
* internal_procs.c: changes for pdbgen
* app/gimprc.c: removed leftover declaration
* app/image_map.h: add #include "gimpdrawableF.h"
* app/lut_funcs.h: add ALPHA_LUT to ChannelLutType
-Yosh
1999-04-21 13:39:57 +08:00
2012-05-04 06:50:23 +08:00
drawable = gimp_value_get_drawable ( gimp_value_array_index ( args , 0 ) , gimp ) ;
channel = g_value_get_enum ( gimp_value_array_index ( args , 1 ) ) ;
start_range = g_value_get_int ( gimp_value_array_index ( args , 2 ) ) ;
end_range = g_value_get_int ( gimp_value_array_index ( args , 3 ) ) ;
moved a bunch of PDB stuff here
* app/color_cmds.c: moved a bunch of PDB stuff here
* app/color_balance.[ch]: removed PDB proc, exported TransferMode
enum, ColorBalanceDialog, color_balance_create_lookup_tables, and
color_balance
* app/curves.[ch]: removed PDB procs, exported SMOOTH and GFREE
#defines, CurvesDialog, curves_lut_func and curves_calculate_curve
* app/desaturate.[ch]: removed PDB proc, exported desaturate
* app/equalize.[ch]: removed PDB proc, exported equalize
* app/histogram_tool.[ch]: removed PDB proc, exported HISTOGRAM_WIDTH
and HISTOGRAM_HEIGHT #defines, HistogramToolDialog,
histogram_tool_histogram_range
* app/hue_saturation.[ch]: removed PDB proc, exported HueRange enum,
HueSaturationDialog, hue_saturation_calculate_transfers,
hue_saturation
* app/invert.[ch]: remove PDB proc, export invert
* app/threshold.[ch]: remove PDB proc, export ThresholdDialog and
threshold_2
* internal_procs.c: changes for pdbgen
* app/gimprc.c: removed leftover declaration
* app/image_map.h: add #include "gimpdrawableF.h"
* app/lut_funcs.h: add ALPHA_LUT to ChannelLutType
-Yosh
1999-04-21 13:39:57 +08:00
if ( success )
{
2012-11-09 03:46:18 +08:00
if ( ! gimp_pdb_item_is_attached ( GIMP_ITEM ( drawable ) , NULL , 0 , error ) | |
2004-03-27 00:49:18 +08:00
( ! gimp_drawable_has_alpha ( drawable ) & &
channel = = GIMP_HISTOGRAM_ALPHA ) | |
( gimp_drawable_is_gray ( drawable ) & &
channel ! = GIMP_HISTOGRAM_VALUE & & channel ! = GIMP_HISTOGRAM_ALPHA ) )
success = FALSE ;
2004-03-27 00:38:44 +08:00
2004-01-13 19:51:45 +08:00
if ( success )
2004-03-27 00:49:18 +08:00
{
2013-06-12 07:02:25 +08:00
GimpHistogram * histogram = gimp_histogram_new ( TRUE ) ;
2013-06-12 08:01:24 +08:00
gint start = start_range ;
gint end = end_range ;
gint n_bins ;
2004-03-27 00:49:18 +08:00
gimp_drawable_calculate_histogram ( drawable , histogram ) ;
2013-06-12 08:01:24 +08:00
n_bins = gimp_histogram_n_bins ( histogram ) ;
if ( n_bins ! = 256 )
{
start = ROUND ( ( gdouble ) start * ( n_bins - 1 ) / 255 ) ;
end = ROUND ( ( gdouble ) end * ( n_bins - 1 ) / 255 ) ;
}
2004-03-27 00:49:18 +08:00
mean = gimp_histogram_get_mean ( histogram , channel ,
2013-06-12 08:01:24 +08:00
start , end ) ;
2004-03-27 00:49:18 +08:00
std_dev = gimp_histogram_get_std_dev ( histogram , channel ,
2013-06-12 08:01:24 +08:00
start , end ) ;
2004-03-27 00:49:18 +08:00
median = gimp_histogram_get_median ( histogram , channel ,
2013-06-12 08:01:24 +08:00
start , end ) ;
pixels = gimp_histogram_get_count ( histogram , channel , 0 , n_bins - 1 ) ;
2004-03-27 00:49:18 +08:00
count = gimp_histogram_get_count ( histogram , channel ,
2013-06-12 08:01:24 +08:00
start , end ) ;
2004-03-27 00:49:18 +08:00
percentile = count / pixels ;
2013-06-12 03:23:32 +08:00
g_object_unref ( histogram ) ;
2013-06-12 08:01:24 +08:00
if ( n_bins = = 256 | |
! gimp - > plug_in_manager - > current_plug_in | |
! gimp_plug_in_precision_enabled ( gimp - > plug_in_manager - > current_plug_in ) )
{
mean * = 255 ;
std_dev * = 255 ;
median * = 255 ;
}
2004-03-27 00:49:18 +08:00
}
moved a bunch of PDB stuff here
* app/color_cmds.c: moved a bunch of PDB stuff here
* app/color_balance.[ch]: removed PDB proc, exported TransferMode
enum, ColorBalanceDialog, color_balance_create_lookup_tables, and
color_balance
* app/curves.[ch]: removed PDB procs, exported SMOOTH and GFREE
#defines, CurvesDialog, curves_lut_func and curves_calculate_curve
* app/desaturate.[ch]: removed PDB proc, exported desaturate
* app/equalize.[ch]: removed PDB proc, exported equalize
* app/histogram_tool.[ch]: removed PDB proc, exported HISTOGRAM_WIDTH
and HISTOGRAM_HEIGHT #defines, HistogramToolDialog,
histogram_tool_histogram_range
* app/hue_saturation.[ch]: removed PDB proc, exported HueRange enum,
HueSaturationDialog, hue_saturation_calculate_transfers,
hue_saturation
* app/invert.[ch]: remove PDB proc, export invert
* app/threshold.[ch]: remove PDB proc, export ThresholdDialog and
threshold_2
* internal_procs.c: changes for pdbgen
* app/gimprc.c: removed leftover declaration
* app/image_map.h: add #include "gimpdrawableF.h"
* app/lut_funcs.h: add ALPHA_LUT to ChannelLutType
-Yosh
1999-04-21 13:39:57 +08:00
}
2008-08-16 21:57:57 +08:00
return_vals = gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
moved a bunch of PDB stuff here
* app/color_cmds.c: moved a bunch of PDB stuff here
* app/color_balance.[ch]: removed PDB proc, exported TransferMode
enum, ColorBalanceDialog, color_balance_create_lookup_tables, and
color_balance
* app/curves.[ch]: removed PDB procs, exported SMOOTH and GFREE
#defines, CurvesDialog, curves_lut_func and curves_calculate_curve
* app/desaturate.[ch]: removed PDB proc, exported desaturate
* app/equalize.[ch]: removed PDB proc, exported equalize
* app/histogram_tool.[ch]: removed PDB proc, exported HISTOGRAM_WIDTH
and HISTOGRAM_HEIGHT #defines, HistogramToolDialog,
histogram_tool_histogram_range
* app/hue_saturation.[ch]: removed PDB proc, exported HueRange enum,
HueSaturationDialog, hue_saturation_calculate_transfers,
hue_saturation
* app/invert.[ch]: remove PDB proc, export invert
* app/threshold.[ch]: remove PDB proc, export ThresholdDialog and
threshold_2
* internal_procs.c: changes for pdbgen
* app/gimprc.c: removed leftover declaration
* app/image_map.h: add #include "gimpdrawableF.h"
* app/lut_funcs.h: add ALPHA_LUT to ChannelLutType
-Yosh
1999-04-21 13:39:57 +08:00
if ( success )
{
2012-05-04 06:50:23 +08:00
g_value_set_double ( gimp_value_array_index ( return_vals , 1 ) , mean ) ;
g_value_set_double ( gimp_value_array_index ( return_vals , 2 ) , std_dev ) ;
g_value_set_double ( gimp_value_array_index ( return_vals , 3 ) , median ) ;
g_value_set_double ( gimp_value_array_index ( return_vals , 4 ) , pixels ) ;
g_value_set_double ( gimp_value_array_index ( return_vals , 5 ) , count ) ;
g_value_set_double ( gimp_value_array_index ( return_vals , 6 ) , percentile ) ;
moved a bunch of PDB stuff here
* app/color_cmds.c: moved a bunch of PDB stuff here
* app/color_balance.[ch]: removed PDB proc, exported TransferMode
enum, ColorBalanceDialog, color_balance_create_lookup_tables, and
color_balance
* app/curves.[ch]: removed PDB procs, exported SMOOTH and GFREE
#defines, CurvesDialog, curves_lut_func and curves_calculate_curve
* app/desaturate.[ch]: removed PDB proc, exported desaturate
* app/equalize.[ch]: removed PDB proc, exported equalize
* app/histogram_tool.[ch]: removed PDB proc, exported HISTOGRAM_WIDTH
and HISTOGRAM_HEIGHT #defines, HistogramToolDialog,
histogram_tool_histogram_range
* app/hue_saturation.[ch]: removed PDB proc, exported HueRange enum,
HueSaturationDialog, hue_saturation_calculate_transfers,
hue_saturation
* app/invert.[ch]: remove PDB proc, export invert
* app/threshold.[ch]: remove PDB proc, export ThresholdDialog and
threshold_2
* internal_procs.c: changes for pdbgen
* app/gimprc.c: removed leftover declaration
* app/image_map.h: add #include "gimpdrawableF.h"
* app/lut_funcs.h: add ALPHA_LUT to ChannelLutType
-Yosh
1999-04-21 13:39:57 +08:00
}
2006-04-05 05:11:45 +08:00
return return_vals ;
}
2012-05-04 06:50:23 +08:00
static GimpValueArray *
2012-05-29 01:55:28 +08:00
hue_saturation_invoker ( GimpProcedure * procedure ,
2012-05-04 06:50:23 +08:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
2006-04-05 05:11:45 +08:00
{
gboolean success = TRUE ;
GimpDrawable * drawable ;
gint32 hue_range ;
gdouble hue_offset ;
gdouble lightness ;
gdouble saturation ;
2012-05-04 06:50:23 +08:00
drawable = gimp_value_get_drawable ( gimp_value_array_index ( args , 0 ) , gimp ) ;
hue_range = g_value_get_enum ( gimp_value_array_index ( args , 1 ) ) ;
hue_offset = g_value_get_double ( gimp_value_array_index ( args , 2 ) ) ;
lightness = g_value_get_double ( gimp_value_array_index ( args , 3 ) ) ;
saturation = g_value_get_double ( gimp_value_array_index ( args , 4 ) ) ;
2006-04-05 05:11:45 +08:00
if ( success )
{
2012-11-09 03:46:18 +08:00
if ( gimp_pdb_item_is_attached ( GIMP_ITEM ( drawable ) , NULL ,
GIMP_PDB_ITEM_CONTENT , error ) & &
2012-03-29 08:35:56 +08:00
gimp_pdb_item_is_not_group ( GIMP_ITEM ( drawable ) , error ) )
{
GObject * config = g_object_new ( GIMP_TYPE_HUE_SATURATION_CONFIG ,
" range " , hue_range ,
NULL ) ;
2006-04-05 05:11:45 +08:00
2012-03-29 08:35:56 +08:00
g_object_set ( config ,
" hue " , hue_offset / 180.0 ,
" saturation " , saturation / 100.0 ,
" lightness " , lightness / 100.0 ,
NULL ) ;
gimp_drawable_apply_operation_by_name ( drawable , progress ,
_ ( " Hue-Saturation " ) ,
" gimp:hue-saturation " ,
config ) ;
g_object_unref ( config ) ;
}
else
success = FALSE ;
2006-04-05 05:11:45 +08:00
}
2008-08-16 21:57:57 +08:00
return gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
moved a bunch of PDB stuff here
* app/color_cmds.c: moved a bunch of PDB stuff here
* app/color_balance.[ch]: removed PDB proc, exported TransferMode
enum, ColorBalanceDialog, color_balance_create_lookup_tables, and
color_balance
* app/curves.[ch]: removed PDB procs, exported SMOOTH and GFREE
#defines, CurvesDialog, curves_lut_func and curves_calculate_curve
* app/desaturate.[ch]: removed PDB proc, exported desaturate
* app/equalize.[ch]: removed PDB proc, exported equalize
* app/histogram_tool.[ch]: removed PDB proc, exported HISTOGRAM_WIDTH
and HISTOGRAM_HEIGHT #defines, HistogramToolDialog,
histogram_tool_histogram_range
* app/hue_saturation.[ch]: removed PDB proc, exported HueRange enum,
HueSaturationDialog, hue_saturation_calculate_transfers,
hue_saturation
* app/invert.[ch]: remove PDB proc, export invert
* app/threshold.[ch]: remove PDB proc, export ThresholdDialog and
threshold_2
* internal_procs.c: changes for pdbgen
* app/gimprc.c: removed leftover declaration
* app/image_map.h: add #include "gimpdrawableF.h"
* app/lut_funcs.h: add ALPHA_LUT to ChannelLutType
-Yosh
1999-04-21 13:39:57 +08:00
}
2012-05-04 06:50:23 +08:00
static GimpValueArray *
2012-05-29 01:55:28 +08:00
threshold_invoker ( GimpProcedure * procedure ,
2012-05-04 06:50:23 +08:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
moved a bunch of PDB stuff here
* app/color_cmds.c: moved a bunch of PDB stuff here
* app/color_balance.[ch]: removed PDB proc, exported TransferMode
enum, ColorBalanceDialog, color_balance_create_lookup_tables, and
color_balance
* app/curves.[ch]: removed PDB procs, exported SMOOTH and GFREE
#defines, CurvesDialog, curves_lut_func and curves_calculate_curve
* app/desaturate.[ch]: removed PDB proc, exported desaturate
* app/equalize.[ch]: removed PDB proc, exported equalize
* app/histogram_tool.[ch]: removed PDB proc, exported HISTOGRAM_WIDTH
and HISTOGRAM_HEIGHT #defines, HistogramToolDialog,
histogram_tool_histogram_range
* app/hue_saturation.[ch]: removed PDB proc, exported HueRange enum,
HueSaturationDialog, hue_saturation_calculate_transfers,
hue_saturation
* app/invert.[ch]: remove PDB proc, export invert
* app/threshold.[ch]: remove PDB proc, export ThresholdDialog and
threshold_2
* internal_procs.c: changes for pdbgen
* app/gimprc.c: removed leftover declaration
* app/image_map.h: add #include "gimpdrawableF.h"
* app/lut_funcs.h: add ALPHA_LUT to ChannelLutType
-Yosh
1999-04-21 13:39:57 +08:00
{
gboolean success = TRUE ;
GimpDrawable * drawable ;
2006-04-05 05:11:45 +08:00
gint32 low_threshold ;
gint32 high_threshold ;
moved a bunch of PDB stuff here
* app/color_cmds.c: moved a bunch of PDB stuff here
* app/color_balance.[ch]: removed PDB proc, exported TransferMode
enum, ColorBalanceDialog, color_balance_create_lookup_tables, and
color_balance
* app/curves.[ch]: removed PDB procs, exported SMOOTH and GFREE
#defines, CurvesDialog, curves_lut_func and curves_calculate_curve
* app/desaturate.[ch]: removed PDB proc, exported desaturate
* app/equalize.[ch]: removed PDB proc, exported equalize
* app/histogram_tool.[ch]: removed PDB proc, exported HISTOGRAM_WIDTH
and HISTOGRAM_HEIGHT #defines, HistogramToolDialog,
histogram_tool_histogram_range
* app/hue_saturation.[ch]: removed PDB proc, exported HueRange enum,
HueSaturationDialog, hue_saturation_calculate_transfers,
hue_saturation
* app/invert.[ch]: remove PDB proc, export invert
* app/threshold.[ch]: remove PDB proc, export ThresholdDialog and
threshold_2
* internal_procs.c: changes for pdbgen
* app/gimprc.c: removed leftover declaration
* app/image_map.h: add #include "gimpdrawableF.h"
* app/lut_funcs.h: add ALPHA_LUT to ChannelLutType
-Yosh
1999-04-21 13:39:57 +08:00
2012-05-04 06:50:23 +08:00
drawable = gimp_value_get_drawable ( gimp_value_array_index ( args , 0 ) , gimp ) ;
low_threshold = g_value_get_int ( gimp_value_array_index ( args , 1 ) ) ;
high_threshold = g_value_get_int ( gimp_value_array_index ( args , 2 ) ) ;
moved a bunch of PDB stuff here
* app/color_cmds.c: moved a bunch of PDB stuff here
* app/color_balance.[ch]: removed PDB proc, exported TransferMode
enum, ColorBalanceDialog, color_balance_create_lookup_tables, and
color_balance
* app/curves.[ch]: removed PDB procs, exported SMOOTH and GFREE
#defines, CurvesDialog, curves_lut_func and curves_calculate_curve
* app/desaturate.[ch]: removed PDB proc, exported desaturate
* app/equalize.[ch]: removed PDB proc, exported equalize
* app/histogram_tool.[ch]: removed PDB proc, exported HISTOGRAM_WIDTH
and HISTOGRAM_HEIGHT #defines, HistogramToolDialog,
histogram_tool_histogram_range
* app/hue_saturation.[ch]: removed PDB proc, exported HueRange enum,
HueSaturationDialog, hue_saturation_calculate_transfers,
hue_saturation
* app/invert.[ch]: remove PDB proc, export invert
* app/threshold.[ch]: remove PDB proc, export ThresholdDialog and
threshold_2
* internal_procs.c: changes for pdbgen
* app/gimprc.c: removed leftover declaration
* app/image_map.h: add #include "gimpdrawableF.h"
* app/lut_funcs.h: add ALPHA_LUT to ChannelLutType
-Yosh
1999-04-21 13:39:57 +08:00
if ( success )
{
2012-11-09 03:46:18 +08:00
if ( gimp_pdb_item_is_attached ( GIMP_ITEM ( drawable ) , NULL ,
GIMP_PDB_ITEM_CONTENT , error ) & &
2012-03-21 04:33:55 +08:00
gimp_pdb_item_is_not_group ( GIMP_ITEM ( drawable ) , error ) )
2012-03-14 08:35:54 +08:00
{
2016-01-23 05:37:23 +08:00
GeglNode * node =
gegl_node_new_child ( NULL ,
" operation " , " gimp:threshold " ,
" low " , low_threshold / 255.0 ,
" high " , high_threshold / 255.0 ,
NULL ) ;
2004-03-27 00:38:44 +08:00
2016-01-23 05:37:23 +08:00
gimp_drawable_apply_operation ( drawable , progress ,
C_ ( " undo-type " , " Threshold " ) ,
node ) ;
g_object_unref ( node ) ;
2012-03-14 08:35:54 +08:00
}
else
success = FALSE ;
moved a bunch of PDB stuff here
* app/color_cmds.c: moved a bunch of PDB stuff here
* app/color_balance.[ch]: removed PDB proc, exported TransferMode
enum, ColorBalanceDialog, color_balance_create_lookup_tables, and
color_balance
* app/curves.[ch]: removed PDB procs, exported SMOOTH and GFREE
#defines, CurvesDialog, curves_lut_func and curves_calculate_curve
* app/desaturate.[ch]: removed PDB proc, exported desaturate
* app/equalize.[ch]: removed PDB proc, exported equalize
* app/histogram_tool.[ch]: removed PDB proc, exported HISTOGRAM_WIDTH
and HISTOGRAM_HEIGHT #defines, HistogramToolDialog,
histogram_tool_histogram_range
* app/hue_saturation.[ch]: removed PDB proc, exported HueRange enum,
HueSaturationDialog, hue_saturation_calculate_transfers,
hue_saturation
* app/invert.[ch]: remove PDB proc, export invert
* app/threshold.[ch]: remove PDB proc, export ThresholdDialog and
threshold_2
* internal_procs.c: changes for pdbgen
* app/gimprc.c: removed leftover declaration
* app/image_map.h: add #include "gimpdrawableF.h"
* app/lut_funcs.h: add ALPHA_LUT to ChannelLutType
-Yosh
1999-04-21 13:39:57 +08:00
}
2008-08-16 21:57:57 +08:00
return gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
moved a bunch of PDB stuff here
* app/color_cmds.c: moved a bunch of PDB stuff here
* app/color_balance.[ch]: removed PDB proc, exported TransferMode
enum, ColorBalanceDialog, color_balance_create_lookup_tables, and
color_balance
* app/curves.[ch]: removed PDB procs, exported SMOOTH and GFREE
#defines, CurvesDialog, curves_lut_func and curves_calculate_curve
* app/desaturate.[ch]: removed PDB proc, exported desaturate
* app/equalize.[ch]: removed PDB proc, exported equalize
* app/histogram_tool.[ch]: removed PDB proc, exported HISTOGRAM_WIDTH
and HISTOGRAM_HEIGHT #defines, HistogramToolDialog,
histogram_tool_histogram_range
* app/hue_saturation.[ch]: removed PDB proc, exported HueRange enum,
HueSaturationDialog, hue_saturation_calculate_transfers,
hue_saturation
* app/invert.[ch]: remove PDB proc, export invert
* app/threshold.[ch]: remove PDB proc, export ThresholdDialog and
threshold_2
* internal_procs.c: changes for pdbgen
* app/gimprc.c: removed leftover declaration
* app/image_map.h: add #include "gimpdrawableF.h"
* app/lut_funcs.h: add ALPHA_LUT to ChannelLutType
-Yosh
1999-04-21 13:39:57 +08:00
}
2006-04-05 05:11:45 +08:00
void
2006-04-26 17:13:47 +08:00
register_color_procs ( GimpPDB * pdb )
2006-04-05 05:11:45 +08:00
{
GimpProcedure * procedure ;
/*
* gimp - brightness - contrast
*/
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new ( brightness_contrast_invoker ) ;
2008-04-04 18:58:56 +08:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-brightness-contrast " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_set_static_strings ( procedure ,
" gimp-brightness-contrast " ,
2014-01-13 05:11:15 +08:00
" Deprecated: Use 'gimp-drawable-brightness-contrast' instead. " ,
" Deprecated: Use 'gimp-drawable-brightness-contrast' instead. " ,
" " ,
" " ,
" " ,
" gimp-drawable-brightness-contrast " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_drawable_id ( " drawable " ,
" drawable " ,
" The drawable " ,
2006-05-07 02:57:51 +08:00
pdb - > gimp , FALSE ,
2006-04-05 05:11:45 +08:00
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_int32 ( " brightness " ,
" brightness " ,
2006-05-19 01:25:15 +08:00
" Brightness adjustment " ,
2006-04-05 05:11:45 +08:00
- 127 , 127 , - 127 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_int32 ( " contrast " ,
" contrast " ,
2006-05-19 01:25:15 +08:00
" Contrast adjustment " ,
2006-04-05 05:11:45 +08:00
- 127 , 127 , - 127 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 16:16:26 +08:00
g_object_unref ( procedure ) ;
2006-04-05 05:11:45 +08:00
/*
* gimp - levels
*/
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new ( levels_invoker ) ;
2008-04-04 18:58:56 +08:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-levels " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_set_static_strings ( procedure ,
" gimp-levels " ,
2014-01-13 05:11:15 +08:00
" Deprecated: Use 'gimp-drawable-levels' instead. " ,
" Deprecated: Use 'gimp-drawable-levels' instead. " ,
" " ,
" " ,
" " ,
" gimp-drawable-levels " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_drawable_id ( " drawable " ,
" drawable " ,
" The drawable " ,
2006-05-07 02:57:51 +08:00
pdb - > gimp , FALSE ,
2006-04-05 05:11:45 +08:00
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
g_param_spec_enum ( " channel " ,
" channel " ,
2006-05-19 01:25:15 +08:00
" The channel to modify " ,
2006-04-05 05:11:45 +08:00
GIMP_TYPE_HISTOGRAM_CHANNEL ,
GIMP_HISTOGRAM_VALUE ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_int32 ( " low-input " ,
" low input " ,
2006-05-19 01:25:15 +08:00
" Intensity of lowest input " ,
2006-04-05 05:11:45 +08:00
0 , 255 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_int32 ( " high-input " ,
" high input " ,
2006-05-19 01:25:15 +08:00
" Intensity of highest input " ,
2006-04-05 05:11:45 +08:00
0 , 255 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
g_param_spec_double ( " gamma " ,
" gamma " ,
2016-03-21 21:03:04 +08:00
" Gamma adjustment factor " ,
2006-04-05 05:11:45 +08:00
0.1 , 10 , 0.1 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_int32 ( " low-output " ,
" low output " ,
2006-05-19 01:25:15 +08:00
" Intensity of lowest output " ,
2006-04-05 05:11:45 +08:00
0 , 255 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_int32 ( " high-output " ,
" high output " ,
2006-05-19 01:25:15 +08:00
" Intensity of highest output " ,
2006-04-05 05:11:45 +08:00
0 , 255 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 16:16:26 +08:00
g_object_unref ( procedure ) ;
2006-04-05 05:11:45 +08:00
/*
* gimp - levels - auto
*/
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new ( levels_auto_invoker ) ;
2008-04-04 18:58:56 +08:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-levels-auto " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_set_static_strings ( procedure ,
" gimp-levels-auto " ,
2014-01-13 05:11:15 +08:00
" Deprecated: Use 'gimp-drawable-levels-stretch' instead. " ,
" Deprecated: Use 'gimp-drawable-levels-stretch' instead. " ,
2006-04-05 05:11:45 +08:00
" " ,
" " ,
" " ,
2014-01-13 05:11:15 +08:00
" gimp-drawable-levels-stretch " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_drawable_id ( " drawable " ,
" drawable " ,
" The drawable " ,
2006-05-07 02:57:51 +08:00
pdb - > gimp , FALSE ,
2006-04-05 05:11:45 +08:00
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 16:16:26 +08:00
g_object_unref ( procedure ) ;
2006-04-05 05:11:45 +08:00
/*
* gimp - levels - stretch
*/
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new ( levels_stretch_invoker ) ;
2008-04-04 18:58:56 +08:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-levels-stretch " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_set_static_strings ( procedure ,
" gimp-levels-stretch " ,
2014-01-13 05:11:15 +08:00
" Deprecated: Use 'gimp-drawable-levels-stretch' instead. " ,
" Deprecated: Use 'gimp-drawable-levels-stretch' instead. " ,
" " ,
" " ,
" " ,
" gimp-drawable-levels-stretch " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_drawable_id ( " drawable " ,
" drawable " ,
" The drawable " ,
2006-05-07 02:57:51 +08:00
pdb - > gimp , FALSE ,
2006-04-05 05:11:45 +08:00
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 16:16:26 +08:00
g_object_unref ( procedure ) ;
2006-04-05 05:11:45 +08:00
/*
* gimp - posterize
*/
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new ( posterize_invoker ) ;
2008-04-04 18:58:56 +08:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-posterize " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_set_static_strings ( procedure ,
" gimp-posterize " ,
2014-01-13 05:11:15 +08:00
" Deprecated: Use 'gimp-drawable-posterize' instead. " ,
" Deprecated: Use 'gimp-drawable-posterize' instead. " ,
" " ,
" " ,
" " ,
" gimp-drawable-posterize " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_drawable_id ( " drawable " ,
" drawable " ,
" The drawable " ,
2006-05-07 02:57:51 +08:00
pdb - > gimp , FALSE ,
2006-04-05 05:11:45 +08:00
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_int32 ( " levels " ,
" levels " ,
2006-05-19 01:25:15 +08:00
" Levels of posterization " ,
2006-04-05 05:11:45 +08:00
2 , 255 , 2 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 16:16:26 +08:00
g_object_unref ( procedure ) ;
2006-04-05 05:11:45 +08:00
/*
* gimp - desaturate
*/
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new ( desaturate_invoker ) ;
2008-04-04 18:58:56 +08:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-desaturate " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_set_static_strings ( procedure ,
" gimp-desaturate " ,
2014-01-13 05:11:15 +08:00
" Deprecated: Use 'gimp-drawable-desaturate' instead. " ,
" Deprecated: Use 'gimp-drawable-desaturate' instead. " ,
" " ,
" " ,
" " ,
" gimp-drawable-desaturate " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_drawable_id ( " drawable " ,
" drawable " ,
" The drawable " ,
2006-05-07 02:57:51 +08:00
pdb - > gimp , FALSE ,
2006-04-05 05:11:45 +08:00
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 16:16:26 +08:00
g_object_unref ( procedure ) ;
2006-04-05 05:11:45 +08:00
/*
* gimp - desaturate - full
*/
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new ( desaturate_full_invoker ) ;
2008-04-04 18:58:56 +08:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-desaturate-full " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_set_static_strings ( procedure ,
" gimp-desaturate-full " ,
2014-01-13 05:11:15 +08:00
" Deprecated: Use 'gimp-drawable-desaturate' instead. " ,
" Deprecated: Use 'gimp-drawable-desaturate' instead. " ,
" " ,
" " ,
" " ,
" gimp-drawable-desaturate " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_drawable_id ( " drawable " ,
" drawable " ,
" The drawable " ,
2006-05-07 02:57:51 +08:00
pdb - > gimp , FALSE ,
2006-04-05 05:11:45 +08:00
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
g_param_spec_enum ( " desaturate-mode " ,
" desaturate mode " ,
" The formula to use to desaturate " ,
GIMP_TYPE_DESATURATE_MODE ,
GIMP_DESATURATE_LIGHTNESS ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 16:16:26 +08:00
g_object_unref ( procedure ) ;
2006-04-05 05:11:45 +08:00
/*
* gimp - equalize
*/
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new ( equalize_invoker ) ;
2008-04-04 18:58:56 +08:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-equalize " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_set_static_strings ( procedure ,
" gimp-equalize " ,
2014-01-13 05:11:15 +08:00
" Deprecated: Use 'gimp-drawable-equalize' instead. " ,
" Deprecated: Use 'gimp-drawable-equalize' instead. " ,
" " ,
" " ,
" " ,
" gimp-drawable-equalize " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_drawable_id ( " drawable " ,
" drawable " ,
" The drawable " ,
2006-05-07 02:57:51 +08:00
pdb - > gimp , FALSE ,
2006-04-05 05:11:45 +08:00
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
g_param_spec_boolean ( " mask-only " ,
" mask only " ,
" Equalization option " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 16:16:26 +08:00
g_object_unref ( procedure ) ;
2006-04-05 05:11:45 +08:00
/*
* gimp - invert
*/
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new ( invert_invoker ) ;
2008-04-04 18:58:56 +08:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-invert " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_set_static_strings ( procedure ,
" gimp-invert " ,
" Invert the contents of the specified drawable. " ,
2012-04-23 06:47:32 +08:00
" This procedure inverts the contents of the specified drawable. Each intensity channel is inverted independently. The inverted intensity is given as inten' = (255 - inten). " ,
2006-04-05 05:11:45 +08:00
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ,
NULL ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_drawable_id ( " drawable " ,
" drawable " ,
" The drawable " ,
2006-05-07 02:57:51 +08:00
pdb - > gimp , FALSE ,
2006-04-05 05:11:45 +08:00
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 16:16:26 +08:00
g_object_unref ( procedure ) ;
2006-04-05 05:11:45 +08:00
/*
* gimp - curves - spline
*/
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new ( curves_spline_invoker ) ;
2008-04-04 18:58:56 +08:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-curves-spline " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_set_static_strings ( procedure ,
" gimp-curves-spline " ,
2014-06-18 04:37:46 +08:00
" Deprecated: Use 'gimp-drawable-curves-spline' instead. " ,
" Deprecated: Use 'gimp-drawable-curves-spline' instead. " ,
" " ,
" " ,
" " ,
" gimp-drawable-curves-spline " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_drawable_id ( " drawable " ,
" drawable " ,
" The drawable " ,
2006-05-07 02:57:51 +08:00
pdb - > gimp , FALSE ,
2006-04-05 05:11:45 +08:00
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
g_param_spec_enum ( " channel " ,
" channel " ,
2006-05-19 01:25:15 +08:00
" The channel to modify " ,
2006-04-05 05:11:45 +08:00
GIMP_TYPE_HISTOGRAM_CHANNEL ,
GIMP_HISTOGRAM_VALUE ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_int32 ( " num-points " ,
" num points " ,
2006-05-19 01:25:15 +08:00
" The number of values in the control point array " ,
2006-04-05 05:11:45 +08:00
4 , 34 , 4 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_int8_array ( " control-pts " ,
" control pts " ,
" The spline control points: { cp1.x, cp1.y, cp2.x, cp2.y, ... } " ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 16:16:26 +08:00
g_object_unref ( procedure ) ;
2006-04-05 05:11:45 +08:00
/*
* gimp - curves - explicit
*/
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new ( curves_explicit_invoker ) ;
2008-04-04 18:58:56 +08:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-curves-explicit " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_set_static_strings ( procedure ,
" gimp-curves-explicit " ,
2014-06-18 04:37:46 +08:00
" Deprecated: Use 'gimp-drawable-curves-explicit' instead. " ,
" Deprecated: Use 'gimp-drawable-curves-explicit' instead. " ,
" " ,
" " ,
" " ,
" gimp-drawable-curves-explicit " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_drawable_id ( " drawable " ,
" drawable " ,
" The drawable " ,
2006-05-07 02:57:51 +08:00
pdb - > gimp , FALSE ,
2006-04-05 05:11:45 +08:00
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
g_param_spec_enum ( " channel " ,
" channel " ,
2006-05-19 01:25:15 +08:00
" The channel to modify " ,
2006-04-05 05:11:45 +08:00
GIMP_TYPE_HISTOGRAM_CHANNEL ,
GIMP_HISTOGRAM_VALUE ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_int32 ( " num-bytes " ,
" num bytes " ,
" The number of bytes in the new curve (always 256) " ,
0 , G_MAXINT32 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_int8_array ( " curve " ,
" curve " ,
" The explicit curve " ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 16:16:26 +08:00
g_object_unref ( procedure ) ;
2006-04-05 05:11:45 +08:00
/*
* gimp - color - balance
*/
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new ( color_balance_invoker ) ;
2008-04-04 18:58:56 +08:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-color-balance " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_set_static_strings ( procedure ,
" gimp-color-balance " ,
" Modify the color balance of the specified drawable. " ,
2007-01-09 22:00:55 +08:00
" Modify the color balance of the specified drawable. There are three axis which can be modified: cyan-red, magenta-green, and yellow-blue. Negative values increase the amount of the former, positive values increase the amount of the latter. Color balance can be controlled with the 'transfer_mode' setting, which allows shadows, mid-tones, and highlights in an image to be affected differently. The 'preserve-lum' parameter, if TRUE, ensures that the luminosity of each pixel remains fixed. " ,
2006-04-05 05:11:45 +08:00
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1997 " ,
NULL ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_drawable_id ( " drawable " ,
" drawable " ,
" The drawable " ,
2006-05-07 02:57:51 +08:00
pdb - > gimp , FALSE ,
2006-04-05 05:11:45 +08:00
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
g_param_spec_enum ( " transfer-mode " ,
" transfer mode " ,
2006-05-19 01:25:15 +08:00
" Transfer mode " ,
2006-04-05 05:11:45 +08:00
GIMP_TYPE_TRANSFER_MODE ,
2014-04-30 02:55:08 +08:00
GIMP_TRANSFER_SHADOWS ,
2006-04-05 05:11:45 +08:00
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
g_param_spec_boolean ( " preserve-lum " ,
" preserve lum " ,
" Preserve luminosity values at each pixel " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
g_param_spec_double ( " cyan-red " ,
" cyan red " ,
2006-05-19 01:25:15 +08:00
" Cyan-Red color balance " ,
2006-04-05 05:11:45 +08:00
- 100 , 100 , - 100 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
g_param_spec_double ( " magenta-green " ,
" magenta green " ,
2006-05-19 01:25:15 +08:00
" Magenta-Green color balance " ,
2006-04-05 05:11:45 +08:00
- 100 , 100 , - 100 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
g_param_spec_double ( " yellow-blue " ,
" yellow blue " ,
2006-05-19 01:25:15 +08:00
" Yellow-Blue color balance " ,
2006-04-05 05:11:45 +08:00
- 100 , 100 , - 100 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 16:16:26 +08:00
g_object_unref ( procedure ) ;
moved a bunch of PDB stuff here
* app/color_cmds.c: moved a bunch of PDB stuff here
* app/color_balance.[ch]: removed PDB proc, exported TransferMode
enum, ColorBalanceDialog, color_balance_create_lookup_tables, and
color_balance
* app/curves.[ch]: removed PDB procs, exported SMOOTH and GFREE
#defines, CurvesDialog, curves_lut_func and curves_calculate_curve
* app/desaturate.[ch]: removed PDB proc, exported desaturate
* app/equalize.[ch]: removed PDB proc, exported equalize
* app/histogram_tool.[ch]: removed PDB proc, exported HISTOGRAM_WIDTH
and HISTOGRAM_HEIGHT #defines, HistogramToolDialog,
histogram_tool_histogram_range
* app/hue_saturation.[ch]: removed PDB proc, exported HueRange enum,
HueSaturationDialog, hue_saturation_calculate_transfers,
hue_saturation
* app/invert.[ch]: remove PDB proc, export invert
* app/threshold.[ch]: remove PDB proc, export ThresholdDialog and
threshold_2
* internal_procs.c: changes for pdbgen
* app/gimprc.c: removed leftover declaration
* app/image_map.h: add #include "gimpdrawableF.h"
* app/lut_funcs.h: add ALPHA_LUT to ChannelLutType
-Yosh
1999-04-21 13:39:57 +08:00
2006-04-05 05:11:45 +08:00
/*
* gimp - colorize
*/
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new ( colorize_invoker ) ;
2008-04-04 18:58:56 +08:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-colorize " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_set_static_strings ( procedure ,
" gimp-colorize " ,
2014-01-13 05:11:15 +08:00
" Deprecated: Use 'gimp-drawable-colorize-hsl' instead. " ,
" Deprecated: Use 'gimp-drawable-colorize-hsl' instead. " ,
" " ,
" " ,
" " ,
" gimp-drawable-colorize-hsl " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_drawable_id ( " drawable " ,
" drawable " ,
" The drawable " ,
2006-05-07 02:57:51 +08:00
pdb - > gimp , FALSE ,
2006-04-05 05:11:45 +08:00
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
g_param_spec_double ( " hue " ,
" hue " ,
2006-05-19 01:25:15 +08:00
" Hue in degrees " ,
2006-04-05 05:11:45 +08:00
0 , 360 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
g_param_spec_double ( " saturation " ,
" saturation " ,
2006-05-19 01:25:15 +08:00
" Saturation in percent " ,
2006-04-05 05:11:45 +08:00
0 , 100 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
g_param_spec_double ( " lightness " ,
" lightness " ,
2006-05-19 01:25:15 +08:00
" Lightness in percent " ,
2006-04-05 05:11:45 +08:00
- 100 , 100 , - 100 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 16:16:26 +08:00
g_object_unref ( procedure ) ;
2004-03-27 00:38:44 +08:00
2006-04-05 05:11:45 +08:00
/*
* gimp - histogram
*/
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new ( histogram_invoker ) ;
2008-04-04 18:58:56 +08:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-histogram " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_set_static_strings ( procedure ,
" gimp-histogram " ,
" Returns information on the intensity histogram for the specified drawable. " ,
2013-06-12 08:01:24 +08:00
" This tool makes it possible to gather information about the intensity histogram of a drawable. A channel to examine is first specified. This can be either value, red, green, or blue, depending on whether the drawable is of type color or grayscale. Second, a range of intensities are specified. The 'gimp-histogram' function returns statistics based on the pixels in the drawable that fall under this range of values. Mean, standard deviation, median, number of pixels, and percentile are all returned. Additionally, the total count of pixels in the image is returned. Counts of pixels are weighted by any associated alpha values and by the current selection mask. That is, pixels that lie outside an active selection mask will not be counted. Similarly, pixels with transparent alpha values will not be counted. The returned mean, std_dev and median are in the range (0..255) for 8-bit images, or if the plug-in is not precision-aware, and in the range (0.0..1.0) otherwise. " ,
2006-04-05 05:11:45 +08:00
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ,
NULL ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_drawable_id ( " drawable " ,
" drawable " ,
" The drawable " ,
2006-05-07 02:57:51 +08:00
pdb - > gimp , FALSE ,
2006-04-05 05:11:45 +08:00
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
g_param_spec_enum ( " channel " ,
" channel " ,
2006-05-19 01:25:15 +08:00
" The channel to modify " ,
2006-04-05 05:11:45 +08:00
GIMP_TYPE_HISTOGRAM_CHANNEL ,
GIMP_HISTOGRAM_VALUE ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_int32 ( " start-range " ,
" start range " ,
" Start of the intensity measurement range " ,
2010-06-06 01:26:06 +08:00
0 , 255 , 0 ,
2006-04-05 05:11:45 +08:00
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_int32 ( " end-range " ,
" end range " ,
" End of the intensity measurement range " ,
2010-06-06 01:26:06 +08:00
0 , 255 , 0 ,
2006-04-05 05:11:45 +08:00
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
g_param_spec_double ( " mean " ,
" mean " ,
" Mean intensity value " ,
- G_MAXDOUBLE , G_MAXDOUBLE , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
g_param_spec_double ( " std-dev " ,
" std dev " ,
" Standard deviation of intensity values " ,
- G_MAXDOUBLE , G_MAXDOUBLE , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
g_param_spec_double ( " median " ,
" median " ,
" Median intensity value " ,
- G_MAXDOUBLE , G_MAXDOUBLE , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
g_param_spec_double ( " pixels " ,
" pixels " ,
" Alpha-weighted pixel count for entire image " ,
- G_MAXDOUBLE , G_MAXDOUBLE , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
g_param_spec_double ( " count " ,
" count " ,
" Alpha-weighted pixel count for range " ,
- G_MAXDOUBLE , G_MAXDOUBLE , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
g_param_spec_double ( " percentile " ,
" percentile " ,
" Percentile that range falls under " ,
- G_MAXDOUBLE , G_MAXDOUBLE , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 16:16:26 +08:00
g_object_unref ( procedure ) ;
2004-10-20 06:52:04 +08:00
2006-04-05 05:11:45 +08:00
/*
* gimp - hue - saturation
*/
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new ( hue_saturation_invoker ) ;
2008-04-04 18:58:56 +08:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-hue-saturation " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_set_static_strings ( procedure ,
" gimp-hue-saturation " ,
2014-01-13 05:11:15 +08:00
" Deprecated: Use 'gimp-drawable-hue-saturation' instead. " ,
" Deprecated: Use 'gimp-drawable-hue-saturation' instead. " ,
" " ,
" " ,
" " ,
" gimp-drawable-hue-saturation " ) ;
2014-01-09 06:20:05 +08:00
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_drawable_id ( " drawable " ,
" drawable " ,
" The drawable " ,
pdb - > gimp , FALSE ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
g_param_spec_enum ( " hue-range " ,
" hue range " ,
" Range of affected hues " ,
GIMP_TYPE_HUE_RANGE ,
GIMP_ALL_HUES ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
g_param_spec_double ( " hue-offset " ,
" hue offset " ,
" Hue offset in degrees " ,
- 180 , 180 , - 180 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
g_param_spec_double ( " lightness " ,
" lightness " ,
" Lightness modification " ,
- 100 , 100 , - 100 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
g_param_spec_double ( " saturation " ,
" saturation " ,
" Saturation modification " ,
- 100 , 100 , - 100 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_pdb_register_procedure ( pdb , procedure ) ;
g_object_unref ( procedure ) ;
2006-04-05 05:11:45 +08:00
/*
* gimp - threshold
*/
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new ( threshold_invoker ) ;
2008-04-04 18:58:56 +08:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-threshold " ) ;
2006-04-05 05:11:45 +08:00
gimp_procedure_set_static_strings ( procedure ,
" gimp-threshold " ,
" Threshold the specified drawable. " ,
" This procedures generates a threshold map of the specified drawable. All pixels between the values of 'low_threshold' and 'high_threshold' are replaced with white, and all other pixels with black. " ,
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1997 " ,
NULL ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_drawable_id ( " drawable " ,
" drawable " ,
" The drawable " ,
2006-05-07 02:57:51 +08:00
pdb - > gimp , FALSE ,
2006-04-05 05:11:45 +08:00
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_int32 ( " low-threshold " ,
" low threshold " ,
2006-05-19 01:25:15 +08:00
" The low threshold value " ,
2006-04-05 05:11:45 +08:00
0 , 255 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_int32 ( " high-threshold " ,
" high threshold " ,
2006-05-19 01:25:15 +08:00
" The high threshold value " ,
2006-04-05 05:11:45 +08:00
0 , 255 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 16:16:26 +08:00
g_object_unref ( procedure ) ;
moved a bunch of PDB stuff here
* app/color_cmds.c: moved a bunch of PDB stuff here
* app/color_balance.[ch]: removed PDB proc, exported TransferMode
enum, ColorBalanceDialog, color_balance_create_lookup_tables, and
color_balance
* app/curves.[ch]: removed PDB procs, exported SMOOTH and GFREE
#defines, CurvesDialog, curves_lut_func and curves_calculate_curve
* app/desaturate.[ch]: removed PDB proc, exported desaturate
* app/equalize.[ch]: removed PDB proc, exported equalize
* app/histogram_tool.[ch]: removed PDB proc, exported HISTOGRAM_WIDTH
and HISTOGRAM_HEIGHT #defines, HistogramToolDialog,
histogram_tool_histogram_range
* app/hue_saturation.[ch]: removed PDB proc, exported HueRange enum,
HueSaturationDialog, hue_saturation_calculate_transfers,
hue_saturation
* app/invert.[ch]: remove PDB proc, export invert
* app/threshold.[ch]: remove PDB proc, export ThresholdDialog and
threshold_2
* internal_procs.c: changes for pdbgen
* app/gimprc.c: removed leftover declaration
* app/image_map.h: add #include "gimpdrawableF.h"
* app/lut_funcs.h: add ALPHA_LUT to ChannelLutType
-Yosh
1999-04-21 13:39:57 +08:00
}