1999-07-01 16:52:50 +00:00
|
|
|
/* The GIMP -- an image manipulation program
|
|
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
2000-12-29 15:22:01 +00:00
|
|
|
|
1999-07-27 00:14:14 +00:00
|
|
|
#include "config.h"
|
app/appenv.h New file. Includes <math.h>. Move G_PI, RINT(), ROUND() etc
1999-09-01 Tor Lillqvist <tml@iki.fi>
* app/appenv.h
* libgimp/gimpmath.h: New file. Includes <math.h>. Move G_PI,
RINT(), ROUND() etc from app/appenv.h here, so plug-ins can
use them, too. Remove some commented-out old stuff in appenv.h.
* libgimp/gimp.h: Include gimpmath.h.
* libgimp/gimp.c (gimp_main): Win32: Don't install signal
handlers, we can't do anything useful in the handler ourselves
anyway (it would be nice to print out a backtrace, but that seems
pretty hard to do, even if not impossible). Let Windows inform the
user about the crash. If the plug-in was compiled with MSVC, and
the user also has it, she is offered a chance to start the
debugger automatically anyway.
* app/*several*.c: Include gimpmath.h for G_PI etc. Don't include
<math.h>, as gimpmath.h includes it.
* plug-ins/*/*many*.c: Include config.h. Don't include <math.h>.
Remove all the duplicated definitions of G_PI and rint(). Use
RINT() instead of rint().
* app/app_procs.[ch]: app_exit() takes a gboolean.
* app/batch.c
* app/commands.c
* app/interface.c: Call app_exit() with FALSE or TRUE.
* app/main.c (on_error): Call gimp_fatal_error. (main): Don't
install any signal handler on Win32 here, either.
* app/errors.c (gimp_fatal_error, gimp_terminate): Win32: Format
the message and call MessageBox with it. g_on_error_query doesn't
do anything useful on Win32, and printf'ing a message to stdout or
stderr doesn't do anything, either, in a windowing application.
1999-09-01 20:30:56 +00:00
|
|
|
|
2000-12-16 21:37:03 +00:00
|
|
|
#include <gtk/gtk.h>
|
2000-01-14 12:41:00 +00:00
|
|
|
#include <gdk/gdkkeysyms.h>
|
app/appenv.h New file. Includes <math.h>. Move G_PI, RINT(), ROUND() etc
1999-09-01 Tor Lillqvist <tml@iki.fi>
* app/appenv.h
* libgimp/gimpmath.h: New file. Includes <math.h>. Move G_PI,
RINT(), ROUND() etc from app/appenv.h here, so plug-ins can
use them, too. Remove some commented-out old stuff in appenv.h.
* libgimp/gimp.h: Include gimpmath.h.
* libgimp/gimp.c (gimp_main): Win32: Don't install signal
handlers, we can't do anything useful in the handler ourselves
anyway (it would be nice to print out a backtrace, but that seems
pretty hard to do, even if not impossible). Let Windows inform the
user about the crash. If the plug-in was compiled with MSVC, and
the user also has it, she is offered a chance to start the
debugger automatically anyway.
* app/*several*.c: Include gimpmath.h for G_PI etc. Don't include
<math.h>, as gimpmath.h includes it.
* plug-ins/*/*many*.c: Include config.h. Don't include <math.h>.
Remove all the duplicated definitions of G_PI and rint(). Use
RINT() instead of rint().
* app/app_procs.[ch]: app_exit() takes a gboolean.
* app/batch.c
* app/commands.c
* app/interface.c: Call app_exit() with FALSE or TRUE.
* app/main.c (on_error): Call gimp_fatal_error. (main): Don't
install any signal handler on Win32 here, either.
* app/errors.c (gimp_fatal_error, gimp_terminate): Win32: Format
the message and call MessageBox with it. g_on_error_query doesn't
do anything useful on Win32, and printf'ing a message to stdout or
stderr doesn't do anything, either, in a windowing application.
1999-09-01 20:30:56 +00:00
|
|
|
|
2001-01-23 23:56:18 +00:00
|
|
|
#include "libgimpmath/gimpmath.h"
|
2001-01-24 22:36:18 +00:00
|
|
|
#include "libgimpwidgets/gimpwidgets.h"
|
2001-01-23 23:56:18 +00:00
|
|
|
|
2001-05-09 22:34:59 +00:00
|
|
|
#include "tools-types.h"
|
2000-12-16 21:37:03 +00:00
|
|
|
|
2001-05-15 11:25:25 +00:00
|
|
|
#include "base/gimplut.h"
|
|
|
|
#include "base/pixel-region.h"
|
|
|
|
#include "base/temp-buf.h"
|
|
|
|
|
2001-04-07 15:58:26 +00:00
|
|
|
#include "paint-funcs/paint-funcs.h"
|
|
|
|
|
2001-07-07 12:17:23 +00:00
|
|
|
#include "core/gimp.h"
|
2001-05-09 02:32:03 +00:00
|
|
|
#include "core/gimpdrawable.h"
|
|
|
|
#include "core/gimpcontext.h"
|
2001-07-07 12:17:23 +00:00
|
|
|
#include "core/gimpimage.h"
|
2001-11-20 23:00:47 +00:00
|
|
|
#include "core/gimptoolinfo.h"
|
2001-05-09 02:32:03 +00:00
|
|
|
|
2001-03-24 02:27:16 +00:00
|
|
|
#include "gimpdodgeburntool.h"
|
2001-01-24 22:36:18 +00:00
|
|
|
#include "paint_options.h"
|
2001-03-24 02:27:16 +00:00
|
|
|
#include "tool_manager.h"
|
1999-07-01 16:52:50 +00:00
|
|
|
|
2001-03-24 02:27:16 +00:00
|
|
|
#include "libgimp/gimpintl.h"
|
2000-04-27 17:27:28 +00:00
|
|
|
|
2001-04-07 15:58:26 +00:00
|
|
|
|
2000-12-31 04:07:42 +00:00
|
|
|
/* Default values */
|
|
|
|
|
|
|
|
#define DODGEBURN_DEFAULT_EXPOSURE 50.0
|
2001-04-07 11:01:22 +00:00
|
|
|
#define DODGEBURN_DEFAULT_TYPE DODGE
|
2001-08-01 02:01:49 +00:00
|
|
|
#define DODGEBURN_DEFAULT_MODE GIMP_HIGHLIGHTS
|
2000-12-31 04:07:42 +00:00
|
|
|
|
1999-07-01 16:52:50 +00:00
|
|
|
/* the dodgeburn structures */
|
|
|
|
|
|
|
|
typedef struct _DodgeBurnOptions DodgeBurnOptions;
|
2000-01-14 12:41:00 +00:00
|
|
|
|
1999-07-01 16:52:50 +00:00
|
|
|
struct _DodgeBurnOptions
|
|
|
|
{
|
2001-08-01 02:01:49 +00:00
|
|
|
PaintOptions paint_options;
|
1999-07-01 16:52:50 +00:00
|
|
|
|
2001-08-01 02:01:49 +00:00
|
|
|
DodgeBurnType type;
|
|
|
|
DodgeBurnType type_d;
|
|
|
|
GtkWidget *type_w[2];
|
1999-07-01 16:52:50 +00:00
|
|
|
|
2001-08-01 02:01:49 +00:00
|
|
|
GimpTransferMode mode; /*highlights, midtones, shadows*/
|
|
|
|
GimpTransferMode mode_d;
|
|
|
|
GtkWidget *mode_w[3];
|
1999-07-01 16:52:50 +00:00
|
|
|
|
2001-08-01 02:01:49 +00:00
|
|
|
gdouble exposure;
|
|
|
|
gdouble exposure_d;
|
|
|
|
GtkObject *exposure_w;
|
1999-07-01 16:52:50 +00:00
|
|
|
|
2001-08-01 02:01:49 +00:00
|
|
|
GimpLut *lut;
|
1999-07-01 16:52:50 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2001-03-31 15:45:05 +00:00
|
|
|
static void gimp_dodgeburn_tool_class_init (GimpDodgeBurnToolClass *klass);
|
|
|
|
static void gimp_dodgeburn_tool_init (GimpDodgeBurnTool *dodgeburn);
|
|
|
|
|
2001-11-08 19:14:51 +00:00
|
|
|
static void gimp_dodgeburn_tool_make_luts (GimpPaintTool *paint_tool,
|
|
|
|
gdouble db_exposure,
|
|
|
|
DodgeBurnType type,
|
|
|
|
GimpTransferMode mode,
|
|
|
|
GimpLut *lut,
|
|
|
|
GimpDrawable *drawable);
|
|
|
|
|
|
|
|
static void gimp_dodgeburn_tool_modifier_key (GimpTool *tool,
|
|
|
|
GdkModifierType key,
|
|
|
|
gboolean press,
|
|
|
|
GdkModifierType state,
|
|
|
|
GimpDisplay *gdisp);
|
|
|
|
static void gimp_dodgeburn_tool_cursor_update (GimpTool *tool,
|
|
|
|
GimpCoords *coords,
|
|
|
|
GdkModifierType state,
|
|
|
|
GimpDisplay *gdisp);
|
|
|
|
|
|
|
|
static void gimp_dodgeburn_tool_paint (GimpPaintTool *paint_tool,
|
|
|
|
GimpDrawable *drawable,
|
|
|
|
PaintState state);
|
2000-12-31 04:07:42 +00:00
|
|
|
|
2001-04-07 11:01:22 +00:00
|
|
|
static void gimp_dodgeburn_tool_motion (GimpPaintTool *paint_tool,
|
|
|
|
GimpDrawable *drawable,
|
|
|
|
PaintPressureOptions *pressure_options,
|
|
|
|
gdouble dodgeburn_exposure,
|
|
|
|
GimpLut *lut);
|
|
|
|
|
2001-03-24 02:27:16 +00:00
|
|
|
static gfloat gimp_dodgeburn_tool_highlights_lut_func (gpointer user_data,
|
2001-12-03 13:44:59 +00:00
|
|
|
gint nchannels,
|
|
|
|
gint channel,
|
2001-03-24 02:27:16 +00:00
|
|
|
gfloat value);
|
|
|
|
static gfloat gimp_dodgeburn_tool_midtones_lut_func (gpointer user_data,
|
2001-12-03 13:44:59 +00:00
|
|
|
gint nchannels,
|
|
|
|
gint channel,
|
2001-03-24 02:27:16 +00:00
|
|
|
gfloat value);
|
|
|
|
static gfloat gimp_dodgeburn_tool_shadows_lut_func (gpointer user_data,
|
2001-12-03 13:44:59 +00:00
|
|
|
gint nchannels,
|
|
|
|
gint channel,
|
2001-03-24 02:27:16 +00:00
|
|
|
gfloat value);
|
|
|
|
|
2001-11-20 23:00:47 +00:00
|
|
|
static GimpToolOptions * gimp_dodgeburn_tool_options_new (GimpToolInfo *tool_info);
|
|
|
|
static void gimp_dodgeburn_tool_options_reset (GimpToolOptions *tool_options);
|
1999-07-01 16:52:50 +00:00
|
|
|
|
|
|
|
|
2001-04-07 11:01:22 +00:00
|
|
|
static gdouble non_gui_exposure;
|
|
|
|
static GimpLut *non_gui_lut;
|
|
|
|
|
2001-03-24 02:27:16 +00:00
|
|
|
static GimpPaintToolClass *parent_class = NULL;
|
1999-07-01 16:52:50 +00:00
|
|
|
|
|
|
|
|
|
|
|
/* functions */
|
|
|
|
|
2001-03-31 15:45:05 +00:00
|
|
|
void
|
2001-11-20 23:00:47 +00:00
|
|
|
gimp_dodgeburn_tool_register (Gimp *gimp,
|
|
|
|
GimpToolRegisterCallback callback)
|
2001-03-31 15:45:05 +00:00
|
|
|
{
|
2001-11-20 23:00:47 +00:00
|
|
|
(* callback) (gimp,
|
|
|
|
GIMP_TYPE_DODGEBURN_TOOL,
|
|
|
|
gimp_dodgeburn_tool_options_new,
|
|
|
|
TRUE,
|
|
|
|
"gimp:dodgeburn_tool",
|
|
|
|
_("Dodge/Burn"),
|
|
|
|
_("Dodge or Burn strokes"),
|
|
|
|
N_("/Tools/Paint Tools/DodgeBurn"), "<shift>D",
|
|
|
|
NULL, "tools/dodgeburn.html",
|
|
|
|
GIMP_STOCK_TOOL_DODGE);
|
2001-03-31 15:45:05 +00:00
|
|
|
}
|
|
|
|
|
2001-08-14 14:53:55 +00:00
|
|
|
GType
|
2001-03-31 15:45:05 +00:00
|
|
|
gimp_dodgeburn_tool_get_type (void)
|
|
|
|
{
|
2001-08-14 14:53:55 +00:00
|
|
|
static GType tool_type = 0;
|
2001-03-31 15:45:05 +00:00
|
|
|
|
|
|
|
if (!tool_type)
|
|
|
|
{
|
2001-08-14 14:53:55 +00:00
|
|
|
static const GTypeInfo tool_info =
|
|
|
|
{
|
|
|
|
sizeof (GimpDodgeBurnToolClass),
|
|
|
|
(GBaseInitFunc) NULL,
|
|
|
|
(GBaseFinalizeFunc) NULL,
|
|
|
|
(GClassInitFunc) gimp_dodgeburn_tool_class_init,
|
|
|
|
NULL, /* class_finalize */
|
|
|
|
NULL, /* class_data */
|
|
|
|
sizeof (GimpDodgeBurnTool),
|
|
|
|
0, /* n_preallocs */
|
|
|
|
(GInstanceInitFunc) gimp_dodgeburn_tool_init,
|
|
|
|
};
|
|
|
|
|
|
|
|
tool_type = g_type_register_static (GIMP_TYPE_PAINT_TOOL,
|
|
|
|
"GimpDodgeBurnTool",
|
|
|
|
&tool_info, 0);
|
2001-03-31 15:45:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return tool_type;
|
|
|
|
}
|
|
|
|
|
1999-07-01 16:52:50 +00:00
|
|
|
static void
|
2001-03-24 02:27:16 +00:00
|
|
|
gimp_dodgeburn_tool_class_init (GimpDodgeBurnToolClass *klass)
|
|
|
|
{
|
2001-03-31 15:45:05 +00:00
|
|
|
GimpToolClass *tool_class;
|
|
|
|
GimpPaintToolClass *paint_tool_class;
|
2001-03-24 02:27:16 +00:00
|
|
|
|
2001-08-14 14:53:55 +00:00
|
|
|
tool_class = GIMP_TOOL_CLASS (klass);
|
|
|
|
paint_tool_class = GIMP_PAINT_TOOL_CLASS (klass);
|
2001-03-24 02:27:16 +00:00
|
|
|
|
2001-08-14 14:53:55 +00:00
|
|
|
parent_class = g_type_class_peek_parent (klass);
|
2001-03-24 02:27:16 +00:00
|
|
|
|
2001-03-31 15:45:05 +00:00
|
|
|
tool_class->modifier_key = gimp_dodgeburn_tool_modifier_key;
|
|
|
|
tool_class->cursor_update = gimp_dodgeburn_tool_cursor_update;
|
2001-03-24 02:27:16 +00:00
|
|
|
|
2001-03-31 15:45:05 +00:00
|
|
|
paint_tool_class->paint = gimp_dodgeburn_tool_paint;
|
|
|
|
}
|
2001-03-24 02:27:16 +00:00
|
|
|
|
|
|
|
static void
|
2001-03-31 15:45:05 +00:00
|
|
|
gimp_dodgeburn_tool_init (GimpDodgeBurnTool *dodgeburn)
|
1999-07-01 16:52:50 +00:00
|
|
|
{
|
2001-03-24 02:27:16 +00:00
|
|
|
GimpTool *tool;
|
|
|
|
GimpPaintTool *paint_tool;
|
|
|
|
|
2002-02-04 17:43:01 +00:00
|
|
|
tool = GIMP_TOOL (dodgeburn);
|
2001-03-24 02:27:16 +00:00
|
|
|
paint_tool = GIMP_PAINT_TOOL (dodgeburn);
|
|
|
|
|
2002-02-04 17:43:01 +00:00
|
|
|
tool->tool_cursor = GIMP_DODGE_TOOL_CURSOR;
|
|
|
|
tool->toggle_tool_cursor = GIMP_BURN_TOOL_CURSOR;
|
2001-03-31 15:45:05 +00:00
|
|
|
|
2001-03-24 02:27:16 +00:00
|
|
|
paint_tool->flags |= TOOL_CAN_HANDLE_CHANGING_BRUSH;
|
1999-07-01 16:52:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2001-08-01 02:01:49 +00:00
|
|
|
gimp_dodgeburn_tool_make_luts (GimpPaintTool *paint_tool,
|
|
|
|
gdouble db_exposure,
|
|
|
|
DodgeBurnType type,
|
|
|
|
GimpTransferMode mode,
|
|
|
|
GimpLut *lut,
|
|
|
|
GimpDrawable *drawable)
|
1999-07-01 16:52:50 +00:00
|
|
|
{
|
2000-12-31 04:07:42 +00:00
|
|
|
GimpLutFunc lut_func;
|
|
|
|
gint nchannels = gimp_drawable_bytes (drawable);
|
1999-07-19 22:42:49 +00:00
|
|
|
static gfloat exposure;
|
|
|
|
|
2000-12-31 04:07:42 +00:00
|
|
|
exposure = db_exposure / 100.0;
|
1999-07-01 16:52:50 +00:00
|
|
|
|
|
|
|
/* make the exposure negative if burn for luts*/
|
1999-07-19 22:42:49 +00:00
|
|
|
if (type == BURN)
|
2001-04-07 11:01:22 +00:00
|
|
|
exposure = -exposure;
|
1999-07-01 16:52:50 +00:00
|
|
|
|
1999-07-19 22:42:49 +00:00
|
|
|
switch (mode)
|
1999-07-01 16:52:50 +00:00
|
|
|
{
|
2001-08-01 02:01:49 +00:00
|
|
|
case GIMP_HIGHLIGHTS:
|
2001-03-24 02:27:16 +00:00
|
|
|
lut_func = gimp_dodgeburn_tool_highlights_lut_func;
|
1999-07-01 16:52:50 +00:00
|
|
|
break;
|
2001-08-01 02:01:49 +00:00
|
|
|
case GIMP_MIDTONES:
|
2001-03-24 02:27:16 +00:00
|
|
|
lut_func = gimp_dodgeburn_tool_midtones_lut_func;
|
1999-07-01 16:52:50 +00:00
|
|
|
break;
|
2001-08-01 02:01:49 +00:00
|
|
|
case GIMP_SHADOWS:
|
2001-03-24 02:27:16 +00:00
|
|
|
lut_func = gimp_dodgeburn_tool_shadows_lut_func;
|
1999-07-01 16:52:50 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
lut_func = NULL;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2000-12-31 04:07:42 +00:00
|
|
|
gimp_lut_setup_exact (lut,
|
|
|
|
lut_func, (gpointer) &exposure,
|
|
|
|
nchannels);
|
1999-07-01 16:52:50 +00:00
|
|
|
}
|
2001-03-31 15:45:05 +00:00
|
|
|
|
1999-07-01 16:52:50 +00:00
|
|
|
static void
|
2001-11-08 19:14:51 +00:00
|
|
|
gimp_dodgeburn_tool_modifier_key (GimpTool *tool,
|
|
|
|
GdkModifierType key,
|
|
|
|
gboolean press,
|
|
|
|
GdkModifierType state,
|
|
|
|
GimpDisplay *gdisp)
|
1999-07-01 16:52:50 +00:00
|
|
|
{
|
2001-11-20 23:00:47 +00:00
|
|
|
DodgeBurnOptions *options;
|
|
|
|
|
|
|
|
options = (DodgeBurnOptions *) tool->tool_info->tool_options;
|
|
|
|
|
2001-11-08 19:14:51 +00:00
|
|
|
if (key == GDK_CONTROL_MASK &&
|
|
|
|
! (state & GDK_SHIFT_MASK)) /* leave stuff untouched in line draw mode */
|
1999-07-01 16:52:50 +00:00
|
|
|
{
|
2001-11-20 23:00:47 +00:00
|
|
|
switch (options->type)
|
2001-11-08 19:14:51 +00:00
|
|
|
{
|
|
|
|
case DODGE:
|
2001-11-22 17:11:52 +00:00
|
|
|
gimp_radio_group_set_active (GTK_RADIO_BUTTON (options->type_w[0]),
|
|
|
|
GINT_TO_POINTER (BURN));
|
2001-11-08 19:14:51 +00:00
|
|
|
break;
|
|
|
|
case BURN:
|
2001-11-22 17:11:52 +00:00
|
|
|
gimp_radio_group_set_active (GTK_RADIO_BUTTON (options->type_w[0]),
|
|
|
|
GINT_TO_POINTER (DODGE));
|
2001-11-08 19:14:51 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
1999-07-01 16:52:50 +00:00
|
|
|
}
|
2000-06-14 14:22:47 +00:00
|
|
|
|
2001-11-20 23:00:47 +00:00
|
|
|
tool->toggled = (options->type == BURN);
|
1999-07-01 16:52:50 +00:00
|
|
|
}
|
|
|
|
|
2000-07-29 16:12:40 +00:00
|
|
|
static void
|
2001-11-08 19:14:51 +00:00
|
|
|
gimp_dodgeburn_tool_cursor_update (GimpTool *tool,
|
|
|
|
GimpCoords *coords,
|
|
|
|
GdkModifierType state,
|
|
|
|
GimpDisplay *gdisp)
|
2000-07-29 16:12:40 +00:00
|
|
|
{
|
2001-11-20 23:00:47 +00:00
|
|
|
DodgeBurnOptions *options;
|
|
|
|
|
|
|
|
options = (DodgeBurnOptions *) tool->tool_info->tool_options;
|
|
|
|
|
|
|
|
tool->toggled = (options->type == BURN);
|
2000-07-29 16:12:40 +00:00
|
|
|
|
2001-11-08 19:14:51 +00:00
|
|
|
GIMP_TOOL_CLASS (parent_class)->cursor_update (tool, coords, state, gdisp);
|
1999-07-01 16:52:50 +00:00
|
|
|
}
|
|
|
|
|
2001-04-07 11:01:22 +00:00
|
|
|
static void
|
|
|
|
gimp_dodgeburn_tool_paint (GimpPaintTool *paint_tool,
|
|
|
|
GimpDrawable *drawable,
|
|
|
|
PaintState state)
|
|
|
|
{
|
2001-11-20 23:00:47 +00:00
|
|
|
DodgeBurnOptions *options;
|
2001-04-07 11:01:22 +00:00
|
|
|
PaintPressureOptions *pressure_options;
|
|
|
|
gdouble exposure;
|
|
|
|
GimpLut *lut;
|
|
|
|
|
2001-11-20 23:00:47 +00:00
|
|
|
options = (DodgeBurnOptions *) GIMP_TOOL (paint_tool)->tool_info->tool_options;
|
|
|
|
|
|
|
|
if (options)
|
2001-04-07 11:01:22 +00:00
|
|
|
{
|
2001-11-20 23:00:47 +00:00
|
|
|
pressure_options = options->paint_options.pressure_options;
|
|
|
|
exposure = options->exposure;
|
|
|
|
lut = options->lut;
|
2001-04-07 11:01:22 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
pressure_options = &non_gui_pressure_options;
|
|
|
|
exposure = non_gui_exposure;
|
|
|
|
lut = non_gui_lut;
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (state)
|
|
|
|
{
|
|
|
|
case INIT_PAINT:
|
2001-11-20 23:00:47 +00:00
|
|
|
if (options)
|
2001-04-07 11:01:22 +00:00
|
|
|
{
|
2001-11-20 23:00:47 +00:00
|
|
|
options->lut = gimp_lut_new ();
|
|
|
|
|
2001-04-07 11:01:22 +00:00
|
|
|
gimp_dodgeburn_tool_make_luts (paint_tool,
|
2001-11-20 23:00:47 +00:00
|
|
|
options->exposure,
|
|
|
|
options->type,
|
|
|
|
options->mode,
|
|
|
|
options->lut,
|
2001-04-07 11:01:22 +00:00
|
|
|
drawable);
|
|
|
|
|
2001-11-20 23:00:47 +00:00
|
|
|
lut = options->lut;
|
2001-04-07 11:01:22 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case MOTION_PAINT:
|
|
|
|
gimp_dodgeburn_tool_motion (paint_tool,
|
|
|
|
drawable,
|
|
|
|
pressure_options,
|
|
|
|
exposure,
|
|
|
|
lut);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FINISH_PAINT:
|
2001-11-20 23:00:47 +00:00
|
|
|
if (options && options->lut)
|
2001-04-07 11:01:22 +00:00
|
|
|
{
|
2001-11-20 23:00:47 +00:00
|
|
|
gimp_lut_free (options->lut);
|
|
|
|
options->lut = NULL;
|
2001-04-07 11:01:22 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1999-07-01 16:52:50 +00:00
|
|
|
static void
|
2001-03-31 15:45:05 +00:00
|
|
|
gimp_dodgeburn_tool_motion (GimpPaintTool *paint_tool,
|
2001-04-07 11:01:22 +00:00
|
|
|
GimpDrawable *drawable,
|
2001-03-24 02:27:16 +00:00
|
|
|
PaintPressureOptions *pressure_options,
|
|
|
|
double dodgeburn_exposure,
|
2001-04-07 11:01:22 +00:00
|
|
|
GimpLut *lut)
|
1999-07-01 16:52:50 +00:00
|
|
|
{
|
2001-03-24 02:27:16 +00:00
|
|
|
GimpImage *gimage;
|
|
|
|
TempBuf *area;
|
|
|
|
TempBuf *orig;
|
|
|
|
PixelRegion srcPR, destPR, tempPR;
|
|
|
|
guchar *temp_data;
|
|
|
|
gint opacity;
|
|
|
|
gdouble scale;
|
1999-07-01 16:52:50 +00:00
|
|
|
|
2001-01-14 21:11:52 +00:00
|
|
|
if (! (gimage = gimp_drawable_gimage (drawable)))
|
1999-07-01 16:52:50 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
/* If the image type is indexed, don't dodgeburn */
|
2001-12-11 18:11:56 +00:00
|
|
|
if ((gimp_drawable_type (drawable) == GIMP_INDEXED_IMAGE) ||
|
|
|
|
(gimp_drawable_type (drawable) == GIMP_INDEXEDA_IMAGE))
|
1999-07-01 16:52:50 +00:00
|
|
|
return;
|
|
|
|
|
1999-09-09 01:47:54 +00:00
|
|
|
if (pressure_options->size)
|
2001-11-13 16:21:34 +00:00
|
|
|
scale = paint_tool->cur_coords.pressure;
|
1999-09-09 01:47:54 +00:00
|
|
|
else
|
|
|
|
scale = 1.0;
|
|
|
|
|
1999-07-01 16:52:50 +00:00
|
|
|
/* Get a region which can be used to paint to */
|
2001-03-24 02:27:16 +00:00
|
|
|
if (! (area = gimp_paint_tool_get_paint_area (paint_tool, drawable, scale)))
|
1999-07-01 16:52:50 +00:00
|
|
|
return;
|
|
|
|
|
2001-03-31 15:45:05 +00:00
|
|
|
/* Constant painting --get a copy of the orig drawable (with no
|
|
|
|
* paint from this stroke yet)
|
|
|
|
*/
|
1999-07-01 16:52:50 +00:00
|
|
|
{
|
2000-12-31 04:07:42 +00:00
|
|
|
gint x1, y1, x2, y2;
|
|
|
|
|
2001-01-14 21:11:52 +00:00
|
|
|
x1 = CLAMP (area->x, 0, gimp_drawable_width (drawable));
|
|
|
|
y1 = CLAMP (area->y, 0, gimp_drawable_height (drawable));
|
|
|
|
x2 = CLAMP (area->x + area->width, 0, gimp_drawable_width (drawable));
|
|
|
|
y2 = CLAMP (area->y + area->height, 0, gimp_drawable_height (drawable));
|
2000-12-31 04:07:42 +00:00
|
|
|
|
|
|
|
if (!(x2 - x1) || !(y2 - y1))
|
|
|
|
return;
|
|
|
|
|
|
|
|
/* get the original untouched image */
|
2001-03-24 02:27:16 +00:00
|
|
|
orig = gimp_paint_tool_get_orig_image (paint_tool, drawable, x1, y1, x2, y2);
|
2000-12-31 04:07:42 +00:00
|
|
|
srcPR.bytes = orig->bytes;
|
|
|
|
srcPR.x = 0;
|
|
|
|
srcPR.y = 0;
|
|
|
|
srcPR.w = x2 - x1;
|
|
|
|
srcPR.h = y2 - y1;
|
|
|
|
srcPR.rowstride = srcPR.bytes * orig->width;
|
|
|
|
srcPR.data = temp_buf_data (orig);
|
|
|
|
}
|
1999-07-01 16:52:50 +00:00
|
|
|
|
|
|
|
/* tempPR will hold the dodgeburned region*/
|
|
|
|
tempPR.bytes = srcPR.bytes;
|
|
|
|
tempPR.x = srcPR.x;
|
|
|
|
tempPR.y = srcPR.y;
|
|
|
|
tempPR.w = srcPR.w;
|
|
|
|
tempPR.h = srcPR.h;
|
|
|
|
tempPR.rowstride = tempPR.bytes * tempPR.w;
|
|
|
|
temp_data = g_malloc (tempPR.h * tempPR.rowstride);
|
|
|
|
tempPR.data = temp_data;
|
|
|
|
|
|
|
|
/* DodgeBurn the region */
|
1999-07-19 22:42:49 +00:00
|
|
|
gimp_lut_process (lut, &srcPR, &tempPR);
|
1999-07-01 16:52:50 +00:00
|
|
|
|
|
|
|
/* The dest is the paint area we got above (= canvas_buf) */
|
|
|
|
destPR.bytes = area->bytes;
|
|
|
|
destPR.x = 0; destPR.y = 0;
|
|
|
|
destPR.w = area->width;
|
|
|
|
destPR.h = area->height;
|
|
|
|
destPR.rowstride = area->width * destPR.bytes;
|
|
|
|
destPR.data = temp_buf_data (area);
|
|
|
|
|
|
|
|
/* Now add an alpha to the dodgeburned region
|
|
|
|
and put this in area = canvas_buf */
|
2001-01-14 21:11:52 +00:00
|
|
|
if (! gimp_drawable_has_alpha (drawable))
|
1999-07-01 16:52:50 +00:00
|
|
|
add_alpha_region (&tempPR, &destPR);
|
|
|
|
else
|
1999-11-13 01:02:27 +00:00
|
|
|
copy_region (&tempPR, &destPR);
|
1999-07-01 16:52:50 +00:00
|
|
|
|
2001-07-07 12:17:23 +00:00
|
|
|
opacity =
|
|
|
|
255 * gimp_context_get_opacity (gimp_get_current_context (gimage->gimp));
|
|
|
|
|
1999-09-09 01:47:54 +00:00
|
|
|
if (pressure_options->opacity)
|
2001-11-13 16:21:34 +00:00
|
|
|
opacity = opacity * 2.0 * paint_tool->cur_coords.pressure;
|
1999-09-09 01:47:54 +00:00
|
|
|
|
1999-11-13 01:02:27 +00:00
|
|
|
/* Replace the newly dodgedburned area (canvas_buf) to the gimage*/
|
2001-03-24 02:27:16 +00:00
|
|
|
gimp_paint_tool_replace_canvas (paint_tool, drawable,
|
|
|
|
MIN (opacity, 255),
|
|
|
|
OPAQUE_OPACITY,
|
|
|
|
pressure_options->pressure ? PRESSURE : SOFT,
|
|
|
|
scale, CONSTANT);
|
1999-07-01 16:52:50 +00:00
|
|
|
|
|
|
|
g_free (temp_data);
|
|
|
|
}
|
|
|
|
|
2001-04-07 11:01:22 +00:00
|
|
|
static gfloat
|
|
|
|
gimp_dodgeburn_tool_highlights_lut_func (gpointer user_data,
|
2001-12-03 13:44:59 +00:00
|
|
|
gint nchannels,
|
|
|
|
gint channel,
|
2001-04-07 11:01:22 +00:00
|
|
|
gfloat value)
|
|
|
|
{
|
|
|
|
gfloat *exposure_ptr = (gfloat *) user_data;
|
|
|
|
gfloat exposure = *exposure_ptr;
|
|
|
|
gfloat factor = 1.0 + exposure * (.333333);
|
|
|
|
|
|
|
|
if ((nchannels == 2 && channel == 1) ||
|
|
|
|
(nchannels == 4 && channel == 3))
|
|
|
|
return value;
|
|
|
|
|
|
|
|
return factor * value;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gfloat
|
|
|
|
gimp_dodgeburn_tool_midtones_lut_func (gpointer user_data,
|
2001-12-03 13:44:59 +00:00
|
|
|
gint nchannels,
|
|
|
|
gint channel,
|
2001-04-07 11:01:22 +00:00
|
|
|
gfloat value)
|
|
|
|
{
|
|
|
|
gfloat *exposure_ptr = (gfloat *) user_data;
|
|
|
|
gfloat exposure = *exposure_ptr;
|
|
|
|
gfloat factor;
|
|
|
|
|
|
|
|
if ((nchannels == 2 && channel == 1) ||
|
|
|
|
(nchannels == 4 && channel == 3))
|
|
|
|
return value;
|
|
|
|
|
|
|
|
if (exposure < 0)
|
|
|
|
factor = 1.0 - exposure * (.333333);
|
|
|
|
else
|
|
|
|
factor = 1/(1.0 + exposure);
|
1999-07-01 16:52:50 +00:00
|
|
|
|
2001-04-07 11:01:22 +00:00
|
|
|
return pow (value, factor);
|
|
|
|
}
|
2001-03-24 02:27:16 +00:00
|
|
|
|
2001-04-07 11:01:22 +00:00
|
|
|
static gfloat
|
|
|
|
gimp_dodgeburn_tool_shadows_lut_func (gpointer user_data,
|
2001-12-03 13:44:59 +00:00
|
|
|
gint nchannels,
|
|
|
|
gint channel,
|
2001-04-07 11:01:22 +00:00
|
|
|
gfloat value)
|
2001-03-31 15:45:05 +00:00
|
|
|
{
|
2001-04-07 11:01:22 +00:00
|
|
|
gfloat *exposure_ptr = (gfloat *) user_data;
|
|
|
|
gfloat exposure = *exposure_ptr;
|
|
|
|
gfloat new_value;
|
|
|
|
gfloat factor;
|
|
|
|
|
|
|
|
if ((nchannels == 2 && channel == 1) ||
|
|
|
|
(nchannels == 4 && channel == 3))
|
|
|
|
return value;
|
|
|
|
|
|
|
|
if (exposure >= 0)
|
|
|
|
{
|
|
|
|
factor = 0.333333 * exposure;
|
|
|
|
new_value = factor + value - factor * value;
|
|
|
|
}
|
|
|
|
else /* exposure < 0 */
|
|
|
|
{
|
|
|
|
factor = -0.333333 * exposure;
|
|
|
|
if (value < factor)
|
|
|
|
new_value = 0;
|
|
|
|
else /*factor <= value <=1*/
|
|
|
|
new_value = (value - factor)/(1 - factor);
|
|
|
|
}
|
2001-03-31 15:45:05 +00:00
|
|
|
|
2001-04-07 11:01:22 +00:00
|
|
|
return new_value;
|
2001-03-31 15:45:05 +00:00
|
|
|
}
|
1999-07-01 16:52:50 +00:00
|
|
|
|
2001-04-07 11:01:22 +00:00
|
|
|
|
|
|
|
/* non-gui stuff */
|
|
|
|
|
1999-07-19 22:42:49 +00:00
|
|
|
gboolean
|
2001-03-24 02:27:16 +00:00
|
|
|
gimp_dodgeburn_tool_non_gui_default (GimpDrawable *drawable,
|
|
|
|
gint num_strokes,
|
|
|
|
gdouble *stroke_array)
|
1999-07-19 22:42:49 +00:00
|
|
|
{
|
2001-11-20 23:00:47 +00:00
|
|
|
GimpToolInfo *tool_info;
|
|
|
|
DodgeBurnOptions *options;
|
2001-04-07 11:01:22 +00:00
|
|
|
gdouble exposure = DODGEBURN_DEFAULT_EXPOSURE;
|
2000-12-31 04:07:42 +00:00
|
|
|
DodgeBurnType type = DODGEBURN_DEFAULT_TYPE;
|
2001-08-01 02:01:49 +00:00
|
|
|
GimpTransferMode mode = DODGEBURN_DEFAULT_MODE;
|
2001-11-20 23:00:47 +00:00
|
|
|
|
|
|
|
tool_info = tool_manager_get_info_by_type (drawable->gimage->gimp,
|
|
|
|
GIMP_TYPE_DODGEBURN_TOOL);
|
|
|
|
|
|
|
|
options = (DodgeBurnOptions *) tool_info->tool_options;
|
1999-07-19 22:42:49 +00:00
|
|
|
|
2000-04-27 17:27:28 +00:00
|
|
|
if (options)
|
1999-07-19 22:42:49 +00:00
|
|
|
{
|
2001-11-20 23:00:47 +00:00
|
|
|
exposure = options->exposure;
|
|
|
|
type = options->type;
|
|
|
|
mode = options->mode;
|
1999-07-19 22:42:49 +00:00
|
|
|
}
|
|
|
|
|
2001-03-24 02:27:16 +00:00
|
|
|
return gimp_dodgeburn_tool_non_gui (drawable, exposure, type, mode,
|
|
|
|
num_strokes, stroke_array);
|
1999-07-19 22:42:49 +00:00
|
|
|
}
|
|
|
|
|
1999-07-01 16:52:50 +00:00
|
|
|
gboolean
|
2001-08-01 02:01:49 +00:00
|
|
|
gimp_dodgeburn_tool_non_gui (GimpDrawable *drawable,
|
|
|
|
gdouble exposure,
|
|
|
|
DodgeBurnType type,
|
|
|
|
GimpTransferMode mode,
|
|
|
|
gint num_strokes,
|
|
|
|
gdouble *stroke_array)
|
1999-07-01 16:52:50 +00:00
|
|
|
{
|
2001-04-07 11:01:22 +00:00
|
|
|
static GimpDodgeBurnTool *non_gui_dodgeburn = NULL;
|
|
|
|
|
2001-03-24 02:27:16 +00:00
|
|
|
GimpPaintTool *paint_tool;
|
2001-04-07 11:01:22 +00:00
|
|
|
gint i;
|
1999-07-01 16:52:50 +00:00
|
|
|
|
2001-03-24 02:27:16 +00:00
|
|
|
if (! non_gui_dodgeburn)
|
|
|
|
{
|
2001-08-10 14:41:39 +00:00
|
|
|
non_gui_dodgeburn = g_object_new (GIMP_TYPE_DODGEBURN_TOOL, NULL);
|
2001-03-24 02:27:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
paint_tool = GIMP_PAINT_TOOL (non_gui_dodgeburn);
|
|
|
|
|
2001-04-07 11:01:22 +00:00
|
|
|
if (gimp_paint_tool_start (paint_tool, drawable,
|
|
|
|
stroke_array[0],
|
|
|
|
stroke_array[1]))
|
1999-07-01 16:52:50 +00:00
|
|
|
{
|
1999-07-19 22:42:49 +00:00
|
|
|
non_gui_exposure = exposure;
|
2001-04-07 11:01:22 +00:00
|
|
|
non_gui_lut = gimp_lut_new ();
|
2001-03-24 02:27:16 +00:00
|
|
|
gimp_dodgeburn_tool_make_luts (paint_tool,
|
|
|
|
exposure,
|
|
|
|
type,
|
|
|
|
mode,
|
|
|
|
non_gui_lut,
|
|
|
|
drawable);
|
1999-07-19 22:42:49 +00:00
|
|
|
|
2001-11-13 16:21:34 +00:00
|
|
|
paint_tool->start_coords.x = paint_tool->last_coords.x = stroke_array[0];
|
|
|
|
paint_tool->start_coords.y = paint_tool->last_coords.y = stroke_array[1];
|
1999-07-01 16:52:50 +00:00
|
|
|
|
2001-04-07 11:01:22 +00:00
|
|
|
gimp_dodgeburn_tool_paint (paint_tool, drawable, MOTION_PAINT);
|
1999-07-01 16:52:50 +00:00
|
|
|
|
|
|
|
for (i = 1; i < num_strokes; i++)
|
|
|
|
{
|
2001-11-13 16:21:34 +00:00
|
|
|
paint_tool->cur_coords.x = stroke_array[i * 2 + 0];
|
|
|
|
paint_tool->cur_coords.y = stroke_array[i * 2 + 1];
|
1999-07-01 16:52:50 +00:00
|
|
|
|
2001-03-24 02:27:16 +00:00
|
|
|
gimp_paint_tool_interpolate (paint_tool, drawable);
|
1999-07-01 16:52:50 +00:00
|
|
|
|
2001-11-13 16:21:34 +00:00
|
|
|
paint_tool->last_coords.x = paint_tool->cur_coords.x;
|
|
|
|
paint_tool->last_coords.y = paint_tool->cur_coords.y;
|
1999-07-01 16:52:50 +00:00
|
|
|
}
|
|
|
|
|
2001-04-07 11:01:22 +00:00
|
|
|
gimp_paint_tool_finish (paint_tool, drawable);
|
|
|
|
|
1999-07-19 22:42:49 +00:00
|
|
|
gimp_lut_free (non_gui_lut);
|
2001-04-07 11:01:22 +00:00
|
|
|
non_gui_lut = NULL;
|
1999-07-19 22:42:49 +00:00
|
|
|
|
1999-07-01 16:52:50 +00:00
|
|
|
return TRUE;
|
|
|
|
}
|
2001-04-07 11:01:22 +00:00
|
|
|
|
|
|
|
return FALSE;
|
1999-07-01 16:52:50 +00:00
|
|
|
}
|
|
|
|
|
2001-03-24 02:27:16 +00:00
|
|
|
|
2001-04-07 11:01:22 +00:00
|
|
|
/* tool options stuff */
|
|
|
|
|
2001-11-20 23:00:47 +00:00
|
|
|
static GimpToolOptions *
|
|
|
|
gimp_dodgeburn_tool_options_new (GimpToolInfo *tool_info)
|
1999-07-01 16:52:50 +00:00
|
|
|
{
|
2001-04-07 11:01:22 +00:00
|
|
|
DodgeBurnOptions *options;
|
2000-12-31 04:07:42 +00:00
|
|
|
|
2001-04-07 11:01:22 +00:00
|
|
|
GtkWidget *vbox;
|
|
|
|
GtkWidget *hbox;
|
|
|
|
GtkWidget *label;
|
|
|
|
GtkWidget *scale;
|
|
|
|
GtkWidget *frame;
|
1999-07-01 16:52:50 +00:00
|
|
|
|
2001-04-07 11:01:22 +00:00
|
|
|
options = g_new0 (DodgeBurnOptions, 1);
|
2001-11-08 19:14:51 +00:00
|
|
|
|
2001-11-20 23:00:47 +00:00
|
|
|
paint_options_init ((PaintOptions *) options, tool_info);
|
|
|
|
|
|
|
|
((GimpToolOptions *) options)->reset_func = gimp_dodgeburn_tool_options_reset;
|
1999-07-01 16:52:50 +00:00
|
|
|
|
2001-04-07 11:01:22 +00:00
|
|
|
options->type = options->type_d = DODGEBURN_DEFAULT_TYPE;
|
|
|
|
options->exposure = options->exposure_d = DODGEBURN_DEFAULT_EXPOSURE;
|
|
|
|
options->mode = options->mode_d = DODGEBURN_DEFAULT_MODE;
|
2001-11-08 19:14:51 +00:00
|
|
|
options->lut = NULL;
|
1999-07-01 16:52:50 +00:00
|
|
|
|
2001-04-07 11:01:22 +00:00
|
|
|
/* the main vbox */
|
2001-07-17 20:50:01 +00:00
|
|
|
vbox = ((GimpToolOptions *) options)->main_vbox;
|
1999-07-01 16:52:50 +00:00
|
|
|
|
2001-04-07 11:01:22 +00:00
|
|
|
/* the exposure scale */
|
|
|
|
hbox = gtk_hbox_new (FALSE, 4);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
|
2000-12-31 04:07:42 +00:00
|
|
|
|
2001-04-07 11:01:22 +00:00
|
|
|
label = gtk_label_new (_("Exposure:"));
|
|
|
|
gtk_misc_set_alignment (GTK_MISC (label), 1.0, 1.0);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (label);
|
1999-07-01 16:52:50 +00:00
|
|
|
|
2001-04-07 11:01:22 +00:00
|
|
|
options->exposure_w =
|
|
|
|
gtk_adjustment_new (options->exposure_d, 0.0, 100.0, 1.0, 1.0, 0.0);
|
|
|
|
scale = gtk_hscale_new (GTK_ADJUSTMENT (options->exposure_w));
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), scale, TRUE, TRUE, 0);
|
|
|
|
gtk_scale_set_value_pos (GTK_SCALE (scale), GTK_POS_TOP);
|
|
|
|
gtk_range_set_update_policy (GTK_RANGE (scale), GTK_UPDATE_DELAYED);
|
2000-04-27 17:27:28 +00:00
|
|
|
|
2001-08-01 02:01:49 +00:00
|
|
|
g_signal_connect (G_OBJECT (options->exposure_w), "value_changed",
|
|
|
|
G_CALLBACK (gimp_double_adjustment_update),
|
|
|
|
&options->exposure);
|
1999-07-01 16:52:50 +00:00
|
|
|
|
2001-04-07 11:01:22 +00:00
|
|
|
gtk_widget_show (scale);
|
|
|
|
gtk_widget_show (hbox);
|
2000-04-27 17:27:28 +00:00
|
|
|
|
2001-04-07 11:01:22 +00:00
|
|
|
/* the type (dodge or burn) */
|
2001-11-26 13:17:18 +00:00
|
|
|
frame = gimp_radio_group_new2 (TRUE, _("Type (<Ctrl>)"),
|
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
2001-07-24 Michael Natterer <mitch@gimp.org>
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
* configure.in: require glib/gtk+ >= 1.3.7, commented out the
gtkxmhtml stuff.
From now on, you will need glib, pango, atk and gtk+ HEAD from CVS
to hack or use GIMP HEAD.
Beware, it crashes randomly :)
* app/core/Makefile.am
* app/core/gimpmarshal.list: new file plus rules to generate
gimpmarshal.[ch] from it.
* app/core/*
* app/tools/*
* app/widgets/*
* libgimpwidgets/*: started to use the glib object system. All
core/ objects are still gtk objects however. All signals are
created using g_signal_new(). There are many gtk+ artefacts left.
Finally, we will _not_ use the gtk_signal_foo() wrappers and
friends any more.
* app/colormaps.c
* app/devices.[ch]
* app/disp_callbacks.c
* app/errorconsole.c
* app/file-save.[ch]
* app/interface.c
* app/module_db.c
* app/nav_window.c
* app/ops_buttons.c
* app/scroll.c
* app/user_install.c
* app/gui/about-dialog.c
* app/gui/brush-editor.c
* app/gui/brushes-commands.c
* app/gui/color-notebook.c
* app/gui/colormap-dialog.c
* app/gui/dialogs-commands.c
* app/gui/dialogs-constructors.c
* app/gui/file-commands.c
* app/gui/file-dialog-utils.c
* app/gui/file-new-dialog.c
* app/gui/file-open-dialog.[ch]
* app/gui/file-save-dialog.c
* app/gui/gradient-editor.c
* app/gui/gradients-commands.c
* app/gui/image-commands.c
* app/gui/info-dialog.[ch]
* app/gui/layer-select.c
* app/gui/layers-commands.c
* app/gui/menus.c
* app/gui/offset-dialog.c
* app/gui/palette-editor.c
* app/gui/palettes-commands.c
* app/gui/patterns-commands.c
* app/gui/preferences-dialog.c
* app/gui/resize-dialog.[ch]
* app/gui/splash.c
* app/gui/tips-dialog.c
* app/gui/tool-options-dialog.c
* app/gui/toolbox.c
* app/gui/tools-commands.c
* libgimp/gimpbrushmenu.c
* libgimp/gimpmenu.c
* libgimp/gimppatternmenu.c
* libgimp/gimpui.c
* libgimpbase/gimpenv.c: tons and tons of changes like "const
gchar*", switch from GdkDeviceInfo to GdkDevice (very incomplete
and currently disables), lots of s/gtk_signal/g_signal/,
removal/replacement of deprecated stuff,
s/GtkSignalFunc/GCallback/ and lots of small changes and fixes
while I was on it, zillions of warnings left...
* modules/Makefile.am: disabled the water color selector
temporarily (XInput issues).
* plug-ins/Makefile.am
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl: simply excluded all plug-ins
which did not build (including Script-Fu). They are trivial to
fix.
2001-07-24 21:27:11 +00:00
|
|
|
G_CALLBACK (gimp_radio_button_update),
|
|
|
|
&options->type,
|
2001-11-22 17:11:52 +00:00
|
|
|
GINT_TO_POINTER (options->type),
|
2001-03-24 02:27:16 +00:00
|
|
|
|
2001-11-22 17:11:52 +00:00
|
|
|
_("Dodge"),
|
|
|
|
GINT_TO_POINTER (DODGE),
|
2001-04-07 11:01:22 +00:00
|
|
|
&options->type_w[0],
|
2001-11-22 17:11:52 +00:00
|
|
|
|
|
|
|
_("Burn"),
|
|
|
|
GINT_TO_POINTER (BURN),
|
2001-04-07 11:01:22 +00:00
|
|
|
&options->type_w[1],
|
2001-03-24 02:27:16 +00:00
|
|
|
|
2001-04-07 11:01:22 +00:00
|
|
|
NULL);
|
2001-03-24 02:27:16 +00:00
|
|
|
|
2001-04-07 11:01:22 +00:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (frame);
|
|
|
|
|
|
|
|
/* mode (highlights, midtones, or shadows) */
|
2001-11-22 17:11:52 +00:00
|
|
|
frame = gimp_radio_group_new2 (TRUE, _("Mode"),
|
|
|
|
G_CALLBACK (gimp_radio_button_update),
|
|
|
|
&options->mode,
|
|
|
|
GINT_TO_POINTER (options->mode),
|
|
|
|
|
|
|
|
_("Highlights"),
|
|
|
|
GINT_TO_POINTER (GIMP_HIGHLIGHTS),
|
|
|
|
&options->mode_w[0],
|
|
|
|
|
|
|
|
_("Midtones"),
|
|
|
|
GINT_TO_POINTER (GIMP_MIDTONES),
|
|
|
|
&options->mode_w[1],
|
2001-04-07 11:01:22 +00:00
|
|
|
|
2001-11-22 17:11:52 +00:00
|
|
|
_("Shadows"),
|
|
|
|
GINT_TO_POINTER (GIMP_SHADOWS),
|
|
|
|
&options->mode_w[2],
|
2001-04-07 11:01:22 +00:00
|
|
|
|
2001-11-22 17:11:52 +00:00
|
|
|
NULL);
|
2001-04-07 11:01:22 +00:00
|
|
|
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (frame);
|
|
|
|
|
2001-11-20 23:00:47 +00:00
|
|
|
return (GimpToolOptions *) options;
|
2001-03-24 02:27:16 +00:00
|
|
|
}
|
|
|
|
|
2001-04-07 11:01:22 +00:00
|
|
|
static void
|
2001-07-17 20:50:01 +00:00
|
|
|
gimp_dodgeburn_tool_options_reset (GimpToolOptions *tool_options)
|
2001-03-24 02:27:16 +00:00
|
|
|
{
|
2001-04-07 11:01:22 +00:00
|
|
|
DodgeBurnOptions *options;
|
2001-03-24 02:27:16 +00:00
|
|
|
|
2001-04-07 11:01:22 +00:00
|
|
|
options = (DodgeBurnOptions *) tool_options;
|
|
|
|
|
|
|
|
paint_options_reset (tool_options);
|
|
|
|
|
|
|
|
gtk_adjustment_set_value (GTK_ADJUSTMENT (options->exposure_w),
|
|
|
|
options->exposure_d);
|
|
|
|
|
2001-11-22 17:11:52 +00:00
|
|
|
gimp_radio_group_set_active (GTK_RADIO_BUTTON (options->type_w[0]),
|
|
|
|
GINT_TO_POINTER (options->type_d));
|
2001-04-07 11:01:22 +00:00
|
|
|
|
2001-11-22 17:11:52 +00:00
|
|
|
gimp_radio_group_set_active (GTK_RADIO_BUTTON (options->mode_w[0]),
|
|
|
|
GINT_TO_POINTER (options->mode_d));
|
2001-03-24 02:27:16 +00:00
|
|
|
}
|