1997-11-25 06:05:25 +08: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
|
1998-04-13 13:44:11 +08:00
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
1997-11-25 06:05:25 +08:00
|
|
|
*/
|
|
|
|
#include "appenv.h"
|
|
|
|
#include "brightness_contrast.h"
|
|
|
|
#include "drawable.h"
|
1999-11-22 19:14:29 +08:00
|
|
|
#include "gimplut.h"
|
1999-09-28 01:58:10 +08:00
|
|
|
#include "gimpui.h"
|
1997-11-25 06:05:25 +08:00
|
|
|
#include "gdisplay.h"
|
|
|
|
#include "image_map.h"
|
1999-04-09 14:00:11 +08:00
|
|
|
#include "lut_funcs.h"
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-02-01 07:59:05 +08:00
|
|
|
#include "config.h"
|
Lots of ii8n stuff here and some additions to the de.po. Applied
Wed Oct 14 17:46:15 EDT 1998 Adrian Likins <adrian@gimp.org>
* app/*, po/de.po, de/POTFILES.in, libgimp/gimpintl.h:
Lots of ii8n stuff here and some additions to the de.po.
Applied gimp-egger-981005-1 ,gimp-egger-981006-1,
gimp-egger-981007-1, gimp-egger-981008-1,
gimp-egger-981009-1.patch, gimp-egger-981010-1.patch
* plug-in/guillotine/guillotine.c: added the coordinates
of the split images from the original image to the title.
ie foo.jpg (0,0) for the image in the topleft.
* plug-in/script-fu/scripts/neon-logo.scm,
perspective-shadow.scm, predator.scm,rendermap.scm,
ripply-anim.scm, select_to_image.scm,swirltile.scm,
xach-effect.scm: updated scripts to use new script-fu stuff
wooo boy! a big un!
in testing this, it looks like some of the po files are busted.
but the code stuff seems okay.
-adrian
1998-10-15 07:23:52 +08:00
|
|
|
#include "libgimp/gimpintl.h"
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
#define SLIDER_WIDTH 200
|
|
|
|
|
1999-11-22 19:14:29 +08:00
|
|
|
#define BRIGHTNESS 0x1
|
|
|
|
#define CONTRAST 0x2
|
|
|
|
#define ALL (BRIGHTNESS | CONTRAST)
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-04-13 01:55:06 +08:00
|
|
|
/* the brightness-contrast structures */
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-04-13 01:55:06 +08:00
|
|
|
typedef struct _BrightnessContrast BrightnessContrast;
|
1999-11-22 19:14:29 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
struct _BrightnessContrast
|
|
|
|
{
|
1999-07-23 04:42:59 +08:00
|
|
|
gint x, y; /* coords for last mouse click */
|
1997-11-25 06:05:25 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct _BrightnessContrastDialog BrightnessContrastDialog;
|
1999-11-22 19:14:29 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
struct _BrightnessContrastDialog
|
|
|
|
{
|
1999-11-22 19:14:29 +08:00
|
|
|
GtkWidget *shell;
|
|
|
|
GtkWidget *gimage_name;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-11-22 19:14:29 +08:00
|
|
|
GtkAdjustment *brightness_data;
|
|
|
|
GtkAdjustment *contrast_data;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-11-22 19:14:29 +08:00
|
|
|
GimpDrawable *drawable;
|
|
|
|
ImageMap image_map;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-11-22 19:14:29 +08:00
|
|
|
gdouble brightness;
|
|
|
|
gdouble contrast;
|
1999-02-16 16:53:54 +08:00
|
|
|
|
1999-11-22 19:14:29 +08:00
|
|
|
gboolean preview;
|
|
|
|
|
|
|
|
GimpLut *lut;
|
1997-11-25 06:05:25 +08:00
|
|
|
};
|
|
|
|
|
1999-04-13 01:55:06 +08:00
|
|
|
|
|
|
|
/* the brightness-contrast tool options */
|
|
|
|
static ToolOptions *brightness_contrast_options = NULL;
|
|
|
|
|
|
|
|
/* the brightness-contrast dialog */
|
|
|
|
static BrightnessContrastDialog *brightness_contrast_dialog = NULL;
|
|
|
|
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
/* brightness contrast action functions */
|
|
|
|
|
1999-07-03 01:40:10 +08:00
|
|
|
static void brightness_contrast_control (Tool *, ToolAction, gpointer);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-11-22 19:14:29 +08:00
|
|
|
static BrightnessContrastDialog * brightness_contrast_dialog_new (void);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-11-22 19:14:29 +08:00
|
|
|
static void brightness_contrast_update (BrightnessContrastDialog *,
|
|
|
|
gint);
|
|
|
|
static void brightness_contrast_preview (BrightnessContrastDialog *);
|
|
|
|
static void brightness_contrast_reset_callback (GtkWidget *, gpointer);
|
|
|
|
static void brightness_contrast_ok_callback (GtkWidget *, gpointer);
|
|
|
|
static void brightness_contrast_cancel_callback (GtkWidget *, gpointer);
|
|
|
|
static void brightness_contrast_preview_update (GtkWidget *, gpointer);
|
|
|
|
static void brightness_contrast_brightness_adjustment_update (GtkAdjustment *,
|
|
|
|
gpointer);
|
|
|
|
static void brightness_contrast_contrast_adjustment_update (GtkAdjustment *,
|
|
|
|
gpointer);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-07-03 01:40:10 +08:00
|
|
|
/* brightness-contrast select action functions */
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
static void
|
1999-06-22 06:12:07 +08:00
|
|
|
brightness_contrast_control (Tool *tool,
|
|
|
|
ToolAction action,
|
|
|
|
gpointer gdisp_ptr)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
switch (action)
|
|
|
|
{
|
1999-06-22 06:12:07 +08:00
|
|
|
case PAUSE:
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
1999-06-22 06:12:07 +08:00
|
|
|
|
|
|
|
case RESUME:
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
1999-06-22 06:12:07 +08:00
|
|
|
|
|
|
|
case HALT:
|
1997-11-25 06:05:25 +08:00
|
|
|
if (brightness_contrast_dialog)
|
1999-06-23 23:24:46 +08:00
|
|
|
brightness_contrast_cancel_callback (NULL, (gpointer) brightness_contrast_dialog);
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
1999-06-22 06:12:07 +08:00
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Tool *
|
1999-11-22 19:14:29 +08:00
|
|
|
tools_new_brightness_contrast (void)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
Tool * tool;
|
|
|
|
BrightnessContrast * private;
|
|
|
|
|
|
|
|
/* The tool options */
|
|
|
|
if (!brightness_contrast_options)
|
1999-04-09 06:25:54 +08:00
|
|
|
{
|
1999-04-13 01:55:06 +08:00
|
|
|
brightness_contrast_options =
|
2000-02-01 05:27:00 +08:00
|
|
|
tool_options_new (_("Brightness-Contrast"));
|
1999-04-13 01:55:06 +08:00
|
|
|
tools_register (BRIGHTNESS_CONTRAST, brightness_contrast_options);
|
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-07-03 01:40:10 +08:00
|
|
|
tool = tools_new_tool (BRIGHTNESS_CONTRAST);
|
|
|
|
private = g_new (BrightnessContrast, 1);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-07-03 01:40:10 +08:00
|
|
|
tool->scroll_lock = TRUE; /* Disallow scrolling */
|
|
|
|
tool->preserve = FALSE; /* Don't preserve on drawable change */
|
1999-04-09 06:25:54 +08:00
|
|
|
|
1999-07-03 01:40:10 +08:00
|
|
|
tool->private = (void *) private;
|
1999-06-26 19:16:47 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
tool->control_func = brightness_contrast_control;
|
|
|
|
|
|
|
|
return tool;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
tools_free_brightness_contrast (Tool *tool)
|
|
|
|
{
|
|
|
|
BrightnessContrast * bc;
|
|
|
|
|
|
|
|
bc = (BrightnessContrast *) tool->private;
|
|
|
|
|
1999-11-22 19:14:29 +08:00
|
|
|
/* Close the brightness-contrast dialog */
|
1997-11-25 06:05:25 +08:00
|
|
|
if (brightness_contrast_dialog)
|
1998-04-02 12:51:44 +08:00
|
|
|
brightness_contrast_cancel_callback (NULL, (gpointer) brightness_contrast_dialog);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
g_free (bc);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1998-06-22 04:17:21 +08:00
|
|
|
brightness_contrast_initialize (GDisplay *gdisp)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
if (drawable_indexed (gimage_active_drawable (gdisp->gimage)))
|
|
|
|
{
|
Lots of ii8n stuff here and some additions to the de.po. Applied
Wed Oct 14 17:46:15 EDT 1998 Adrian Likins <adrian@gimp.org>
* app/*, po/de.po, de/POTFILES.in, libgimp/gimpintl.h:
Lots of ii8n stuff here and some additions to the de.po.
Applied gimp-egger-981005-1 ,gimp-egger-981006-1,
gimp-egger-981007-1, gimp-egger-981008-1,
gimp-egger-981009-1.patch, gimp-egger-981010-1.patch
* plug-in/guillotine/guillotine.c: added the coordinates
of the split images from the original image to the title.
ie foo.jpg (0,0) for the image in the topleft.
* plug-in/script-fu/scripts/neon-logo.scm,
perspective-shadow.scm, predator.scm,rendermap.scm,
ripply-anim.scm, select_to_image.scm,swirltile.scm,
xach-effect.scm: updated scripts to use new script-fu stuff
wooo boy! a big un!
in testing this, it looks like some of the po files are busted.
but the code stuff seems okay.
-adrian
1998-10-15 07:23:52 +08:00
|
|
|
g_message (_("Brightness-Contrast does not operate on indexed drawables."));
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* The brightness-contrast dialog */
|
|
|
|
if (!brightness_contrast_dialog)
|
1999-11-22 19:14:29 +08:00
|
|
|
brightness_contrast_dialog = brightness_contrast_dialog_new ();
|
1997-11-25 06:05:25 +08:00
|
|
|
else
|
|
|
|
if (!GTK_WIDGET_VISIBLE (brightness_contrast_dialog->shell))
|
|
|
|
gtk_widget_show (brightness_contrast_dialog->shell);
|
|
|
|
|
|
|
|
brightness_contrast_dialog->brightness = 0.0;
|
1999-11-22 19:14:29 +08:00
|
|
|
brightness_contrast_dialog->contrast = 0.0;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1998-01-22 15:02:57 +08:00
|
|
|
brightness_contrast_dialog->drawable = gimage_active_drawable (gdisp->gimage);
|
1999-06-26 19:16:47 +08:00
|
|
|
brightness_contrast_dialog->image_map =
|
|
|
|
image_map_create (gdisp, brightness_contrast_dialog->drawable);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
brightness_contrast_update (brightness_contrast_dialog, ALL);
|
|
|
|
}
|
|
|
|
|
|
|
|
/********************************/
|
|
|
|
/* Brightness Contrast dialog */
|
|
|
|
/********************************/
|
|
|
|
|
1998-03-19 06:35:31 +08:00
|
|
|
static BrightnessContrastDialog *
|
1999-11-22 19:14:29 +08:00
|
|
|
brightness_contrast_dialog_new (void)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
BrightnessContrastDialog *bcd;
|
|
|
|
GtkWidget *vbox;
|
|
|
|
GtkWidget *hbox;
|
|
|
|
GtkWidget *table;
|
|
|
|
GtkWidget *label;
|
1999-11-22 19:14:29 +08:00
|
|
|
GtkWidget *abox;
|
|
|
|
GtkWidget *spinbutton;
|
1997-11-25 06:05:25 +08:00
|
|
|
GtkWidget *slider;
|
|
|
|
GtkWidget *toggle;
|
|
|
|
GtkObject *data;
|
|
|
|
|
1999-07-23 04:42:59 +08:00
|
|
|
bcd = g_new (BrightnessContrastDialog, 1);
|
1997-11-25 06:05:25 +08:00
|
|
|
bcd->preview = TRUE;
|
|
|
|
|
1999-07-23 04:42:59 +08:00
|
|
|
bcd->lut = gimp_lut_new ();
|
1999-02-16 16:53:54 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
/* The shell and main vbox */
|
1999-09-28 01:58:10 +08:00
|
|
|
bcd->shell =
|
|
|
|
gimp_dialog_new (_("Brightness-Contrast"), "brightness_contrast",
|
|
|
|
tools_help_func, NULL,
|
|
|
|
GTK_WIN_POS_NONE,
|
|
|
|
FALSE, TRUE, FALSE,
|
1999-07-23 04:42:59 +08:00
|
|
|
|
1999-09-28 01:58:10 +08:00
|
|
|
_("OK"), brightness_contrast_ok_callback,
|
2000-01-07 00:40:17 +08:00
|
|
|
bcd, NULL, NULL, TRUE, FALSE,
|
1999-12-02 21:00:18 +08:00
|
|
|
_("Reset"), brightness_contrast_reset_callback,
|
2000-01-07 00:40:17 +08:00
|
|
|
bcd, NULL, NULL, TRUE, FALSE,
|
1999-09-28 01:58:10 +08:00
|
|
|
_("Cancel"), brightness_contrast_cancel_callback,
|
2000-01-07 00:40:17 +08:00
|
|
|
bcd, NULL, NULL, FALSE, TRUE,
|
1999-09-28 01:58:10 +08:00
|
|
|
|
|
|
|
NULL);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-11-22 19:14:29 +08:00
|
|
|
vbox = gtk_vbox_new (FALSE, 4);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (vbox), 4);
|
1999-07-23 04:42:59 +08:00
|
|
|
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (bcd->shell)->vbox), vbox);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
/* The table containing sliders */
|
|
|
|
table = gtk_table_new (2, 3, FALSE);
|
1999-11-22 19:14:29 +08:00
|
|
|
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
|
|
|
|
gtk_table_set_row_spacings (GTK_TABLE (table), 2);
|
1997-11-25 06:05:25 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
|
|
|
|
|
|
|
|
/* Create the brightness scale widget */
|
2000-05-07 18:06:27 +08:00
|
|
|
label = gtk_label_new (_("Brightness:"));
|
1999-04-13 01:55:06 +08:00
|
|
|
gtk_misc_set_alignment (GTK_MISC (label), 1.0, 1.0);
|
1997-11-25 06:05:25 +08:00
|
|
|
gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1,
|
1999-11-22 19:14:29 +08:00
|
|
|
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-11-22 19:14:29 +08:00
|
|
|
data = gtk_adjustment_new (0, -127, 127.0, 1.0, 10.0, 0.0);
|
1997-11-25 06:05:25 +08:00
|
|
|
bcd->brightness_data = GTK_ADJUSTMENT (data);
|
|
|
|
slider = gtk_hscale_new (GTK_ADJUSTMENT (data));
|
1999-11-22 19:14:29 +08:00
|
|
|
gtk_widget_set_usize (slider, SLIDER_WIDTH, -1);
|
1997-11-25 06:05:25 +08:00
|
|
|
gtk_scale_set_digits (GTK_SCALE (slider), 0);
|
|
|
|
gtk_scale_set_value_pos (GTK_SCALE (slider), GTK_POS_TOP);
|
|
|
|
gtk_range_set_update_policy (GTK_RANGE (slider), GTK_UPDATE_DELAYED);
|
1999-11-22 19:14:29 +08:00
|
|
|
gtk_table_attach_defaults (GTK_TABLE (table), slider, 1, 2, 0, 1);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-11-22 19:14:29 +08:00
|
|
|
abox = gtk_vbox_new (FALSE, 0);
|
|
|
|
spinbutton = gtk_spin_button_new (bcd->brightness_data, 1.0, 0);
|
|
|
|
gtk_widget_set_usize (spinbutton, 75, -1);
|
|
|
|
gtk_box_pack_end (GTK_BOX (abox), spinbutton, FALSE, FALSE, 0);
|
|
|
|
gtk_table_attach (GTK_TABLE (table), abox, 2, 3, 0, 1,
|
|
|
|
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
|
|
|
|
|
|
|
|
gtk_signal_connect (GTK_OBJECT (data), "value_changed",
|
|
|
|
GTK_SIGNAL_FUNC (brightness_contrast_brightness_adjustment_update),
|
1997-11-25 06:05:25 +08:00
|
|
|
bcd);
|
|
|
|
|
|
|
|
gtk_widget_show (label);
|
|
|
|
gtk_widget_show (slider);
|
1999-11-22 19:14:29 +08:00
|
|
|
gtk_widget_show (spinbutton);
|
|
|
|
gtk_widget_show (abox);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
/* Create the contrast scale widget */
|
2000-05-07 18:06:27 +08:00
|
|
|
label = gtk_label_new (_("Contrast:"));
|
1999-04-13 01:55:06 +08:00
|
|
|
gtk_misc_set_alignment (GTK_MISC (label), 1.0, 1.0);
|
1997-11-25 06:05:25 +08:00
|
|
|
gtk_table_attach (GTK_TABLE (table), label, 0, 1, 1, 2,
|
1999-11-22 19:14:29 +08:00
|
|
|
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-11-22 19:14:29 +08:00
|
|
|
data = gtk_adjustment_new (0, -127.0, 127.0, 1.0, 10.0, 0.0);
|
1997-11-25 06:05:25 +08:00
|
|
|
bcd->contrast_data = GTK_ADJUSTMENT (data);
|
|
|
|
slider = gtk_hscale_new (GTK_ADJUSTMENT (data));
|
1999-11-22 19:14:29 +08:00
|
|
|
gtk_widget_set_usize (slider, SLIDER_WIDTH, -1);
|
1997-11-25 06:05:25 +08:00
|
|
|
gtk_scale_set_digits (GTK_SCALE (slider), 0);
|
|
|
|
gtk_scale_set_value_pos (GTK_SCALE (slider), GTK_POS_TOP);
|
|
|
|
gtk_range_set_update_policy (GTK_RANGE (slider), GTK_UPDATE_DELAYED);
|
1999-11-22 19:14:29 +08:00
|
|
|
gtk_table_attach_defaults (GTK_TABLE (table), slider, 1, 2, 1, 2);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-11-22 19:14:29 +08:00
|
|
|
abox = gtk_vbox_new (FALSE, 0);
|
|
|
|
spinbutton = gtk_spin_button_new (bcd->contrast_data, 1.0, 0);
|
|
|
|
gtk_widget_set_usize (spinbutton, 75, -1);
|
|
|
|
gtk_box_pack_end (GTK_BOX (abox), spinbutton, FALSE, FALSE, 0);
|
|
|
|
gtk_table_attach (GTK_TABLE (table), abox, 2, 3, 1, 2,
|
|
|
|
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
|
|
|
|
|
|
|
|
gtk_signal_connect (GTK_OBJECT (data), "value_changed",
|
|
|
|
GTK_SIGNAL_FUNC (brightness_contrast_contrast_adjustment_update),
|
1997-11-25 06:05:25 +08:00
|
|
|
bcd);
|
|
|
|
|
|
|
|
gtk_widget_show (label);
|
|
|
|
gtk_widget_show (slider);
|
1999-11-22 19:14:29 +08:00
|
|
|
gtk_widget_show (spinbutton);
|
|
|
|
gtk_widget_show (abox);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-11-22 19:14:29 +08:00
|
|
|
/* Horizontal box for preview toggle button */
|
|
|
|
hbox = gtk_hbox_new (FALSE, 4);
|
|
|
|
gtk_box_pack_end (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
/* The preview toggle */
|
Lots of ii8n stuff here and some additions to the de.po. Applied
Wed Oct 14 17:46:15 EDT 1998 Adrian Likins <adrian@gimp.org>
* app/*, po/de.po, de/POTFILES.in, libgimp/gimpintl.h:
Lots of ii8n stuff here and some additions to the de.po.
Applied gimp-egger-981005-1 ,gimp-egger-981006-1,
gimp-egger-981007-1, gimp-egger-981008-1,
gimp-egger-981009-1.patch, gimp-egger-981010-1.patch
* plug-in/guillotine/guillotine.c: added the coordinates
of the split images from the original image to the title.
ie foo.jpg (0,0) for the image in the topleft.
* plug-in/script-fu/scripts/neon-logo.scm,
perspective-shadow.scm, predator.scm,rendermap.scm,
ripply-anim.scm, select_to_image.scm,swirltile.scm,
xach-effect.scm: updated scripts to use new script-fu stuff
wooo boy! a big un!
in testing this, it looks like some of the po files are busted.
but the code stuff seems okay.
-adrian
1998-10-15 07:23:52 +08:00
|
|
|
toggle = gtk_check_button_new_with_label (_("Preview"));
|
1999-01-16 01:35:04 +08:00
|
|
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle), bcd->preview);
|
1999-11-22 19:14:29 +08:00
|
|
|
gtk_box_pack_end (GTK_BOX (hbox), toggle, FALSE, FALSE, 0);
|
1997-11-25 06:05:25 +08:00
|
|
|
gtk_signal_connect (GTK_OBJECT (toggle), "toggled",
|
1999-11-22 19:14:29 +08:00
|
|
|
GTK_SIGNAL_FUNC (brightness_contrast_preview_update),
|
1997-11-25 06:05:25 +08:00
|
|
|
bcd);
|
|
|
|
|
|
|
|
gtk_widget_show (toggle);
|
|
|
|
gtk_widget_show (hbox);
|
|
|
|
|
|
|
|
gtk_widget_show (table);
|
|
|
|
gtk_widget_show (vbox);
|
|
|
|
gtk_widget_show (bcd->shell);
|
|
|
|
|
|
|
|
return bcd;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
brightness_contrast_update (BrightnessContrastDialog *bcd,
|
1999-07-23 04:42:59 +08:00
|
|
|
gint update)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
1999-11-22 19:14:29 +08:00
|
|
|
if (update & BRIGHTNESS)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
1999-11-22 19:14:29 +08:00
|
|
|
gtk_adjustment_set_value (bcd->brightness_data, bcd->brightness);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
1999-11-22 19:14:29 +08:00
|
|
|
if (update & CONTRAST)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
1999-11-22 19:14:29 +08:00
|
|
|
gtk_adjustment_set_value (bcd->contrast_data, bcd->contrast);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
brightness_contrast_preview (BrightnessContrastDialog *bcd)
|
|
|
|
{
|
|
|
|
if (!bcd->image_map)
|
1999-07-23 04:42:59 +08:00
|
|
|
{
|
|
|
|
g_message ("brightness_contrast_preview(): No image map");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
1998-03-31 15:23:50 +08:00
|
|
|
active_tool->preserve = TRUE;
|
1999-07-23 04:42:59 +08:00
|
|
|
brightness_contrast_lut_setup (bcd->lut, bcd->brightness / 255.0,
|
|
|
|
bcd->contrast / 127.0,
|
|
|
|
gimp_drawable_bytes (bcd->drawable));
|
|
|
|
image_map_apply (bcd->image_map, (ImageMapApplyFunc) gimp_lut_process_2,
|
1999-02-16 16:53:54 +08:00
|
|
|
(void *) bcd->lut);
|
1998-03-31 15:23:50 +08:00
|
|
|
active_tool->preserve = FALSE;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
1999-11-22 19:14:29 +08:00
|
|
|
static void
|
|
|
|
brightness_contrast_reset_callback (GtkWidget *widget,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
BrightnessContrastDialog *bcd;
|
|
|
|
|
|
|
|
bcd = (BrightnessContrastDialog *) data;
|
|
|
|
|
|
|
|
bcd->brightness = 0.0;
|
|
|
|
bcd->contrast = 0.0;
|
|
|
|
|
|
|
|
brightness_contrast_update (bcd, ALL);
|
|
|
|
|
|
|
|
if (bcd->preview)
|
|
|
|
brightness_contrast_preview (bcd);
|
|
|
|
}
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
static void
|
|
|
|
brightness_contrast_ok_callback (GtkWidget *widget,
|
1999-11-22 19:14:29 +08:00
|
|
|
gpointer data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
BrightnessContrastDialog *bcd;
|
|
|
|
|
1999-11-22 19:14:29 +08:00
|
|
|
bcd = (BrightnessContrastDialog *) data;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-03-29 07:02:05 +08:00
|
|
|
gimp_dialog_hide (bcd->shell);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1998-03-31 15:23:50 +08:00
|
|
|
active_tool->preserve = TRUE;
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
if (!bcd->preview)
|
1999-02-16 16:53:54 +08:00
|
|
|
{
|
1999-07-23 04:42:59 +08:00
|
|
|
brightness_contrast_lut_setup (bcd->lut, bcd->brightness / 255.0,
|
|
|
|
bcd->contrast / 127.0,
|
|
|
|
gimp_drawable_bytes (bcd->drawable));
|
|
|
|
image_map_apply (bcd->image_map, (ImageMapApplyFunc) gimp_lut_process_2,
|
1999-02-16 16:53:54 +08:00
|
|
|
(void *) bcd->lut);
|
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
if (bcd->image_map)
|
|
|
|
image_map_commit (bcd->image_map);
|
|
|
|
|
1998-03-31 15:23:50 +08:00
|
|
|
active_tool->preserve = FALSE;
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
bcd->image_map = NULL;
|
1999-06-26 19:16:47 +08:00
|
|
|
|
|
|
|
active_tool->gdisp_ptr = NULL;
|
|
|
|
active_tool->drawable = NULL;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
brightness_contrast_cancel_callback (GtkWidget *widget,
|
1999-07-23 04:42:59 +08:00
|
|
|
gpointer data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
BrightnessContrastDialog *bcd;
|
|
|
|
|
1999-07-23 04:42:59 +08:00
|
|
|
bcd = (BrightnessContrastDialog *) data;
|
|
|
|
|
2000-03-29 07:02:05 +08:00
|
|
|
gimp_dialog_hide (bcd->shell);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
if (bcd->image_map)
|
|
|
|
{
|
1998-03-31 15:23:50 +08:00
|
|
|
active_tool->preserve = TRUE;
|
1997-11-25 06:05:25 +08:00
|
|
|
image_map_abort (bcd->image_map);
|
1998-03-31 15:23:50 +08:00
|
|
|
active_tool->preserve = FALSE;
|
1999-06-23 23:24:46 +08:00
|
|
|
|
|
|
|
bcd->image_map = NULL;
|
1997-11-25 06:05:25 +08:00
|
|
|
gdisplays_flush ();
|
|
|
|
}
|
1999-06-26 19:16:47 +08:00
|
|
|
|
|
|
|
active_tool->gdisp_ptr = NULL;
|
|
|
|
active_tool->drawable = NULL;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
1999-07-23 04:42:59 +08:00
|
|
|
brightness_contrast_preview_update (GtkWidget *widget,
|
1997-11-25 06:05:25 +08:00
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
BrightnessContrastDialog *bcd;
|
|
|
|
|
|
|
|
bcd = (BrightnessContrastDialog *) data;
|
|
|
|
|
1999-07-23 04:42:59 +08:00
|
|
|
if (GTK_TOGGLE_BUTTON (widget)->active)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
bcd->preview = TRUE;
|
|
|
|
brightness_contrast_preview (bcd);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
bcd->preview = FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
1999-11-22 19:14:29 +08:00
|
|
|
brightness_contrast_brightness_adjustment_update (GtkAdjustment *adjustment,
|
|
|
|
gpointer data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
BrightnessContrastDialog *bcd;
|
|
|
|
|
|
|
|
bcd = (BrightnessContrastDialog *) data;
|
|
|
|
|
|
|
|
if (bcd->brightness != adjustment->value)
|
|
|
|
{
|
|
|
|
bcd->brightness = adjustment->value;
|
|
|
|
|
|
|
|
if (bcd->preview)
|
|
|
|
brightness_contrast_preview (bcd);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
1999-11-22 19:14:29 +08:00
|
|
|
brightness_contrast_contrast_adjustment_update (GtkAdjustment *adjustment,
|
|
|
|
gpointer data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
BrightnessContrastDialog *bcd;
|
|
|
|
|
|
|
|
bcd = (BrightnessContrastDialog *) data;
|
|
|
|
|
|
|
|
if (bcd->contrast != adjustment->value)
|
|
|
|
{
|
|
|
|
bcd->contrast = adjustment->value;
|
|
|
|
|
|
|
|
if (bcd->preview)
|
|
|
|
brightness_contrast_preview (bcd);
|
|
|
|
}
|
|
|
|
}
|