1999-04-09 06:00:11 +00:00
/* The GIMP -- an image manipulation program
2003-07-03 00:47:26 +00:00
* Copyright ( C ) 1995 - 2003 Spencer Kimball and Peter Mattis
1999-04-09 06:00:11 +00:00
*
* This program is free software ; you can redistribute it and / or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation ; either version 2 of the License , or
* ( 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
* along with this program ; if not , write to the Free Software
* Foundation , Inc . , 59 Temple Place - Suite 330 , Boston , MA 02111 - 1307 , USA .
*/
1999-04-10 21:51:25 +00:00
/* NOTE: This file is autogenerated by pdbgen.pl. */
2000-12-29 15:22:01 +00:00
# include "config.h"
2002-08-26 11:35:56 +00:00
# include <glib-object.h>
2000-12-29 15:22:01 +00:00
2001-08-17 14:27:31 +00:00
# include "pdb-types.h"
2006-03-31 19:28:53 +00:00
# include "gimpargument.h"
2006-03-31 09:15:08 +00:00
# include "gimpprocedure.h"
1999-04-10 21:51:25 +00:00
# include "procedural_db.h"
2006-03-28 19:58:00 +00:00
# include "core/gimpparamspecs.h"
1999-04-10 21:51:25 +00:00
2002-08-26 11:35:56 +00:00
# include "base/color-balance.h"
2004-10-03 12:57:06 +00:00
# include "base/colorize.h"
2002-08-26 11:35:56 +00:00
# include "base/curves.h"
2001-05-22 23:05:35 +00:00
# include "base/gimphistogram.h"
2001-05-15 11:25:25 +00:00
# include "base/gimplut.h"
2002-08-26 11:35:56 +00:00
# include "base/hue-saturation.h"
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 15:25:15 +00:00
# include "base/levels.h"
2001-05-22 23:05:35 +00:00
# include "base/lut-funcs.h"
2001-05-15 11:25:25 +00:00
# include "base/pixel-processor.h"
# include "base/pixel-region.h"
2002-08-26 11:35:56 +00:00
# include "base/threshold.h"
2003-01-15 13:40:44 +00:00
# include "core/gimp.h"
2001-05-09 02:32:03 +00:00
# include "core/gimpdrawable-desaturate.h"
# include "core/gimpdrawable-equalize.h"
2003-08-31 18:19:13 +00:00
# include "core/gimpdrawable-histogram.h"
2001-05-09 02:32:03 +00:00
# include "core/gimpdrawable-invert.h"
2004-10-29 22:18:49 +00:00
# include "core/gimpdrawable-levels.h"
2001-05-09 02:32:03 +00:00
# include "core/gimpdrawable.h"
# include "core/gimpimage.h"
2003-03-25 16:38:19 +00:00
# include "gimp-intl.h"
2003-02-14 14:14:29 +00:00
2006-03-31 17:42:13 +00:00
static GimpProcedure brightness_contrast_proc ;
static GimpProcedure levels_proc ;
static GimpProcedure levels_auto_proc ;
static GimpProcedure levels_stretch_proc ;
static GimpProcedure posterize_proc ;
static GimpProcedure desaturate_proc ;
static GimpProcedure desaturate_full_proc ;
static GimpProcedure equalize_proc ;
static GimpProcedure invert_proc ;
static GimpProcedure curves_spline_proc ;
static GimpProcedure curves_explicit_proc ;
static GimpProcedure color_balance_proc ;
static GimpProcedure colorize_proc ;
static GimpProcedure histogram_proc ;
static GimpProcedure hue_saturation_proc ;
static GimpProcedure threshold_proc ;
1999-04-10 21:51:25 +00:00
void
2001-07-04 19:31:35 +00:00
register_color_procs ( Gimp * gimp )
1999-04-10 21:51:25 +00:00
{
2006-03-31 17:42:13 +00:00
GimpProcedure * procedure ;
2006-03-29 20:27:46 +00:00
2006-03-28 19:58:00 +00:00
/*
* brightness_contrast
*/
2006-03-31 09:15:08 +00:00
procedure = gimp_procedure_init ( & brightness_contrast_proc , 3 , 0 ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_DRAWABLE ,
gimp_param_spec_item_id ( " drawable " ,
" drawable " ,
" The drawable " ,
gimp ,
GIMP_TYPE_DRAWABLE ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_int ( " brightness " ,
" brightness " ,
" Brightness adjustment (-127 <= brightness <= 127) " ,
- 127 , 127 , - 127 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_int ( " contrast " ,
" contrast " ,
" Contrast adjustment (-127 <= contrast <= 127) " ,
- 127 , 127 , - 127 ,
GIMP_PARAM_READWRITE ) ) ;
2006-03-29 20:27:46 +00:00
procedural_db_register ( gimp , procedure ) ;
2006-03-28 19:58:00 +00:00
/*
* levels
*/
2006-03-31 09:15:08 +00:00
procedure = gimp_procedure_init ( & levels_proc , 7 , 0 ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_DRAWABLE ,
gimp_param_spec_item_id ( " drawable " ,
" drawable " ,
" The drawable " ,
gimp ,
GIMP_TYPE_DRAWABLE ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_enum ( " channel " ,
" channel " ,
" The channel to modify: { GIMP_HISTOGRAM_VALUE (0), GIMP_HISTOGRAM_RED (1), GIMP_HISTOGRAM_GREEN (2), GIMP_HISTOGRAM_BLUE (3), GIMP_HISTOGRAM_ALPHA (4) } " ,
GIMP_TYPE_HISTOGRAM_CHANNEL ,
GIMP_HISTOGRAM_VALUE ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_int ( " low-input " ,
" low input " ,
" Intensity of lowest input (0 <= low_input <= 255) " ,
0 , 255 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_int ( " high-input " ,
" high input " ,
" Intensity of highest input (0 <= high_input <= 255) " ,
0 , 255 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_FLOAT ,
g_param_spec_double ( " gamma " ,
" gamma " ,
" Gamma correction factor (0.1 <= gamma <= 10) " ,
0.1 , 10 , 0.1 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_int ( " low-output " ,
" low output " ,
" Intensity of lowest output (0 <= low_output <= 255) " ,
0 , 255 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_int ( " high-output " ,
" high output " ,
" Intensity of highest output (0 <= high_output <= 255) " ,
0 , 255 , 0 ,
2006-03-28 19:58:00 +00:00
GIMP_PARAM_READWRITE ) ) ;
2006-03-29 20:27:46 +00:00
procedural_db_register ( gimp , procedure ) ;
2006-03-28 19:58:00 +00:00
/*
* levels_auto
*/
2006-03-31 09:15:08 +00:00
procedure = gimp_procedure_init ( & levels_auto_proc , 1 , 0 ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_DRAWABLE ,
gimp_param_spec_item_id ( " drawable " ,
" drawable " ,
" The drawable " ,
gimp ,
GIMP_TYPE_DRAWABLE ,
GIMP_PARAM_READWRITE ) ) ;
2006-03-29 20:27:46 +00:00
procedural_db_register ( gimp , procedure ) ;
2006-03-28 19:58:00 +00:00
/*
* levels_stretch
*/
2006-03-31 09:15:08 +00:00
procedure = gimp_procedure_init ( & levels_stretch_proc , 1 , 0 ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_DRAWABLE ,
gimp_param_spec_item_id ( " drawable " ,
" drawable " ,
" The drawable " ,
gimp ,
GIMP_TYPE_DRAWABLE ,
GIMP_PARAM_READWRITE ) ) ;
2006-03-29 20:27:46 +00:00
procedural_db_register ( gimp , procedure ) ;
2006-03-28 19:58:00 +00:00
/*
* posterize
*/
2006-03-31 09:15:08 +00:00
procedure = gimp_procedure_init ( & posterize_proc , 2 , 0 ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_DRAWABLE ,
gimp_param_spec_item_id ( " drawable " ,
" drawable " ,
" The drawable " ,
gimp ,
GIMP_TYPE_DRAWABLE ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_int ( " levels " ,
" levels " ,
" Levels of posterization (2 <= levels <= 255) " ,
2 , 255 , 2 ,
GIMP_PARAM_READWRITE ) ) ;
2006-03-29 20:27:46 +00:00
procedural_db_register ( gimp , procedure ) ;
2006-03-28 19:58:00 +00:00
/*
* desaturate
*/
2006-03-31 09:15:08 +00:00
procedure = gimp_procedure_init ( & desaturate_proc , 1 , 0 ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_DRAWABLE ,
gimp_param_spec_item_id ( " drawable " ,
" drawable " ,
" The drawable " ,
gimp ,
GIMP_TYPE_DRAWABLE ,
GIMP_PARAM_READWRITE ) ) ;
2006-03-29 20:27:46 +00:00
procedural_db_register ( gimp , procedure ) ;
2006-03-28 19:58:00 +00:00
/*
* desaturate_full
*/
2006-03-31 09:15:08 +00:00
procedure = gimp_procedure_init ( & desaturate_full_proc , 2 , 0 ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_DRAWABLE ,
gimp_param_spec_item_id ( " drawable " ,
" drawable " ,
" The drawable " ,
gimp ,
GIMP_TYPE_DRAWABLE ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_INT32 ,
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-03-29 20:27:46 +00:00
procedural_db_register ( gimp , procedure ) ;
2006-03-28 19:58:00 +00:00
/*
* equalize
*/
2006-03-31 09:15:08 +00:00
procedure = gimp_procedure_init ( & equalize_proc , 2 , 0 ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_DRAWABLE ,
gimp_param_spec_item_id ( " drawable " ,
" drawable " ,
" The drawable " ,
gimp ,
GIMP_TYPE_DRAWABLE ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_boolean ( " mask-only " ,
" mask only " ,
" Equalization option " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
2006-03-29 20:27:46 +00:00
procedural_db_register ( gimp , procedure ) ;
2006-03-28 19:58:00 +00:00
/*
* invert
*/
2006-03-31 09:15:08 +00:00
procedure = gimp_procedure_init ( & invert_proc , 1 , 0 ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_DRAWABLE ,
gimp_param_spec_item_id ( " drawable " ,
" drawable " ,
" The drawable " ,
gimp ,
GIMP_TYPE_DRAWABLE ,
GIMP_PARAM_READWRITE ) ) ;
2006-03-29 20:27:46 +00:00
procedural_db_register ( gimp , procedure ) ;
2006-03-28 19:58:00 +00:00
/*
* curves_spline
*/
2006-03-31 09:15:08 +00:00
procedure = gimp_procedure_init ( & curves_spline_proc , 4 , 0 ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_DRAWABLE ,
gimp_param_spec_item_id ( " drawable " ,
" drawable " ,
" The drawable " ,
gimp ,
GIMP_TYPE_DRAWABLE ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_enum ( " channel " ,
" channel " ,
" The channel to modify: { GIMP_HISTOGRAM_VALUE (0), GIMP_HISTOGRAM_RED (1), GIMP_HISTOGRAM_GREEN (2), GIMP_HISTOGRAM_BLUE (3), GIMP_HISTOGRAM_ALPHA (4) } " ,
GIMP_TYPE_HISTOGRAM_CHANNEL ,
GIMP_HISTOGRAM_VALUE ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_int ( " num-points " ,
" num points " ,
" The number of values in the control point array (4 <= num_points <= 34) " ,
4 , 34 , 4 ,
2006-03-28 19:58:00 +00:00
GIMP_PARAM_READWRITE ) ) ;
2006-03-31 09:15:08 +00:00
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_INT8ARRAY ,
2006-04-01 01:33:28 +00:00
gimp_param_spec_array ( " control-pts " ,
" control pts " ,
" The spline control points: { cp1.x, cp1.y, cp2.x, cp2.y, ... } " ,
GIMP_PARAM_READWRITE ) ) ;
2006-03-29 20:27:46 +00:00
procedural_db_register ( gimp , procedure ) ;
2006-03-28 19:58:00 +00:00
/*
* curves_explicit
*/
2006-03-31 09:15:08 +00:00
procedure = gimp_procedure_init ( & curves_explicit_proc , 4 , 0 ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_DRAWABLE ,
gimp_param_spec_item_id ( " drawable " ,
" drawable " ,
" The drawable " ,
gimp ,
GIMP_TYPE_DRAWABLE ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_enum ( " channel " ,
" channel " ,
" The channel to modify: { GIMP_HISTOGRAM_VALUE (0), GIMP_HISTOGRAM_RED (1), GIMP_HISTOGRAM_GREEN (2), GIMP_HISTOGRAM_BLUE (3), GIMP_HISTOGRAM_ALPHA (4) } " ,
GIMP_TYPE_HISTOGRAM_CHANNEL ,
GIMP_HISTOGRAM_VALUE ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_int ( " num-bytes " ,
" num bytes " ,
" The number of bytes in the new curve (always 256) " ,
0 , G_MAXINT32 , 0 ,
2006-03-28 19:58:00 +00:00
GIMP_PARAM_READWRITE ) ) ;
2006-03-31 09:15:08 +00:00
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_INT8ARRAY ,
2006-04-01 01:33:28 +00:00
gimp_param_spec_array ( " curve " ,
" curve " ,
" The explicit curve " ,
GIMP_PARAM_READWRITE ) ) ;
2006-03-29 20:27:46 +00:00
procedural_db_register ( gimp , procedure ) ;
2006-03-28 19:58:00 +00:00
/*
* color_balance
*/
2006-03-31 09:15:08 +00:00
procedure = gimp_procedure_init ( & color_balance_proc , 6 , 0 ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_DRAWABLE ,
gimp_param_spec_item_id ( " drawable " ,
" drawable " ,
" The drawable " ,
gimp ,
GIMP_TYPE_DRAWABLE ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_enum ( " transfer-mode " ,
" transfer mode " ,
" Transfer mode: { GIMP_SHADOWS (0), GIMP_MIDTONES (1), GIMP_HIGHLIGHTS (2) } " ,
GIMP_TYPE_TRANSFER_MODE ,
GIMP_SHADOWS ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_boolean ( " preserve-lum " ,
" preserve lum " ,
" Preserve luminosity values at each pixel " ,
FALSE ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_FLOAT ,
g_param_spec_double ( " cyan-red " ,
" cyan red " ,
" Cyan-Red color balance (-100 <= cyan_red <= 100) " ,
- 100 , 100 , - 100 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_FLOAT ,
g_param_spec_double ( " magenta-green " ,
" magenta green " ,
" Magenta-Green color balance (-100 <= magenta_green <= 100) " ,
- 100 , 100 , - 100 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_FLOAT ,
g_param_spec_double ( " yellow-blue " ,
" yellow blue " ,
" Yellow-Blue color balance (-100 <= yellow_blue <= 100) " ,
- 100 , 100 , - 100 ,
2006-03-28 19:58:00 +00:00
GIMP_PARAM_READWRITE ) ) ;
2006-03-29 20:27:46 +00:00
procedural_db_register ( gimp , procedure ) ;
2006-03-28 19:58:00 +00:00
/*
* colorize
*/
2006-03-31 09:15:08 +00:00
procedure = gimp_procedure_init ( & colorize_proc , 4 , 0 ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_DRAWABLE ,
gimp_param_spec_item_id ( " drawable " ,
" drawable " ,
" The drawable " ,
gimp ,
GIMP_TYPE_DRAWABLE ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_FLOAT ,
g_param_spec_double ( " hue " ,
" hue " ,
" Hue in degrees (0 <= hue <= 360) " ,
0 , 360 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_FLOAT ,
g_param_spec_double ( " saturation " ,
" saturation " ,
" Saturation in percent (0 <= saturation <= 100) " ,
0 , 100 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_FLOAT ,
g_param_spec_double ( " lightness " ,
" lightness " ,
" Lightness in percent (-100 <= lightness <= 100) " ,
- 100 , 100 , - 100 ,
GIMP_PARAM_READWRITE ) ) ;
2006-03-29 20:27:46 +00:00
procedural_db_register ( gimp , procedure ) ;
2006-03-28 19:58:00 +00:00
/*
* histogram
*/
2006-03-31 09:15:08 +00:00
procedure = gimp_procedure_init ( & histogram_proc , 4 , 6 ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_DRAWABLE ,
gimp_param_spec_item_id ( " drawable " ,
" drawable " ,
" The drawable " ,
gimp ,
GIMP_TYPE_DRAWABLE ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_enum ( " channel " ,
" channel " ,
" The channel to modify: { GIMP_HISTOGRAM_VALUE (0), GIMP_HISTOGRAM_RED (1), GIMP_HISTOGRAM_GREEN (2), GIMP_HISTOGRAM_BLUE (3), GIMP_HISTOGRAM_ALPHA (4) } " ,
GIMP_TYPE_HISTOGRAM_CHANNEL ,
GIMP_HISTOGRAM_VALUE ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_int ( " start-range " ,
" start range " ,
" Start of the intensity measurement range " ,
0 , 256 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_int ( " end-range " ,
" end range " ,
" End of the intensity measurement range " ,
0 , 256 , 0 ,
2006-03-28 19:58:00 +00:00
GIMP_PARAM_READWRITE ) ) ;
2006-03-31 09:15:08 +00:00
gimp_procedure_add_return_value ( procedure ,
GIMP_PDB_FLOAT ,
g_param_spec_double ( " mean " ,
" mean " ,
" Mean intensity value " ,
- G_MAXDOUBLE , G_MAXDOUBLE , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
GIMP_PDB_FLOAT ,
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 ,
GIMP_PDB_FLOAT ,
g_param_spec_double ( " median " ,
" median " ,
" Median intensity value " ,
- G_MAXDOUBLE , G_MAXDOUBLE , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_return_value ( procedure ,
GIMP_PDB_FLOAT ,
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 ,
GIMP_PDB_FLOAT ,
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 ,
GIMP_PDB_FLOAT ,
g_param_spec_double ( " percentile " ,
" percentile " ,
" Percentile that range falls under " ,
- G_MAXDOUBLE , G_MAXDOUBLE , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-03-29 20:27:46 +00:00
procedural_db_register ( gimp , procedure ) ;
2006-03-28 19:58:00 +00:00
/*
* hue_saturation
*/
2006-03-31 09:15:08 +00:00
procedure = gimp_procedure_init ( & hue_saturation_proc , 5 , 0 ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_DRAWABLE ,
gimp_param_spec_item_id ( " drawable " ,
" drawable " ,
" The drawable " ,
gimp ,
GIMP_TYPE_DRAWABLE ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_enum ( " hue-range " ,
" hue range " ,
" Range of affected hues: { GIMP_ALL_HUES (0), GIMP_RED_HUES (1), GIMP_YELLOW_HUES (2), GIMP_GREEN_HUES (3), GIMP_CYAN_HUES (4), GIMP_BLUE_HUES (5), GIMP_MAGENTA_HUES (6) } " ,
GIMP_TYPE_HUE_RANGE ,
GIMP_ALL_HUES ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_FLOAT ,
g_param_spec_double ( " hue-offset " ,
" hue offset " ,
" Hue offset in degrees (-180 <= hue_offset <= 180) " ,
- 180 , 180 , - 180 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_FLOAT ,
g_param_spec_double ( " lightness " ,
" lightness " ,
" Lightness modification (-100 <= lightness <= 100) " ,
- 100 , 100 , - 100 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_FLOAT ,
g_param_spec_double ( " saturation " ,
" saturation " ,
" Saturation modification (-100 <= saturation <= 100) " ,
- 100 , 100 , - 100 ,
GIMP_PARAM_READWRITE ) ) ;
2006-03-29 20:27:46 +00:00
procedural_db_register ( gimp , procedure ) ;
2006-03-28 19:58:00 +00:00
/*
* threshold
*/
2006-03-31 09:15:08 +00:00
procedure = gimp_procedure_init ( & threshold_proc , 3 , 0 ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_DRAWABLE ,
gimp_param_spec_item_id ( " drawable " ,
" drawable " ,
" The drawable " ,
gimp ,
GIMP_TYPE_DRAWABLE ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_int ( " low-threshold " ,
" low threshold " ,
" The low threshold value (0 <= low_threshold <= 255) " ,
0 , 255 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
gimp_procedure_add_argument ( procedure ,
GIMP_PDB_INT32 ,
g_param_spec_int ( " high-threshold " ,
" high threshold " ,
" The high threshold value (0 <= high_threshold <= 255) " ,
0 , 255 , 0 ,
GIMP_PARAM_READWRITE ) ) ;
2006-03-29 20:27:46 +00:00
procedural_db_register ( gimp , procedure ) ;
2006-03-28 19:58:00 +00:00
1999-04-10 21:51:25 +00:00
}
2006-03-31 20:16:22 +00:00
static GimpArgument *
2006-03-31 17:42:13 +00:00
brightness_contrast_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
2006-03-31 20:16:22 +00:00
GimpArgument * args )
1999-04-10 21:51:25 +00:00
{
gboolean success = TRUE ;
GimpDrawable * drawable ;
gint32 brightness ;
gint32 contrast ;
2006-03-29 23:56:07 +00:00
drawable = ( GimpDrawable * ) gimp_value_get_item ( & args [ 0 ] . value , gimp , GIMP_TYPE_DRAWABLE ) ;
brightness = g_value_get_int ( & args [ 1 ] . value ) ;
contrast = g_value_get_int ( & args [ 2 ] . value ) ;
1999-04-10 21:51:25 +00:00
if ( success )
{
2004-11-16 13:41:55 +00:00
if ( ! gimp_item_is_attached ( GIMP_ITEM ( drawable ) ) | |
gimp_drawable_is_indexed ( drawable ) )
2004-03-26 16:49:18 +00:00
success = FALSE ;
2004-03-26 16:38:44 +00:00
2004-01-13 11:51:45 +00:00
if ( success )
2004-03-26 16:49:18 +00:00
{
2004-10-19 22:52:04 +00:00
gint x , y , width , height ;
2004-03-26 16:38:44 +00:00
2004-03-26 16:49:18 +00:00
/* The application should occur only within selection bounds */
2004-10-19 22:52:04 +00:00
if ( gimp_drawable_mask_intersect ( drawable , & x , & y , & width , & height ) )
{
GimpLut * lut ;
PixelRegion srcPR , destPR ;
2004-03-26 16:38:44 +00:00
2004-10-19 22:52:04 +00:00
lut = brightness_contrast_lut_new ( brightness / 255.0 ,
contrast / 127.0 ,
gimp_drawable_bytes ( drawable ) ) ;
2004-03-26 16:38:44 +00:00
2004-10-19 22:52:04 +00:00
pixel_region_init ( & srcPR , gimp_drawable_data ( drawable ) ,
x , y , width , height , FALSE ) ;
pixel_region_init ( & destPR , gimp_drawable_shadow ( drawable ) ,
x , y , width , height , TRUE ) ;
2004-03-26 16:38:44 +00:00
2005-02-15 15:39:27 +00:00
pixel_regions_process_parallel ( ( PixelProcessorFunc )
gimp_lut_process ,
2005-02-11 17:03:56 +00:00
lut , 2 , & srcPR , & destPR ) ;
2004-03-26 16:38:44 +00:00
2004-10-19 22:52:04 +00:00
gimp_lut_free ( lut ) ;
gimp_drawable_merge_shadow ( drawable , TRUE , _ ( " Brightness-Contrast " ) ) ;
gimp_drawable_update ( drawable , x , y , width , height ) ;
}
2004-03-26 16:49:18 +00:00
}
1999-04-10 21:51:25 +00:00
}
1999-04-09 06:00:11 +00:00
2006-03-31 17:42:13 +00:00
return gimp_procedure_get_return_values ( procedure , success ) ;
1999-04-10 21:51:25 +00:00
}
1999-04-09 06:00:11 +00:00
2006-03-31 17:42:13 +00:00
static GimpProcedure brightness_contrast_proc =
1999-04-09 06:00:11 +00:00
{
2006-03-31 16:17:07 +00:00
TRUE , TRUE ,
2005-08-02 22:52:23 +00:00
" gimp-brightness-contrast " ,
" gimp-brightness-contrast " ,
1999-04-10 21:51:25 +00:00
" Modify brightness/contrast in the specified drawable. " ,
" This procedures allows the brightness and contrast of the specified drawable to be modified. Both 'brightness' and 'contrast' parameters are defined between -127 and 127. " ,
1999-04-09 06:00:11 +00:00
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1997 " ,
2004-10-06 13:13:08 +00:00
NULL ,
2001-05-21 13:58:46 +00:00
GIMP_INTERNAL ,
2006-03-28 19:58:00 +00:00
0 , NULL , 0 , NULL ,
1999-04-10 21:51:25 +00:00
{ { brightness_contrast_invoker } }
1999-04-09 06:00:11 +00:00
} ;
2006-03-31 20:16:22 +00:00
static GimpArgument *
2006-03-31 17:42:13 +00:00
levels_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
2006-03-31 20:16:22 +00:00
GimpArgument * args )
1999-04-09 06:00:11 +00:00
{
1999-04-10 21:51:25 +00: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 15:25:15 +00:00
gint32 low_input ;
gint32 high_input ;
gdouble gamma ;
gint32 low_output ;
gint32 high_output ;
1999-04-09 06:00:11 +00:00
2006-03-29 23:56:07 +00:00
drawable = ( GimpDrawable * ) gimp_value_get_item ( & args [ 0 ] . value , gimp , GIMP_TYPE_DRAWABLE ) ;
channel = g_value_get_enum ( & args [ 1 ] . value ) ;
low_input = g_value_get_int ( & args [ 2 ] . value ) ;
high_input = g_value_get_int ( & args [ 3 ] . value ) ;
gamma = g_value_get_double ( & args [ 4 ] . value ) ;
low_output = g_value_get_int ( & args [ 5 ] . value ) ;
high_output = g_value_get_int ( & args [ 6 ] . value ) ;
1999-04-09 06:00:11 +00:00
1999-04-10 21:51:25 +00:00
if ( success )
{
2004-11-16 13:41:55 +00:00
if ( ! gimp_item_is_attached ( GIMP_ITEM ( drawable ) ) | |
gimp_drawable_is_indexed ( drawable ) | |
2004-03-26 16:49:18 +00: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-26 16:38:44 +00:00
2004-01-13 11:51:45 +00:00
if ( success )
2004-10-29 22:18:49 +00:00
gimp_drawable_levels ( drawable , context ,
channel ,
2006-03-22 17:19:14 +00:00
low_input , high_input ,
2004-10-29 22:18:49 +00:00
gamma ,
2006-03-22 17:19:14 +00:00
low_output , high_output ) ;
1999-04-09 06:00:11 +00:00
}
2006-03-31 17:42:13 +00:00
return gimp_procedure_get_return_values ( procedure , success ) ;
1999-04-09 06:00:11 +00:00
}
2006-03-31 17:42:13 +00:00
static GimpProcedure levels_proc =
1999-04-09 06:00:11 +00:00
{
2006-03-31 16:17:07 +00:00
TRUE , TRUE ,
2005-08-02 22:52:23 +00:00
" gimp-levels " ,
" gimp-levels " ,
1999-04-10 21:51:25 +00:00
" Modifies intensity levels in the specified drawable. " ,
" This tool allows intensity levels in the specified drawable to be remapped according to a set of parameters. The low/high input levels specify an initial mapping from the source intensities. The gamma value determines how intensities between the low and high input intensities are interpolated. A gamma value of 1.0 results in a linear interpolation. Higher gamma values result in more high-level intensities. Lower gamma values result in more low-level intensities. The low/high output levels constrain the final intensity mapping--that is, no final intensity will be lower than the low output level and no final intensity will be higher than the high output level. This tool is only valid on RGB color and grayscale images. It will not operate on indexed drawables. " ,
1999-04-09 06:00:11 +00:00
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ,
2004-10-06 13:13:08 +00:00
NULL ,
2001-05-21 13:58:46 +00:00
GIMP_INTERNAL ,
2006-03-28 19:58:00 +00:00
0 , NULL , 0 , NULL ,
1999-04-10 21:51:25 +00:00
{ { levels_invoker } }
1999-04-09 06:00:11 +00:00
} ;
2006-03-31 20:16:22 +00:00
static GimpArgument *
2006-03-31 17:42:13 +00:00
levels_auto_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
2006-03-31 20:16:22 +00:00
GimpArgument * args )
2003-08-31 15:42:39 +00:00
{
gboolean success = TRUE ;
GimpDrawable * drawable ;
2006-03-29 23:56:07 +00:00
drawable = ( GimpDrawable * ) gimp_value_get_item ( & args [ 0 ] . value , gimp , GIMP_TYPE_DRAWABLE ) ;
2003-08-31 15:42:39 +00:00
if ( success )
{
2004-11-16 13:41:55 +00:00
if ( ! gimp_item_is_attached ( GIMP_ITEM ( drawable ) ) | |
gimp_drawable_is_indexed ( drawable ) )
2004-03-26 16:49:18 +00:00
success = FALSE ;
2004-03-26 16:38:44 +00:00
2003-08-31 15:42:39 +00:00
if ( success )
2004-11-01 16:05:19 +00:00
gimp_drawable_levels_stretch ( drawable , context ) ;
2003-08-31 15:42:39 +00:00
}
2006-03-31 17:42:13 +00:00
return gimp_procedure_get_return_values ( procedure , success ) ;
2003-08-31 15:42:39 +00:00
}
2006-03-31 17:42:13 +00:00
static GimpProcedure levels_auto_proc =
2003-08-31 15:42:39 +00:00
{
2006-03-31 16:17:07 +00:00
TRUE , TRUE ,
2005-08-02 22:52:23 +00:00
" gimp-levels-auto " ,
" gimp-levels-auto " ,
2004-11-01 16:24:59 +00:00
" This procedure is deprecated! Use 'gimp_levels_stretch' instead. " ,
" This procedure is deprecated! Use 'gimp_levels_stretch' instead. " ,
" " ,
" " ,
" " ,
2004-11-01 16:05:19 +00:00
" gimp_levels_stretch " ,
2003-08-31 15:42:39 +00:00
GIMP_INTERNAL ,
2006-03-28 19:58:00 +00:00
0 , NULL , 0 , NULL ,
2003-08-31 15:42:39 +00:00
{ { levels_auto_invoker } }
} ;
2006-03-31 20:16:22 +00:00
static GimpArgument *
2006-03-31 17:42:13 +00:00
levels_stretch_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
2006-03-31 20:16:22 +00:00
GimpArgument * args )
2004-11-01 16:20:47 +00:00
{
gboolean success = TRUE ;
GimpDrawable * drawable ;
2006-03-29 23:56:07 +00:00
drawable = ( GimpDrawable * ) gimp_value_get_item ( & args [ 0 ] . value , gimp , GIMP_TYPE_DRAWABLE ) ;
2004-11-01 16:20:47 +00:00
if ( success )
{
2004-11-16 13:41:55 +00:00
if ( ! gimp_item_is_attached ( GIMP_ITEM ( drawable ) ) | |
gimp_drawable_is_indexed ( drawable ) )
2004-11-01 16:20:47 +00:00
success = FALSE ;
if ( success )
gimp_drawable_levels_stretch ( drawable , context ) ;
}
2006-03-31 17:42:13 +00:00
return gimp_procedure_get_return_values ( procedure , success ) ;
2004-11-01 16:20:47 +00:00
}
2006-03-31 17:42:13 +00:00
static GimpProcedure levels_stretch_proc =
2004-11-01 16:20:47 +00:00
{
2006-03-31 16:17:07 +00:00
TRUE , TRUE ,
2005-08-02 22:52:23 +00:00
" gimp-levels-stretch " ,
" gimp-levels-stretch " ,
2004-11-01 16:20:47 +00:00
" Automatically modifies intensity levels in the specified drawable. " ,
" This procedure allows intensity levels in the specified drawable to be remapped according to a set of guessed parameters. It is equivalent to clicking the \" Auto \" button in the Levels tool. This procedure is only valid on RGB color and grayscale images. It will not operate on indexed drawables. " ,
2004-11-01 16:24:59 +00:00
" Joao S.O. Bueno, Shawn Willden " ,
" Joao S.O. Bueno, Shawn Willden " ,
" 2003 " ,
2004-11-01 16:20:47 +00:00
NULL ,
GIMP_INTERNAL ,
2006-03-28 19:58:00 +00:00
0 , NULL , 0 , NULL ,
2004-11-01 16:20:47 +00:00
{ { levels_stretch_invoker } }
} ;
2006-03-31 20:16:22 +00:00
static GimpArgument *
2006-03-31 17:42:13 +00:00
posterize_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
2006-03-31 20:16:22 +00:00
GimpArgument * args )
1999-04-09 06:00:11 +00:00
{
1999-04-10 21:51:25 +00:00
gboolean success = TRUE ;
1999-04-09 06:00:11 +00:00
GimpDrawable * drawable ;
1999-04-10 21:51:25 +00:00
gint32 levels ;
2006-03-29 23:56:07 +00:00
drawable = ( GimpDrawable * ) gimp_value_get_item ( & args [ 0 ] . value , gimp , GIMP_TYPE_DRAWABLE ) ;
levels = g_value_get_int ( & args [ 1 ] . value ) ;
1999-04-10 21:51:25 +00:00
1999-04-09 06:00:11 +00:00
if ( success )
{
2004-11-16 13:41:55 +00:00
if ( ! gimp_item_is_attached ( GIMP_ITEM ( drawable ) ) | |
gimp_drawable_is_indexed ( drawable ) )
2004-03-26 16:49:18 +00:00
success = FALSE ;
2004-03-26 16:38:44 +00:00
2004-01-13 11:51:45 +00:00
if ( success )
2004-03-26 16:49:18 +00:00
{
2004-10-19 22:52:04 +00:00
gint x , y , width , height ;
2004-03-26 16:38:44 +00:00
2004-03-26 16:49:18 +00:00
/* The application should occur only within selection bounds */
2004-10-19 22:52:04 +00:00
if ( gimp_drawable_mask_intersect ( drawable , & x , & y , & width , & height ) )
{
GimpLut * lut ;
PixelRegion srcPR , destPR ;
2004-03-26 16:38:44 +00:00
2006-01-17 12:43:50 +00:00
lut = posterize_lut_new ( levels , gimp_drawable_bytes ( drawable ) ) ;
2004-03-26 16:38:44 +00:00
2004-10-19 22:52:04 +00:00
pixel_region_init ( & srcPR , gimp_drawable_data ( drawable ) ,
x , y , width , height , FALSE ) ;
pixel_region_init ( & destPR , gimp_drawable_shadow ( drawable ) ,
x , y , width , height , TRUE ) ;
2004-03-26 16:38:44 +00:00
2005-02-15 15:39:27 +00:00
pixel_regions_process_parallel ( ( PixelProcessorFunc )
gimp_lut_process ,
2005-02-11 17:03:56 +00:00
lut , 2 , & srcPR , & destPR ) ;
2004-03-26 16:38:44 +00:00
2004-10-19 22:52:04 +00:00
gimp_lut_free ( lut ) ;
gimp_drawable_merge_shadow ( drawable , TRUE , _ ( " Posterize " ) ) ;
gimp_drawable_update ( drawable , x , y , width , height ) ;
}
2004-03-26 16:49:18 +00:00
}
1999-04-09 06:00:11 +00:00
}
2006-03-31 17:42:13 +00:00
return gimp_procedure_get_return_values ( procedure , success ) ;
1999-04-09 06:00:11 +00:00
}
2006-03-31 17:42:13 +00:00
static GimpProcedure posterize_proc =
1999-04-09 06:00:11 +00:00
{
2006-03-31 16:17:07 +00:00
TRUE , TRUE ,
2005-08-02 22:52:23 +00:00
" gimp-posterize " ,
" gimp-posterize " ,
1999-04-10 21:51:25 +00:00
" Posterize the specified drawable. " ,
1999-04-09 06:00:11 +00:00
" This procedures reduces the number of shades allows in each intensity channel to the specified 'levels' parameter. " ,
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1997 " ,
2004-10-06 13:13:08 +00:00
NULL ,
2001-05-21 13:58:46 +00:00
GIMP_INTERNAL ,
2006-03-28 19:58:00 +00:00
0 , NULL , 0 , NULL ,
1999-04-10 21:51:25 +00:00
{ { posterize_invoker } }
1999-04-09 06:00:11 +00: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 05:39:57 +00:00
2006-03-31 20:16:22 +00:00
static GimpArgument *
2006-03-31 17:42:13 +00:00
desaturate_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
2006-03-31 20:16:22 +00:00
GimpArgument * args )
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 05:39:57 +00:00
{
gboolean success = TRUE ;
GimpDrawable * drawable ;
2006-03-29 23:56:07 +00:00
drawable = ( GimpDrawable * ) gimp_value_get_item ( & args [ 0 ] . value , gimp , GIMP_TYPE_DRAWABLE ) ;
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 05:39:57 +00:00
if ( success )
{
2004-11-16 13:41:55 +00:00
if ( ! gimp_item_is_attached ( GIMP_ITEM ( drawable ) ) | |
! gimp_drawable_is_rgb ( drawable ) )
2004-03-26 16:49:18 +00:00
success = FALSE ;
2004-11-16 13:41:55 +00:00
if ( success )
2005-04-16 14:51:49 +00:00
gimp_drawable_desaturate ( drawable , GIMP_DESATURATE_LIGHTNESS ) ;
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 05:39:57 +00:00
}
2006-03-31 17:42:13 +00:00
return gimp_procedure_get_return_values ( procedure , success ) ;
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 05:39:57 +00:00
}
2006-03-31 17:42:13 +00:00
static GimpProcedure desaturate_proc =
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 05:39:57 +00:00
{
2006-03-31 16:17:07 +00:00
TRUE , TRUE ,
2005-08-02 22:52:23 +00:00
" gimp-desaturate " ,
" gimp-desaturate " ,
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 05:39:57 +00:00
" Desaturate the contents of the specified drawable. " ,
" This procedure desaturates the contents of the specified drawable. This procedure only works on drawables of type RGB color. " ,
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ,
2004-10-06 13:13:08 +00:00
NULL ,
2001-05-21 13:58:46 +00:00
GIMP_INTERNAL ,
2006-03-28 19:58:00 +00:00
0 , NULL , 0 , 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 05:39:57 +00:00
{ { desaturate_invoker } }
} ;
2006-03-31 20:16:22 +00:00
static GimpArgument *
2006-03-31 17:42:13 +00:00
desaturate_full_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
2006-03-31 20:16:22 +00:00
GimpArgument * args )
2005-04-19 20:31:30 +00:00
{
gboolean success = TRUE ;
GimpDrawable * drawable ;
gint32 desaturate_mode ;
2006-03-29 23:56:07 +00:00
drawable = ( GimpDrawable * ) gimp_value_get_item ( & args [ 0 ] . value , gimp , GIMP_TYPE_DRAWABLE ) ;
desaturate_mode = g_value_get_enum ( & args [ 1 ] . value ) ;
2005-04-19 20:31:30 +00:00
if ( success )
{
if ( ! gimp_item_is_attached ( GIMP_ITEM ( drawable ) ) | |
! gimp_drawable_is_rgb ( drawable ) )
success = FALSE ;
if ( success )
2006-03-22 17:19:14 +00:00
gimp_drawable_desaturate ( drawable , desaturate_mode ) ;
2005-04-19 20:31:30 +00:00
}
2006-03-31 17:42:13 +00:00
return gimp_procedure_get_return_values ( procedure , success ) ;
2005-04-19 20:31:30 +00:00
}
2006-03-31 17:42:13 +00:00
static GimpProcedure desaturate_full_proc =
2005-04-19 20:31:30 +00:00
{
2006-03-31 16:17:07 +00:00
TRUE , TRUE ,
2005-08-02 22:52:23 +00:00
" gimp-desaturate-full " ,
" gimp-desaturate-full " ,
2005-04-19 20:31:30 +00:00
" Desaturate the contents of the specified drawable, with the specified formula. " ,
" This procedure desaturates the contents of the specified drawable, with the specified formula. This procedure only works on drawables of type RGB color. " ,
" Karine Delvare " ,
" Karine Delvare " ,
" 2005 " ,
NULL ,
GIMP_INTERNAL ,
2006-03-28 19:58:00 +00:00
0 , NULL , 0 , NULL ,
2005-04-19 20:31:30 +00:00
{ { desaturate_full_invoker } }
} ;
2006-03-31 20:16:22 +00:00
static GimpArgument *
2006-03-31 17:42:13 +00:00
equalize_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
2006-03-31 20:16:22 +00:00
GimpArgument * args )
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 05:39:57 +00:00
{
gboolean success = TRUE ;
GimpDrawable * drawable ;
gboolean mask_only ;
2006-03-29 23:56:07 +00:00
drawable = ( GimpDrawable * ) gimp_value_get_item ( & args [ 0 ] . value , gimp , GIMP_TYPE_DRAWABLE ) ;
mask_only = g_value_get_boolean ( & args [ 1 ] . value ) ;
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 05:39:57 +00:00
if ( success )
{
2004-11-16 13:41:55 +00:00
if ( ! gimp_item_is_attached ( GIMP_ITEM ( drawable ) ) | |
gimp_drawable_is_indexed ( drawable ) )
2004-03-26 16:49:18 +00:00
success = FALSE ;
2004-11-16 13:41:55 +00: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 05:39:57 +00:00
}
2006-03-31 17:42:13 +00:00
return gimp_procedure_get_return_values ( procedure , success ) ;
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 05:39:57 +00:00
}
2006-03-31 17:42:13 +00:00
static GimpProcedure equalize_proc =
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 05:39:57 +00:00
{
2006-03-31 16:17:07 +00:00
TRUE , TRUE ,
2005-08-02 22:52:23 +00:00
" gimp-equalize " ,
" gimp-equalize " ,
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 05:39:57 +00:00
" Equalize the contents of the specified drawable. " ,
" This procedure equalizes the contents of the specified drawable. Each intensity channel is equalizeed independently. The equalized intensity is given as inten' = (255 - inten). Indexed color drawables are not valid for this operation. The 'mask_only' option specifies whether to adjust only the area of the image within the selection bounds, or the entire image based on the histogram of the selected area. If there is no selection, the entire image is adjusted based on the histogram for the entire image. " ,
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ,
2004-10-06 13:13:08 +00:00
NULL ,
2001-05-21 13:58:46 +00:00
GIMP_INTERNAL ,
2006-03-28 19:58:00 +00:00
0 , NULL , 0 , 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 05:39:57 +00:00
{ { equalize_invoker } }
} ;
2006-03-31 20:16:22 +00:00
static GimpArgument *
2006-03-31 17:42:13 +00:00
invert_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
2006-03-31 20:16:22 +00:00
GimpArgument * args )
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 05:39:57 +00:00
{
gboolean success = TRUE ;
GimpDrawable * drawable ;
2006-03-29 23:56:07 +00:00
drawable = ( GimpDrawable * ) gimp_value_get_item ( & args [ 0 ] . value , gimp , GIMP_TYPE_DRAWABLE ) ;
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 05:39:57 +00:00
if ( success )
{
2004-11-16 13:41:55 +00:00
if ( ! gimp_item_is_attached ( GIMP_ITEM ( drawable ) ) | |
gimp_drawable_is_indexed ( drawable ) )
2004-03-26 16:49:18 +00:00
success = FALSE ;
2004-11-16 13:41:55 +00:00
if ( success )
gimp_drawable_invert ( drawable ) ;
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 05:39:57 +00:00
}
2006-03-31 17:42:13 +00:00
return gimp_procedure_get_return_values ( procedure , success ) ;
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 05:39:57 +00:00
}
2006-03-31 17:42:13 +00:00
static GimpProcedure invert_proc =
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 05:39:57 +00:00
{
2006-03-31 16:17:07 +00:00
TRUE , TRUE ,
2005-08-02 22:52:23 +00:00
" gimp-invert " ,
" gimp-invert " ,
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 05:39:57 +00:00
" Invert the contents of the specified drawable. " ,
" This procedure inverts the contents of the specified drawable. Each intensity channel is inverted independently. The inverted intensity is given as inten' = (255 - inten). Indexed color drawables are not valid for this operation. " ,
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ,
2004-10-06 13:13:08 +00:00
NULL ,
2001-05-21 13:58:46 +00:00
GIMP_INTERNAL ,
2006-03-28 19:58:00 +00:00
0 , NULL , 0 , 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 05:39:57 +00:00
{ { invert_invoker } }
} ;
2006-03-31 20:16:22 +00:00
static GimpArgument *
2006-03-31 17:42:13 +00:00
curves_spline_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
2006-03-31 20:16:22 +00:00
GimpArgument * args )
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 05:39:57 +00:00
{
gboolean success = TRUE ;
GimpDrawable * drawable ;
gint32 channel ;
gint32 num_points ;
1999-11-09 00:23:14 +00:00
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 05:39:57 +00:00
2006-03-29 23:56:07 +00:00
drawable = ( GimpDrawable * ) gimp_value_get_item ( & args [ 0 ] . value , gimp , GIMP_TYPE_DRAWABLE ) ;
channel = g_value_get_enum ( & args [ 1 ] . value ) ;
num_points = g_value_get_int ( & args [ 2 ] . value ) ;
2006-04-01 01:33:28 +00:00
control_pts = ( guint8 * ) gimp_value_get_int8array ( & args [ 3 ] . value ) ;
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 05:39:57 +00:00
if ( success )
{
2004-11-16 13:41:55 +00:00
if ( ! gimp_item_is_attached ( GIMP_ITEM ( drawable ) ) | |
gimp_drawable_is_indexed ( drawable ) | | ( num_points & 1 ) | |
2004-03-26 16:49:18 +00: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-26 16:38:44 +00:00
2004-01-13 11:51:45 +00:00
if ( success )
2004-03-26 16:49:18 +00:00
{
2004-10-19 22:52:04 +00:00
gint x , y , width , height ;
2004-03-26 16:38:44 +00:00
2004-10-19 22:52:04 +00:00
/* The application should occur only within selection bounds */
if ( gimp_drawable_mask_intersect ( drawable , & x , & y , & width , & height ) )
{
Curves c ;
gint j ;
PixelRegion srcPR , destPR ;
GimpLut * lut ;
2004-03-26 16:38:44 +00:00
2004-10-19 22:52:04 +00:00
/* FIXME: hack */
if ( gimp_drawable_is_gray ( drawable ) & &
channel = = GIMP_HISTOGRAM_ALPHA )
channel = 1 ;
2004-03-26 16:38:44 +00:00
2004-10-19 22:52:04 +00:00
lut = gimp_lut_new ( ) ;
2004-09-24 13:39:57 +00:00
2004-10-19 22:52:04 +00:00
curves_init ( & c ) ;
2004-03-26 16:38:44 +00:00
2004-10-19 22:52:04 +00:00
/* unset the last point */
c . points [ channel ] [ CURVES_NUM_POINTS - 1 ] [ 0 ] = - 1 ;
c . points [ channel ] [ CURVES_NUM_POINTS - 1 ] [ 1 ] = - 1 ;
2004-03-26 16:38:44 +00:00
2004-10-19 22:52:04 +00:00
for ( j = 0 ; j < num_points / 2 ; j + + )
{
c . points [ channel ] [ j ] [ 0 ] = control_pts [ j * 2 ] ;
c . points [ channel ] [ j ] [ 1 ] = control_pts [ j * 2 + 1 ] ;
}
2004-03-26 16:38:44 +00:00
2004-10-19 22:52:04 +00:00
curves_calculate_curve ( & c , channel ) ;
gimp_lut_setup ( lut ,
( GimpLutFunc ) curves_lut_func ,
& c ,
gimp_drawable_bytes ( drawable ) ) ;
2004-03-26 16:38:44 +00:00
2004-10-19 22:52:04 +00:00
pixel_region_init ( & srcPR , gimp_drawable_data ( drawable ) ,
x , y , width , height , FALSE ) ;
pixel_region_init ( & destPR , gimp_drawable_shadow ( drawable ) ,
x , y , width , height , TRUE ) ;
2004-03-26 16:38:44 +00:00
2005-02-15 15:39:27 +00:00
pixel_regions_process_parallel ( ( PixelProcessorFunc )
gimp_lut_process ,
2005-02-11 17:03:56 +00:00
lut , 2 , & srcPR , & destPR ) ;
2004-03-26 16:38:44 +00:00
2004-10-19 22:52:04 +00:00
gimp_lut_free ( lut ) ;
2004-03-26 16:38:44 +00:00
2004-10-19 22:52:04 +00:00
gimp_drawable_merge_shadow ( drawable , TRUE , _ ( " Curves " ) ) ;
gimp_drawable_update ( drawable , x , y , width , height ) ;
}
2004-03-26 16:49:18 +00: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 05:39:57 +00:00
}
2006-03-31 17:42:13 +00:00
return gimp_procedure_get_return_values ( procedure , success ) ;
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 05:39:57 +00:00
}
2006-03-31 17:42:13 +00:00
static GimpProcedure curves_spline_proc =
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 05:39:57 +00:00
{
2006-03-31 16:17:07 +00:00
TRUE , TRUE ,
2005-08-02 22:52:23 +00:00
" gimp-curves-spline " ,
" gimp-curves-spline " ,
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 05:39:57 +00:00
" Modifies the intensity curve(s) for specified drawable. " ,
" Modifies the intensity mapping for one channel in the specified drawable. The drawable must be either grayscale or RGB, and the channel can be either an intensity component, or the value. The 'control_pts' parameter is an array of integers which define a set of control points which describe a Catmull Rom spline which yields the final intensity curve. Use the 'gimp_curves_explicit' function to explicitly modify intensity levels. " ,
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ,
2004-10-06 13:13:08 +00:00
NULL ,
2001-05-21 13:58:46 +00:00
GIMP_INTERNAL ,
2006-03-28 19:58:00 +00:00
0 , NULL , 0 , 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 05:39:57 +00:00
{ { curves_spline_invoker } }
} ;
2006-03-31 20:16:22 +00:00
static GimpArgument *
2006-03-31 17:42:13 +00:00
curves_explicit_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
2006-03-31 20:16:22 +00:00
GimpArgument * args )
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 05:39:57 +00:00
{
gboolean success = TRUE ;
GimpDrawable * drawable ;
gint32 channel ;
gint32 num_bytes ;
1999-11-09 00:23:14 +00:00
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 05:39:57 +00:00
2006-03-29 23:56:07 +00:00
drawable = ( GimpDrawable * ) gimp_value_get_item ( & args [ 0 ] . value , gimp , GIMP_TYPE_DRAWABLE ) ;
channel = g_value_get_enum ( & args [ 1 ] . value ) ;
num_bytes = g_value_get_int ( & args [ 2 ] . value ) ;
2006-04-01 01:33:28 +00:00
curve = ( guint8 * ) gimp_value_get_int8array ( & args [ 3 ] . value ) ;
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 05:39:57 +00:00
if ( success )
{
2004-11-16 13:41:55 +00:00
if ( ! gimp_item_is_attached ( GIMP_ITEM ( drawable ) ) | |
gimp_drawable_is_indexed ( drawable ) | | ( num_bytes ! = 256 ) | |
2004-03-26 16:49:18 +00: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-26 16:38:44 +00:00
2004-01-13 11:51:45 +00:00
if ( success )
2004-03-26 16:49:18 +00:00
{
2004-10-19 22:52:04 +00:00
gint x , y , width , height ;
/* The application should occur only within selection bounds */
if ( gimp_drawable_mask_intersect ( drawable , & x , & y , & width , & height ) )
{
Curves c ;
gint j ;
PixelRegion srcPR , destPR ;
GimpLut * lut ;
2004-03-26 16:38:44 +00:00
2004-10-19 22:52:04 +00:00
/* FIXME: hack */
if ( gimp_drawable_is_gray ( drawable ) & &
channel = = GIMP_HISTOGRAM_ALPHA )
channel = 1 ;
2004-03-26 16:38:44 +00:00
2004-10-19 22:52:04 +00:00
lut = gimp_lut_new ( ) ;
2004-03-26 16:38:44 +00:00
2004-10-19 22:52:04 +00:00
curves_init ( & c ) ;
2004-03-26 16:38:44 +00:00
2004-10-19 22:52:04 +00:00
for ( j = 0 ; j < 256 ; j + + )
c . curve [ channel ] [ j ] = curve [ j ] ;
2004-03-26 16:38:44 +00:00
2004-10-19 22:52:04 +00:00
gimp_lut_setup ( lut ,
( GimpLutFunc ) curves_lut_func ,
& c ,
gimp_drawable_bytes ( drawable ) ) ;
2004-03-26 16:38:44 +00:00
2004-10-19 22:52:04 +00:00
pixel_region_init ( & srcPR , gimp_drawable_data ( drawable ) ,
x , y , width , height , FALSE ) ;
pixel_region_init ( & destPR , gimp_drawable_shadow ( drawable ) ,
x , y , width , height , TRUE ) ;
2004-03-26 16:38:44 +00:00
2005-02-15 15:39:27 +00:00
pixel_regions_process_parallel ( ( PixelProcessorFunc )
gimp_lut_process ,
2005-02-11 17:03:56 +00:00
lut , 2 , & srcPR , & destPR ) ;
2004-03-26 16:38:44 +00:00
2004-10-19 22:52:04 +00:00
gimp_lut_free ( lut ) ;
2004-03-26 16:38:44 +00:00
2004-10-19 22:52:04 +00:00
gimp_drawable_merge_shadow ( drawable , TRUE , _ ( " Curves " ) ) ;
gimp_drawable_update ( drawable , x , y , width , height ) ;
}
2004-03-26 16:49:18 +00: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 05:39:57 +00:00
}
2006-03-31 17:42:13 +00:00
return gimp_procedure_get_return_values ( procedure , success ) ;
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 05:39:57 +00:00
}
2006-03-31 17:42:13 +00:00
static GimpProcedure curves_explicit_proc =
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 05:39:57 +00:00
{
2006-03-31 16:17:07 +00:00
TRUE , TRUE ,
2005-08-02 22:52:23 +00:00
" gimp-curves-explicit " ,
" gimp-curves-explicit " ,
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 05:39:57 +00:00
" Modifies the intensity curve(s) for specified drawable. " ,
" Modifies the intensity mapping for one channel in the specified drawable. The drawable must be either grayscale or RGB, and the channel can be either an intensity component, or the value. The 'curve' parameter is an array of bytes which explicitly defines how each pixel value in the drawable will be modified. Use the 'gimp_curves_spline' function to modify intensity levels with Catmull Rom splines. " ,
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ,
2004-10-06 13:13:08 +00:00
NULL ,
2001-05-21 13:58:46 +00:00
GIMP_INTERNAL ,
2006-03-28 19:58:00 +00:00
0 , NULL , 0 , 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 05:39:57 +00:00
{ { curves_explicit_invoker } }
} ;
2006-03-31 20:16:22 +00:00
static GimpArgument *
2006-03-31 17:42:13 +00:00
color_balance_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
2006-03-31 20:16:22 +00:00
GimpArgument * args )
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 05:39:57 +00:00
{
gboolean success = TRUE ;
GimpDrawable * drawable ;
gint32 transfer_mode ;
gboolean preserve_lum ;
gdouble cyan_red ;
gdouble magenta_green ;
gdouble yellow_blue ;
2006-03-29 23:56:07 +00:00
drawable = ( GimpDrawable * ) gimp_value_get_item ( & args [ 0 ] . value , gimp , GIMP_TYPE_DRAWABLE ) ;
transfer_mode = g_value_get_enum ( & args [ 1 ] . value ) ;
preserve_lum = g_value_get_boolean ( & args [ 2 ] . value ) ;
cyan_red = g_value_get_double ( & args [ 3 ] . value ) ;
magenta_green = g_value_get_double ( & args [ 4 ] . value ) ;
yellow_blue = g_value_get_double ( & args [ 5 ] . value ) ;
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 05:39:57 +00:00
if ( success )
{
2004-11-16 13:41:55 +00:00
if ( ! gimp_item_is_attached ( GIMP_ITEM ( drawable ) ) | |
gimp_drawable_is_indexed ( drawable ) )
2004-03-26 16:49:18 +00:00
success = FALSE ;
2004-03-26 16:38:44 +00:00
2004-01-13 11:51:45 +00:00
if ( success )
2004-03-26 16:49:18 +00:00
{
2004-10-19 22:52:04 +00:00
gint x , y , width , height ;
2004-03-26 16:38:44 +00:00
2004-10-19 22:52:04 +00:00
/* The application should occur only within selection bounds */
if ( gimp_drawable_mask_intersect ( drawable , & x , & y , & width , & height ) )
{
2005-02-15 15:39:27 +00:00
ColorBalance cb ;
PixelRegion srcPR , destPR ;
2004-03-26 16:38:44 +00:00
2004-10-19 22:52:04 +00:00
color_balance_init ( & cb ) ;
2004-03-26 16:38:44 +00:00
2004-10-19 22:52:04 +00:00
cb . preserve_luminosity = preserve_lum ;
2004-03-26 16:38:44 +00:00
2004-10-19 22:52:04 +00:00
cb . cyan_red [ transfer_mode ] = cyan_red ;
cb . magenta_green [ transfer_mode ] = magenta_green ;
cb . yellow_blue [ transfer_mode ] = yellow_blue ;
2004-03-26 16:38:44 +00:00
2004-10-19 22:52:04 +00:00
color_balance_create_lookup_tables ( & cb ) ;
2004-03-26 16:38:44 +00:00
2004-10-19 22:52:04 +00:00
pixel_region_init ( & srcPR , gimp_drawable_data ( drawable ) ,
x , y , width , height , FALSE ) ;
pixel_region_init ( & destPR , gimp_drawable_shadow ( drawable ) ,
x , y , width , height , TRUE ) ;
2005-02-15 15:39:27 +00:00
pixel_regions_process_parallel ( ( PixelProcessorFunc ) color_balance ,
& cb , 2 , & srcPR , & destPR ) ;
2004-03-26 16:38:44 +00:00
2004-10-19 22:52:04 +00:00
gimp_drawable_merge_shadow ( drawable , TRUE , _ ( " Color Balance " ) ) ;
gimp_drawable_update ( drawable , x , y , width , height ) ;
}
2004-03-26 16:49:18 +00: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 05:39:57 +00:00
}
2006-03-31 17:42:13 +00:00
return gimp_procedure_get_return_values ( procedure , success ) ;
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 05:39:57 +00:00
}
2006-03-31 17:42:13 +00:00
static GimpProcedure color_balance_proc =
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 05:39:57 +00:00
{
2006-03-31 16:17:07 +00:00
TRUE , TRUE ,
2005-08-02 22:52:23 +00:00
" gimp-color-balance " ,
" gimp-color-balance " ,
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 05:39:57 +00:00
" Modify the color balance of the specified drawable. " ,
2006-03-24 21:57:47 +00: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, midtones, and highlights in an image to be affected differently. The 'preserve_lum' parameter, if TRUE, ensures that the luminosity of each pixel remains fixed. " ,
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 05:39:57 +00:00
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1997 " ,
2004-10-06 13:13:08 +00:00
NULL ,
2001-05-21 13:58:46 +00:00
GIMP_INTERNAL ,
2006-03-28 19:58:00 +00:00
0 , NULL , 0 , 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 05:39:57 +00:00
{ { color_balance_invoker } }
} ;
2006-03-31 20:16:22 +00:00
static GimpArgument *
2006-03-31 17:42:13 +00:00
colorize_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
2006-03-31 20:16:22 +00:00
GimpArgument * args )
2004-10-03 12:57:06 +00:00
{
gboolean success = TRUE ;
GimpDrawable * drawable ;
gdouble hue ;
gdouble saturation ;
gdouble lightness ;
2006-03-29 23:56:07 +00:00
drawable = ( GimpDrawable * ) gimp_value_get_item ( & args [ 0 ] . value , gimp , GIMP_TYPE_DRAWABLE ) ;
hue = g_value_get_double ( & args [ 1 ] . value ) ;
saturation = g_value_get_double ( & args [ 2 ] . value ) ;
lightness = g_value_get_double ( & args [ 3 ] . value ) ;
2004-10-03 12:57:06 +00:00
if ( success )
{
2004-11-16 13:41:55 +00:00
if ( ! gimp_item_is_attached ( GIMP_ITEM ( drawable ) ) | |
! gimp_drawable_is_rgb ( drawable ) )
2004-10-03 12:57:06 +00:00
success = FALSE ;
if ( success )
{
2004-10-19 22:52:04 +00:00
gint x , y , width , height ;
2004-10-03 12:57:06 +00:00
2004-10-19 22:52:04 +00:00
/* The application should occur only within selection bounds */
if ( gimp_drawable_mask_intersect ( drawable , & x , & y , & width , & height ) )
{
2005-02-15 15:39:27 +00:00
Colorize colors ;
PixelRegion srcPR , destPR ;
2004-10-03 12:57:06 +00:00
2004-10-19 22:52:04 +00:00
colorize_init ( & colors ) ;
2004-10-03 12:57:06 +00:00
2004-10-19 22:52:04 +00:00
colors . hue = hue ;
colors . saturation = saturation ;
colors . lightness = lightness ;
2004-10-03 12:57:06 +00:00
2004-10-19 22:52:04 +00:00
colorize_calculate ( & colors ) ;
2004-10-03 12:57:06 +00:00
2004-10-19 22:52:04 +00:00
pixel_region_init ( & srcPR , gimp_drawable_data ( drawable ) ,
x , y , width , height , FALSE ) ;
pixel_region_init ( & destPR , gimp_drawable_shadow ( drawable ) ,
x , y , width , height , TRUE ) ;
2005-02-15 15:39:27 +00:00
pixel_regions_process_parallel ( ( PixelProcessorFunc ) colorize ,
& colors , 2 , & srcPR , & destPR ) ;
2004-10-03 12:57:06 +00:00
2004-10-19 22:52:04 +00:00
gimp_drawable_merge_shadow ( drawable , TRUE , _ ( " Colorize " ) ) ;
gimp_drawable_update ( drawable , x , y , width , height ) ;
}
2004-10-03 12:57:06 +00:00
}
}
2006-03-31 17:42:13 +00:00
return gimp_procedure_get_return_values ( procedure , success ) ;
2004-10-03 12:57:06 +00:00
}
2006-03-31 17:42:13 +00:00
static GimpProcedure colorize_proc =
2004-10-03 12:57:06 +00:00
{
2006-03-31 16:17:07 +00:00
TRUE , TRUE ,
2005-08-02 22:52:23 +00:00
" gimp-colorize " ,
" gimp-colorize " ,
2004-10-03 12:57:06 +00:00
" Render the drawable as a grayscale image seen through a colored glass. " ,
" Desatures the drawable, then tints it with the specified color. This tool is only valid on RGB color images. It will not operate on grayscale or indexed drawables. " ,
2006-03-14 21:35:50 +00:00
" Sven Neumann <sven@gimp.org> " ,
" Sven Neumann " ,
2004-10-03 12:57:06 +00:00
" 2004 " ,
2004-10-06 13:13:08 +00:00
NULL ,
2004-10-03 12:57:06 +00:00
GIMP_INTERNAL ,
2006-03-28 19:58:00 +00:00
0 , NULL , 0 , NULL ,
2004-10-03 12:57:06 +00:00
{ { colorize_invoker } }
} ;
2006-03-31 20:16:22 +00:00
static GimpArgument *
2006-03-31 17:42:13 +00:00
histogram_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
2006-03-31 20:16:22 +00:00
GimpArgument * args )
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 05:39:57 +00:00
{
gboolean success = TRUE ;
2006-03-31 20:16:22 +00:00
GimpArgument * 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 05:39:57 +00:00
GimpDrawable * drawable ;
gint32 channel ;
gint32 start_range ;
gint32 end_range ;
2006-03-15 15:32:39 +00: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 05:39:57 +00:00
2006-03-29 23:56:07 +00:00
drawable = ( GimpDrawable * ) gimp_value_get_item ( & args [ 0 ] . value , gimp , GIMP_TYPE_DRAWABLE ) ;
channel = g_value_get_enum ( & args [ 1 ] . value ) ;
start_range = g_value_get_int ( & args [ 2 ] . value ) ;
end_range = g_value_get_int ( & args [ 3 ] . value ) ;
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 05:39:57 +00:00
if ( success )
{
2004-11-16 13:41:55 +00:00
if ( ! gimp_item_is_attached ( GIMP_ITEM ( drawable ) ) | |
gimp_drawable_is_indexed ( drawable ) | |
2004-03-26 16:49:18 +00: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-26 16:38:44 +00:00
2004-01-13 11:51:45 +00:00
if ( success )
2004-03-26 16:49:18 +00:00
{
2005-02-14 01:05:34 +00:00
GimpHistogram * histogram = gimp_histogram_new ( ) ;
2004-03-26 16:49:18 +00:00
gimp_drawable_calculate_histogram ( drawable , histogram ) ;
mean = gimp_histogram_get_mean ( histogram , channel ,
start_range , end_range ) ;
std_dev = gimp_histogram_get_std_dev ( histogram , channel ,
start_range , end_range ) ;
median = gimp_histogram_get_median ( histogram , channel ,
start_range , end_range ) ;
pixels = gimp_histogram_get_count ( histogram , channel , 0 , 255 ) ;
count = gimp_histogram_get_count ( histogram , channel ,
start_range , end_range ) ;
percentile = count / pixels ;
gimp_histogram_free ( histogram ) ;
}
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 05:39:57 +00:00
}
2006-03-31 17:42:13 +00:00
return_vals = gimp_procedure_get_return_values ( procedure , success ) ;
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 05:39:57 +00:00
if ( success )
{
2006-03-29 23:56:07 +00:00
g_value_set_double ( & return_vals [ 1 ] . value , mean ) ;
g_value_set_double ( & return_vals [ 2 ] . value , std_dev ) ;
g_value_set_double ( & return_vals [ 3 ] . value , median ) ;
g_value_set_double ( & return_vals [ 4 ] . value , pixels ) ;
g_value_set_double ( & return_vals [ 5 ] . value , count ) ;
g_value_set_double ( & return_vals [ 6 ] . value , 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 05:39:57 +00:00
}
2006-03-27 21:09:32 +00:00
return 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 05:39:57 +00:00
}
2006-03-31 17:42:13 +00:00
static GimpProcedure histogram_proc =
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 05:39:57 +00:00
{
2006-03-31 16:17:07 +00:00
TRUE , TRUE ,
2005-08-02 22:52:23 +00:00
" gimp-histogram " ,
" gimp-histogram " ,
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 05:39:57 +00:00
" Returns information on the intensity histogram for the specified drawable. " ,
" 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. The drawable may not be indexed. 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. " ,
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1995-1996 " ,
2004-10-06 13:13:08 +00:00
NULL ,
2001-05-21 13:58:46 +00:00
GIMP_INTERNAL ,
2006-03-28 19:58:00 +00:00
0 , NULL , 0 , 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 05:39:57 +00:00
{ { histogram_invoker } }
} ;
2006-03-31 20:16:22 +00:00
static GimpArgument *
2006-03-31 17:42:13 +00:00
hue_saturation_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
2006-03-31 20:16:22 +00:00
GimpArgument * args )
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 05:39:57 +00:00
{
gboolean success = TRUE ;
GimpDrawable * drawable ;
gint32 hue_range ;
gdouble hue_offset ;
gdouble lightness ;
gdouble saturation ;
2006-03-29 23:56:07 +00:00
drawable = ( GimpDrawable * ) gimp_value_get_item ( & args [ 0 ] . value , gimp , GIMP_TYPE_DRAWABLE ) ;
hue_range = g_value_get_enum ( & args [ 1 ] . value ) ;
hue_offset = g_value_get_double ( & args [ 2 ] . value ) ;
lightness = g_value_get_double ( & args [ 3 ] . value ) ;
saturation = g_value_get_double ( & args [ 4 ] . value ) ;
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 05:39:57 +00:00
if ( success )
{
2004-11-16 13:41:55 +00:00
if ( ! gimp_item_is_attached ( GIMP_ITEM ( drawable ) ) | |
gimp_drawable_is_indexed ( drawable ) )
2004-03-26 16:49:18 +00:00
success = FALSE ;
2004-03-26 16:38:44 +00:00
2004-01-13 11:51:45 +00:00
if ( success )
2004-03-26 16:49:18 +00:00
{
2004-10-19 22:52:04 +00:00
gint x , y , width , height ;
2004-03-26 16:49:18 +00:00
2004-10-19 22:52:04 +00:00
/* The application should occur only within selection bounds */
if ( gimp_drawable_mask_intersect ( drawable , & x , & y , & width , & height ) )
{
2005-02-15 15:39:27 +00:00
HueSaturation hs ;
PixelRegion srcPR , destPR ;
2004-03-26 16:49:18 +00:00
2004-10-19 22:52:04 +00:00
hue_saturation_init ( & hs ) ;
2004-03-26 16:49:18 +00:00
2004-10-19 22:52:04 +00:00
hs . hue [ hue_range ] = hue_offset ;
hs . lightness [ hue_range ] = lightness ;
hs . saturation [ hue_range ] = saturation ;
2004-03-26 16:49:18 +00:00
2004-10-19 22:52:04 +00:00
/* Calculate the transfer arrays */
hue_saturation_calculate_transfers ( & hs ) ;
2004-03-26 16:49:18 +00:00
2004-10-19 22:52:04 +00:00
pixel_region_init ( & srcPR , gimp_drawable_data ( drawable ) ,
x , y , width , height , FALSE ) ;
pixel_region_init ( & destPR , gimp_drawable_shadow ( drawable ) ,
x , y , width , height , TRUE ) ;
2005-02-15 15:39:27 +00:00
pixel_regions_process_parallel ( ( PixelProcessorFunc ) hue_saturation ,
& hs , 2 , & srcPR , & destPR ) ;
2004-03-26 16:49:18 +00:00
2004-10-19 22:52:04 +00:00
gimp_drawable_merge_shadow ( drawable , TRUE , _ ( " Hue-Saturation " ) ) ;
gimp_drawable_update ( drawable , x , y , width , height ) ;
}
2004-03-26 16:49:18 +00: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 05:39:57 +00:00
}
2006-03-31 17:42:13 +00:00
return gimp_procedure_get_return_values ( procedure , success ) ;
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 05:39:57 +00:00
}
2006-03-31 17:42:13 +00:00
static GimpProcedure hue_saturation_proc =
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 05:39:57 +00:00
{
2006-03-31 16:17:07 +00:00
TRUE , TRUE ,
2005-08-02 22:52:23 +00:00
" gimp-hue-saturation " ,
" gimp-hue-saturation " ,
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 05:39:57 +00:00
" Modify hue, lightness, and saturation in the specified drawable. " ,
" This procedures allows the hue, lightness, and saturation in the specified drawable to be modified. The 'hue_range' parameter provides the capability to limit range of affected hues. " ,
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
" 1997 " ,
2004-10-06 13:13:08 +00:00
NULL ,
2001-05-21 13:58:46 +00:00
GIMP_INTERNAL ,
2006-03-28 19:58:00 +00:00
0 , NULL , 0 , 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 05:39:57 +00:00
{ { hue_saturation_invoker } }
} ;
2006-03-31 20:16:22 +00:00
static GimpArgument *
2006-03-31 17:42:13 +00:00
threshold_invoker ( GimpProcedure * procedure ,
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
2006-03-31 20:16:22 +00:00
GimpArgument * args )
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 05:39:57 +00:00
{
gboolean success = TRUE ;
GimpDrawable * drawable ;
gint32 low_threshold ;
gint32 high_threshold ;
2006-03-29 23:56:07 +00:00
drawable = ( GimpDrawable * ) gimp_value_get_item ( & args [ 0 ] . value , gimp , GIMP_TYPE_DRAWABLE ) ;
low_threshold = g_value_get_int ( & args [ 1 ] . value ) ;
high_threshold = g_value_get_int ( & args [ 2 ] . value ) ;
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 05:39:57 +00:00
if ( success )
{
2004-11-16 13:41:55 +00:00
if ( ! gimp_item_is_attached ( GIMP_ITEM ( drawable ) ) | |
gimp_drawable_is_indexed ( drawable ) | |
( low_threshold > = high_threshold ) )
2004-03-26 16:49:18 +00:00
success = FALSE ;
2004-03-26 16:38:44 +00:00
2004-01-13 11:51:45 +00:00
if ( success )
2004-03-26 16:49:18 +00:00
{
2004-10-19 22:52:04 +00:00
gint x , y , width , height ;
2004-03-26 16:38:44 +00:00
2004-03-26 16:49:18 +00:00
/* The application should occur only within selection bounds */
2004-10-19 22:52:04 +00:00
if ( gimp_drawable_mask_intersect ( drawable , & x , & y , & width , & height ) )
{
Threshold tr ;
PixelRegion srcPR , destPR ;
tr . color = gimp_drawable_is_rgb ( drawable ) ;
tr . low_threshold = low_threshold ;
tr . high_threshold = high_threshold ;
2004-03-26 16:38:44 +00:00
2004-10-19 22:52:04 +00:00
pixel_region_init ( & srcPR , gimp_drawable_data ( drawable ) ,
x , y , width , height , FALSE ) ;
pixel_region_init ( & destPR , gimp_drawable_shadow ( drawable ) ,
x , y , width , height , TRUE ) ;
2004-03-26 16:38:44 +00:00
2005-02-15 15:39:27 +00:00
pixel_regions_process_parallel ( ( PixelProcessorFunc ) threshold ,
2005-02-11 17:03:56 +00:00
& tr , 2 , & srcPR , & destPR ) ;
2004-03-26 16:38:44 +00:00
2004-10-19 22:52:04 +00:00
gimp_drawable_merge_shadow ( drawable , TRUE , _ ( " Threshold " ) ) ;
gimp_drawable_update ( drawable , x , y , width , height ) ;
}
2004-03-26 16:49:18 +00: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 05:39:57 +00:00
}
2006-03-31 17:42:13 +00:00
return gimp_procedure_get_return_values ( procedure , success ) ;
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 05:39:57 +00:00
}
2006-03-31 17:42:13 +00:00
static GimpProcedure threshold_proc =
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 05:39:57 +00:00
{
2006-03-31 16:17:07 +00:00
TRUE , TRUE ,
2005-08-02 22:52:23 +00:00
" gimp-threshold " ,
" gimp-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 05:39:57 +00:00
" 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 " ,
2004-10-06 13:13:08 +00:00
NULL ,
2001-05-21 13:58:46 +00:00
GIMP_INTERNAL ,
2006-03-28 19:58:00 +00:00
0 , NULL , 0 , 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 05:39:57 +00:00
{ { threshold_invoker } }
} ;