1997-11-24 22:05:25 +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
|
1998-04-13 05:44:11 +00:00
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
1997-11-24 22:05:25 +00:00
|
|
|
*/
|
2000-12-16 21:37:03 +00:00
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
2000-12-29 15:22:01 +00:00
|
|
|
#include <gtk/gtk.h>
|
2000-12-16 21:37:03 +00:00
|
|
|
|
2001-01-23 23:56:18 +00:00
|
|
|
#include "libgimpcolor/gimpcolor.h"
|
|
|
|
#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-24 23:57:08 +00:00
|
|
|
#include "tools-types.h"
|
|
|
|
|
|
|
|
#include "base/pixel-region.h"
|
|
|
|
|
|
|
|
#include "core/gimpdrawable.h"
|
|
|
|
#include "core/gimpimage.h"
|
|
|
|
|
2001-09-25 23:23:09 +00:00
|
|
|
#include "display/gimpdisplay.h"
|
2001-10-13 12:52:30 +00:00
|
|
|
#include "display/gimpdisplay-foreach.h"
|
2001-09-25 23:23:09 +00:00
|
|
|
|
2002-03-20 19:25:14 +00:00
|
|
|
#include "widgets/gimpenummenu.h"
|
|
|
|
|
2001-05-24 23:57:08 +00:00
|
|
|
#include "gimpcolorbalancetool.h"
|
2001-06-26 12:09:43 +00:00
|
|
|
#include "gimpcolorbalancetool-transfer.h"
|
2001-05-24 23:57:08 +00:00
|
|
|
#include "tool_manager.h"
|
2000-12-16 21:37:03 +00:00
|
|
|
|
2001-07-07 17:36:00 +00:00
|
|
|
#include "app_procs.h"
|
1997-11-24 22:05:25 +00:00
|
|
|
#include "image_map.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-14 23:23:52 +00:00
|
|
|
#include "libgimp/gimpintl.h"
|
|
|
|
|
2000-12-29 15:22:01 +00:00
|
|
|
|
1999-11-20 18:08:41 +00:00
|
|
|
#define CYAN_RED 0x1
|
|
|
|
#define MAGENTA_GREEN 0x2
|
|
|
|
#define YELLOW_BLUE 0x4
|
|
|
|
#define ALL (CYAN_RED | MAGENTA_GREEN | YELLOW_BLUE)
|
1997-11-24 22:05:25 +00:00
|
|
|
|
1999-04-08 22:25:54 +00:00
|
|
|
|
2001-05-24 23:57:08 +00:00
|
|
|
/* local function prototypes */
|
1999-04-08 22:25:54 +00:00
|
|
|
|
2001-05-24 23:57:08 +00:00
|
|
|
static void gimp_color_balance_tool_class_init (GimpColorBalanceToolClass *klass);
|
|
|
|
static void gimp_color_balance_tool_init (GimpColorBalanceTool *bc_tool);
|
1997-11-24 22:05:25 +00:00
|
|
|
|
2002-02-18 17:00:09 +00:00
|
|
|
static void gimp_color_balance_tool_initialize (GimpTool *tool,
|
|
|
|
GimpDisplay *gdisp);
|
|
|
|
static void gimp_color_balance_tool_control (GimpTool *tool,
|
|
|
|
GimpToolAction action,
|
|
|
|
GimpDisplay *gdisp);
|
1999-06-21 22:12:07 +00:00
|
|
|
|
1999-11-22 11:14:29 +00:00
|
|
|
static ColorBalanceDialog * color_balance_dialog_new (void);
|
1999-06-21 22:12:07 +00:00
|
|
|
|
2001-10-17 11:33:43 +00:00
|
|
|
static void color_balance_dialog_hide (void);
|
2000-12-31 04:07:42 +00:00
|
|
|
static void color_balance_update (ColorBalanceDialog *cbd,
|
2001-10-17 11:33:43 +00:00
|
|
|
gint update);
|
2000-12-31 04:07:42 +00:00
|
|
|
static void color_balance_preview (ColorBalanceDialog *cbd);
|
|
|
|
static void color_balance_reset_callback (GtkWidget *widget,
|
|
|
|
gpointer data);
|
|
|
|
static void color_balance_ok_callback (GtkWidget *widget,
|
|
|
|
gpointer data);
|
|
|
|
static void color_balance_cancel_callback (GtkWidget *widget,
|
|
|
|
gpointer data);
|
|
|
|
static void color_balance_range_callback (GtkWidget *widget,
|
|
|
|
gpointer data);
|
|
|
|
static void color_balance_preserve_update (GtkWidget *widget,
|
|
|
|
gpointer data);
|
|
|
|
static void color_balance_preview_update (GtkWidget *widget,
|
|
|
|
gpointer data);
|
|
|
|
static void color_balance_cr_adjustment_update (GtkAdjustment *adj,
|
|
|
|
gpointer data);
|
|
|
|
static void color_balance_mg_adjustment_update (GtkAdjustment *adj,
|
|
|
|
gpointer data);
|
|
|
|
static void color_balance_yb_adjustment_update (GtkAdjustment *adj,
|
|
|
|
gpointer data);
|
1999-04-12 17:55:06 +00:00
|
|
|
|
2001-05-24 23:57:08 +00:00
|
|
|
|
|
|
|
static ColorBalanceDialog *color_balance_dialog = NULL;
|
|
|
|
|
|
|
|
static GimpImageMapToolClass *parent_class = NULL;
|
|
|
|
|
|
|
|
|
|
|
|
/* functions */
|
|
|
|
|
|
|
|
void
|
2001-11-20 23:00:47 +00:00
|
|
|
gimp_color_balance_tool_register (Gimp *gimp,
|
|
|
|
GimpToolRegisterCallback callback)
|
2001-05-24 23:57:08 +00:00
|
|
|
{
|
2001-11-20 23:00:47 +00:00
|
|
|
(* callback) (gimp,
|
|
|
|
GIMP_TYPE_COLOR_BALANCE_TOOL,
|
|
|
|
NULL,
|
|
|
|
FALSE,
|
|
|
|
"gimp:color_balance_tool",
|
|
|
|
_("Color Balance"),
|
|
|
|
_("Adjust color balance"),
|
2001-12-03 17:59:48 +00:00
|
|
|
N_("/Layer/Colors/Color Balance..."), NULL,
|
2001-11-20 23:00:47 +00:00
|
|
|
NULL, "tools/color_balance.html",
|
|
|
|
GIMP_STOCK_TOOL_COLOR_BALANCE);
|
2001-05-24 23:57:08 +00:00
|
|
|
}
|
|
|
|
|
2001-08-14 14:53:55 +00:00
|
|
|
GType
|
2001-05-24 23:57:08 +00:00
|
|
|
gimp_color_balance_tool_get_type (void)
|
|
|
|
{
|
2001-08-14 14:53:55 +00:00
|
|
|
static GType tool_type = 0;
|
2001-05-24 23:57:08 +00:00
|
|
|
|
|
|
|
if (! tool_type)
|
|
|
|
{
|
2001-08-14 14:53:55 +00:00
|
|
|
static const GTypeInfo tool_info =
|
2001-05-24 23:57:08 +00:00
|
|
|
{
|
|
|
|
sizeof (GimpColorBalanceToolClass),
|
2001-08-14 14:53:55 +00:00
|
|
|
(GBaseInitFunc) NULL,
|
|
|
|
(GBaseFinalizeFunc) NULL,
|
|
|
|
(GClassInitFunc) gimp_color_balance_tool_class_init,
|
|
|
|
NULL, /* class_finalize */
|
|
|
|
NULL, /* class_data */
|
|
|
|
sizeof (GimpColorBalanceTool),
|
|
|
|
0, /* n_preallocs */
|
|
|
|
(GInstanceInitFunc) gimp_color_balance_tool_init,
|
2001-05-24 23:57:08 +00:00
|
|
|
};
|
|
|
|
|
2001-08-14 14:53:55 +00:00
|
|
|
tool_type = g_type_register_static (GIMP_TYPE_IMAGE_MAP_TOOL,
|
|
|
|
"GimpColorBalanceTool",
|
|
|
|
&tool_info, 0);
|
2001-05-24 23:57:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return tool_type;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_color_balance_tool_class_init (GimpColorBalanceToolClass *klass)
|
|
|
|
{
|
2001-08-14 14:53:55 +00:00
|
|
|
GimpToolClass *tool_class;
|
2001-05-24 23:57:08 +00:00
|
|
|
|
2001-08-14 14:53:55 +00:00
|
|
|
tool_class = GIMP_TOOL_CLASS (klass);
|
2001-05-24 23:57:08 +00:00
|
|
|
|
2001-08-14 14:53:55 +00:00
|
|
|
parent_class = g_type_class_peek_parent (klass);
|
2001-05-24 23:57:08 +00:00
|
|
|
|
|
|
|
tool_class->initialize = gimp_color_balance_tool_initialize;
|
|
|
|
tool_class->control = gimp_color_balance_tool_control;
|
2001-06-26 12:09:43 +00:00
|
|
|
|
|
|
|
gimp_color_balance_tool_transfer_init ();
|
2001-05-24 23:57:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_color_balance_tool_init (GimpColorBalanceTool *bc_tool)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2001-10-29 11:47:11 +00:00
|
|
|
gimp_color_balance_tool_initialize (GimpTool *tool,
|
|
|
|
GimpDisplay *gdisp)
|
2001-05-24 23:57:08 +00:00
|
|
|
{
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
if (! gdisp)
|
|
|
|
{
|
|
|
|
color_balance_dialog_hide ();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (! gimp_drawable_is_rgb (gimp_image_active_drawable (gdisp->gimage)))
|
|
|
|
{
|
|
|
|
g_message (_("Color balance operates only on RGB color drawables."));
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* The color balance dialog */
|
|
|
|
if (!color_balance_dialog)
|
|
|
|
color_balance_dialog = color_balance_dialog_new ();
|
|
|
|
else
|
|
|
|
if (!GTK_WIDGET_VISIBLE (color_balance_dialog->shell))
|
|
|
|
gtk_widget_show (color_balance_dialog->shell);
|
|
|
|
|
|
|
|
for (i = 0; i < 3; i++)
|
|
|
|
{
|
|
|
|
color_balance_dialog->cyan_red[i] = 0.0;
|
|
|
|
color_balance_dialog->magenta_green[i] = 0.0;
|
|
|
|
color_balance_dialog->yellow_blue[i] = 0.0;
|
|
|
|
}
|
|
|
|
|
|
|
|
color_balance_dialog->drawable = gimp_image_active_drawable (gdisp->gimage);
|
|
|
|
color_balance_dialog->image_map =
|
|
|
|
image_map_create (gdisp, color_balance_dialog->drawable);
|
|
|
|
|
|
|
|
color_balance_update (color_balance_dialog, ALL);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2002-02-18 17:00:09 +00:00
|
|
|
gimp_color_balance_tool_control (GimpTool *tool,
|
|
|
|
GimpToolAction action,
|
|
|
|
GimpDisplay *gdisp)
|
2001-05-24 23:57:08 +00:00
|
|
|
{
|
|
|
|
switch (action)
|
|
|
|
{
|
|
|
|
case PAUSE:
|
|
|
|
break;
|
|
|
|
|
|
|
|
case RESUME:
|
|
|
|
break;
|
|
|
|
|
|
|
|
case HALT:
|
|
|
|
color_balance_dialog_hide ();
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2002-02-18 17:00:09 +00:00
|
|
|
GIMP_TOOL_CLASS (parent_class)->control (tool, action, gdisp);
|
2001-05-24 23:57:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
1997-11-24 22:05:25 +00:00
|
|
|
/* color balance machinery */
|
|
|
|
|
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
|
|
|
void
|
1997-11-24 22:05:25 +00:00
|
|
|
color_balance (PixelRegion *srcPR,
|
|
|
|
PixelRegion *destPR,
|
1999-11-20 18:08:41 +00:00
|
|
|
void *data)
|
1997-11-24 22:05:25 +00:00
|
|
|
{
|
|
|
|
ColorBalanceDialog *cbd;
|
2000-12-31 04:07:42 +00:00
|
|
|
guchar *src, *s;
|
|
|
|
guchar *dest, *d;
|
|
|
|
gboolean alpha;
|
|
|
|
gint r, g, b;
|
|
|
|
gint r_n, g_n, b_n;
|
|
|
|
gint w, h;
|
1997-11-24 22:05:25 +00:00
|
|
|
|
1999-11-20 18:08:41 +00:00
|
|
|
cbd = (ColorBalanceDialog *) data;
|
1997-11-24 22:05:25 +00:00
|
|
|
|
|
|
|
h = srcPR->h;
|
|
|
|
src = srcPR->data;
|
|
|
|
dest = destPR->data;
|
|
|
|
alpha = (srcPR->bytes == 4) ? TRUE : FALSE;
|
|
|
|
|
|
|
|
while (h--)
|
|
|
|
{
|
|
|
|
w = srcPR->w;
|
|
|
|
s = src;
|
|
|
|
d = dest;
|
|
|
|
while (w--)
|
|
|
|
{
|
1999-02-01 08:22:18 +00:00
|
|
|
r = s[RED_PIX];
|
|
|
|
g = s[GREEN_PIX];
|
|
|
|
b = s[BLUE_PIX];
|
|
|
|
|
|
|
|
r_n = cbd->r_lookup[r];
|
|
|
|
g_n = cbd->g_lookup[g];
|
|
|
|
b_n = cbd->b_lookup[b];
|
|
|
|
|
1997-11-24 22:05:25 +00:00
|
|
|
if (cbd->preserve_luminosity)
|
|
|
|
{
|
2000-12-31 14:58:08 +00:00
|
|
|
gimp_rgb_to_hls_int (&r_n, &g_n, &b_n);
|
|
|
|
g_n = gimp_rgb_to_l_int (r, g, b);
|
|
|
|
gimp_hls_to_rgb_int (&r_n, &g_n, &b_n);
|
1997-11-24 22:05:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
d[RED_PIX] = r_n;
|
|
|
|
d[GREEN_PIX] = g_n;
|
|
|
|
d[BLUE_PIX] = b_n;
|
|
|
|
|
|
|
|
if (alpha)
|
|
|
|
d[ALPHA_PIX] = s[ALPHA_PIX];
|
|
|
|
|
|
|
|
s += srcPR->bytes;
|
|
|
|
d += destPR->bytes;
|
|
|
|
}
|
|
|
|
|
|
|
|
src += srcPR->rowstride;
|
|
|
|
dest += destPR->rowstride;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1999-06-26 11:16:47 +00:00
|
|
|
/**************************/
|
|
|
|
/* Color Balance dialog */
|
|
|
|
/**************************/
|
1997-11-24 22:05:25 +00:00
|
|
|
|
2002-03-20 19:25:14 +00:00
|
|
|
static GtkAdjustment *
|
|
|
|
create_levels_scale (const gchar *left,
|
|
|
|
const gchar *right,
|
|
|
|
GtkWidget *table,
|
|
|
|
gint col)
|
|
|
|
{
|
|
|
|
GtkWidget *label;
|
|
|
|
GtkWidget *slider;
|
|
|
|
GtkWidget *spinbutton;
|
|
|
|
GtkAdjustment *adj;
|
|
|
|
|
|
|
|
adj = GTK_ADJUSTMENT (gtk_adjustment_new (0, -100.0, 100.0, 1.0, 10.0, 0.0));
|
|
|
|
|
|
|
|
label = gtk_label_new (left);
|
|
|
|
gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5);
|
|
|
|
gtk_table_attach (GTK_TABLE (table), label, 0, 1, col, col + 1,
|
|
|
|
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
|
|
|
|
gtk_widget_show (label);
|
|
|
|
|
|
|
|
slider = gtk_hscale_new (adj);
|
|
|
|
gtk_scale_set_draw_value (GTK_SCALE (slider), FALSE);
|
|
|
|
gtk_range_set_update_policy (GTK_RANGE (slider), GTK_UPDATE_DELAYED);
|
|
|
|
gtk_widget_set_size_request (slider, 100, -1);
|
|
|
|
gtk_table_attach_defaults (GTK_TABLE (table), slider, 1, 2, col, col + 1);
|
|
|
|
gtk_widget_show (slider);
|
|
|
|
|
|
|
|
label = gtk_label_new (right);
|
|
|
|
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
|
|
|
|
gtk_table_attach (GTK_TABLE (table), label, 2, 3, col, col + 1,
|
|
|
|
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
|
|
|
|
gtk_widget_show (label);
|
|
|
|
|
|
|
|
spinbutton = gtk_spin_button_new (adj, 1.0, 0);
|
|
|
|
gtk_widget_set_size_request (spinbutton, 75, -1);
|
|
|
|
gtk_table_attach (GTK_TABLE (table), spinbutton, 3, 4, col, col + 1,
|
|
|
|
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
|
|
|
|
gtk_widget_show (spinbutton);
|
|
|
|
|
|
|
|
return adj;
|
|
|
|
}
|
|
|
|
|
1998-03-18 22:35:31 +00:00
|
|
|
static ColorBalanceDialog *
|
1999-11-22 11:14:29 +00:00
|
|
|
color_balance_dialog_new (void)
|
1997-11-24 22:05:25 +00:00
|
|
|
{
|
|
|
|
ColorBalanceDialog *cbd;
|
|
|
|
GtkWidget *vbox;
|
|
|
|
GtkWidget *hbox;
|
|
|
|
GtkWidget *table;
|
|
|
|
GtkWidget *toggle;
|
2002-03-20 19:25:14 +00:00
|
|
|
GtkWidget *frame;
|
1999-06-26 11:16:47 +00:00
|
|
|
|
2002-03-20 19:25:14 +00:00
|
|
|
cbd = g_new0 (ColorBalanceDialog, 1);
|
1997-11-24 22:05:25 +00:00
|
|
|
cbd->preserve_luminosity = TRUE;
|
1999-11-20 18:08:41 +00:00
|
|
|
cbd->preview = TRUE;
|
2002-03-20 19:25:14 +00:00
|
|
|
cbd->transfer_mode = GIMP_MIDTONES;
|
1997-11-24 22:05:25 +00:00
|
|
|
|
|
|
|
/* The shell and main vbox */
|
1999-09-27 17:58:10 +00:00
|
|
|
cbd->shell = gimp_dialog_new (_("Color Balance"), "color_balance",
|
2001-05-24 23:57:08 +00:00
|
|
|
tool_manager_help_func, NULL,
|
1999-09-27 17:58:10 +00:00
|
|
|
GTK_WIN_POS_NONE,
|
|
|
|
FALSE, TRUE, FALSE,
|
|
|
|
|
2001-08-03 19:43:19 +00:00
|
|
|
GTK_STOCK_CANCEL, color_balance_cancel_callback,
|
2000-01-06 16:40:17 +00:00
|
|
|
cbd, NULL, NULL, FALSE, TRUE,
|
1999-09-27 17:58:10 +00:00
|
|
|
|
2002-02-07 11:50:16 +00:00
|
|
|
GIMP_STOCK_RESET, color_balance_reset_callback,
|
|
|
|
cbd, NULL, NULL, TRUE, FALSE,
|
|
|
|
|
2001-11-23 23:04:49 +00:00
|
|
|
GTK_STOCK_OK, color_balance_ok_callback,
|
|
|
|
cbd, NULL, NULL, TRUE, FALSE,
|
|
|
|
|
1999-09-27 17:58:10 +00:00
|
|
|
NULL);
|
1997-11-24 22:05:25 +00:00
|
|
|
|
1999-11-22 11:14:29 +00:00
|
|
|
vbox = gtk_vbox_new (FALSE, 4);
|
1999-11-20 18:08:41 +00:00
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (vbox), 4);
|
1999-09-27 17:58:10 +00:00
|
|
|
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (cbd->shell)->vbox), vbox);
|
2002-03-20 19:25:14 +00:00
|
|
|
gtk_widget_show (vbox);
|
1997-11-24 22:05:25 +00:00
|
|
|
|
2002-03-20 19:25:14 +00:00
|
|
|
frame = gtk_frame_new (_("Color Levels"));
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (frame);
|
1997-11-24 22:05:25 +00:00
|
|
|
|
|
|
|
/* The table containing sliders */
|
2002-03-20 19:25:14 +00:00
|
|
|
table = gtk_table_new (3, 4, FALSE);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (table), 4);
|
1999-11-22 11:14:29 +00:00
|
|
|
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
|
|
|
|
gtk_table_set_row_spacings (GTK_TABLE (table), 2);
|
2002-03-20 19:25:14 +00:00
|
|
|
gtk_container_add (GTK_CONTAINER (frame), table);
|
|
|
|
gtk_widget_show (table);
|
1999-11-22 11:14:29 +00:00
|
|
|
|
2002-03-20 19:25:14 +00:00
|
|
|
cbd->cyan_red_adj =
|
|
|
|
create_levels_scale (_("Cyan"), _("Red"), table, 0);
|
|
|
|
g_signal_connect (G_OBJECT (cbd->cyan_red_adj), "value_changed",
|
2001-08-01 02:01:49 +00:00
|
|
|
G_CALLBACK (color_balance_cr_adjustment_update),
|
|
|
|
cbd);
|
1999-11-20 18:08:41 +00:00
|
|
|
|
2002-03-20 19:25:14 +00:00
|
|
|
cbd->magenta_green_adj =
|
|
|
|
create_levels_scale (_("Magenta"), _("Green"), table, 1);
|
|
|
|
g_signal_connect (G_OBJECT (cbd->magenta_green_adj), "value_changed",
|
2001-08-01 02:01:49 +00:00
|
|
|
G_CALLBACK (color_balance_mg_adjustment_update),
|
|
|
|
cbd);
|
1999-11-20 18:08:41 +00:00
|
|
|
|
2002-03-20 19:25:14 +00:00
|
|
|
cbd->yellow_blue_adj =
|
|
|
|
create_levels_scale (_("Yellow"), _("Blue"), table, 2);
|
|
|
|
g_signal_connect (G_OBJECT (cbd->yellow_blue_adj), "value_changed",
|
2001-08-01 02:01:49 +00:00
|
|
|
G_CALLBACK (color_balance_yb_adjustment_update),
|
|
|
|
cbd);
|
1999-11-20 18:08:41 +00:00
|
|
|
|
2002-03-20 19:25:14 +00:00
|
|
|
hbox = gtk_hbox_new (FALSE, 4);
|
1997-11-24 22:05:25 +00:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
|
1999-11-22 11:14:29 +00:00
|
|
|
gtk_widget_show (hbox);
|
|
|
|
|
2002-03-20 19:25:14 +00:00
|
|
|
frame = gimp_enum_radio_frame_new (GIMP_TYPE_TRANSFER_MODE,
|
|
|
|
gtk_label_new (_("Mode")),
|
|
|
|
2,
|
|
|
|
G_CALLBACK (color_balance_range_callback),
|
|
|
|
cbd,
|
|
|
|
&toggle);
|
|
|
|
gimp_radio_group_set_active (GTK_RADIO_BUTTON (toggle),
|
|
|
|
GINT_TO_POINTER (cbd->transfer_mode));
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), frame, TRUE, TRUE, 0);
|
|
|
|
gtk_widget_show (frame);
|
1999-11-22 11:14:29 +00:00
|
|
|
|
2002-03-20 19:25:14 +00:00
|
|
|
vbox = gtk_vbox_new (FALSE, 4);
|
|
|
|
gtk_box_pack_end (GTK_BOX (hbox), vbox, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (vbox);
|
1999-11-22 11:14:29 +00:00
|
|
|
|
|
|
|
toggle = gtk_check_button_new_with_label (_("Preview"));
|
|
|
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle), cbd->preview);
|
2002-03-20 19:25:14 +00:00
|
|
|
gtk_box_pack_end (GTK_BOX (vbox), toggle, FALSE, FALSE, 0);
|
2001-08-01 02:01:49 +00:00
|
|
|
g_signal_connect (G_OBJECT (toggle), "toggled",
|
|
|
|
G_CALLBACK (color_balance_preview_update),
|
|
|
|
cbd);
|
1999-11-22 11:14:29 +00:00
|
|
|
gtk_widget_show (toggle);
|
|
|
|
|
2002-03-20 19:25:14 +00:00
|
|
|
toggle = gtk_check_button_new_with_label (_("Preserve Luminosity"));
|
|
|
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle),
|
|
|
|
cbd->preserve_luminosity);
|
|
|
|
gtk_box_pack_end (GTK_BOX (vbox), toggle, FALSE, FALSE, 0);
|
|
|
|
g_signal_connect (G_OBJECT (toggle), "toggled",
|
|
|
|
G_CALLBACK (color_balance_preserve_update),
|
|
|
|
cbd);
|
|
|
|
gtk_widget_show (toggle);
|
1997-11-24 22:05:25 +00:00
|
|
|
|
|
|
|
gtk_widget_show (cbd->shell);
|
|
|
|
|
|
|
|
return cbd;
|
|
|
|
}
|
|
|
|
|
2001-10-17 11:33:43 +00:00
|
|
|
static void
|
|
|
|
color_balance_dialog_hide (void)
|
|
|
|
{
|
|
|
|
if (color_balance_dialog)
|
|
|
|
color_balance_cancel_callback (NULL, (gpointer) color_balance_dialog);
|
|
|
|
}
|
|
|
|
|
1997-11-24 22:05:25 +00:00
|
|
|
static void
|
|
|
|
color_balance_update (ColorBalanceDialog *cbd,
|
1999-11-20 18:08:41 +00:00
|
|
|
gint update)
|
1997-11-24 22:05:25 +00:00
|
|
|
{
|
1999-11-20 18:08:41 +00:00
|
|
|
if (update & CYAN_RED)
|
1997-11-24 22:05:25 +00:00
|
|
|
{
|
2002-03-20 19:25:14 +00:00
|
|
|
gtk_adjustment_set_value (cbd->cyan_red_adj,
|
|
|
|
cbd->cyan_red[cbd->transfer_mode]);
|
1997-11-24 22:05:25 +00:00
|
|
|
}
|
1999-11-20 18:08:41 +00:00
|
|
|
if (update & MAGENTA_GREEN)
|
1997-11-24 22:05:25 +00:00
|
|
|
{
|
2002-03-20 19:25:14 +00:00
|
|
|
gtk_adjustment_set_value (cbd->magenta_green_adj,
|
|
|
|
cbd->magenta_green[cbd->transfer_mode]);
|
1997-11-24 22:05:25 +00:00
|
|
|
}
|
1999-11-20 18:08:41 +00:00
|
|
|
if (update & YELLOW_BLUE)
|
1997-11-24 22:05:25 +00:00
|
|
|
{
|
2002-03-20 19:25:14 +00:00
|
|
|
gtk_adjustment_set_value (cbd->yellow_blue_adj,
|
|
|
|
cbd->yellow_blue[cbd->transfer_mode]);
|
1997-11-24 22:05:25 +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
|
|
|
void
|
1999-02-01 08:22:18 +00:00
|
|
|
color_balance_create_lookup_tables (ColorBalanceDialog *cbd)
|
|
|
|
{
|
1999-11-20 18:08:41 +00:00
|
|
|
gdouble *cyan_red_transfer[3];
|
|
|
|
gdouble *magenta_green_transfer[3];
|
|
|
|
gdouble *yellow_blue_transfer[3];
|
|
|
|
gint i;
|
1999-02-07 22:13:10 +00:00
|
|
|
gint32 r_n, g_n, b_n;
|
1999-11-20 18:08:41 +00:00
|
|
|
|
1999-02-01 08:22:18 +00:00
|
|
|
/* Set the transfer arrays (for speed) */
|
2002-03-20 19:25:14 +00:00
|
|
|
cyan_red_transfer[GIMP_SHADOWS] =
|
|
|
|
(cbd->cyan_red[GIMP_SHADOWS] > 0) ? shadows_add : shadows_sub;
|
|
|
|
cyan_red_transfer[GIMP_MIDTONES] =
|
|
|
|
(cbd->cyan_red[GIMP_MIDTONES] > 0) ? midtones_add : midtones_sub;
|
|
|
|
cyan_red_transfer[GIMP_HIGHLIGHTS] =
|
|
|
|
(cbd->cyan_red[GIMP_HIGHLIGHTS] > 0) ? highlights_add : highlights_sub;
|
|
|
|
|
|
|
|
magenta_green_transfer[GIMP_SHADOWS] =
|
|
|
|
(cbd->magenta_green[GIMP_SHADOWS] > 0) ? shadows_add : shadows_sub;
|
|
|
|
magenta_green_transfer[GIMP_MIDTONES] =
|
|
|
|
(cbd->magenta_green[GIMP_MIDTONES] > 0) ? midtones_add : midtones_sub;
|
|
|
|
magenta_green_transfer[GIMP_HIGHLIGHTS] =
|
|
|
|
(cbd->magenta_green[GIMP_HIGHLIGHTS] > 0) ? highlights_add : highlights_sub;
|
|
|
|
yellow_blue_transfer[GIMP_SHADOWS] =
|
|
|
|
(cbd->yellow_blue[GIMP_SHADOWS] > 0) ? shadows_add : shadows_sub;
|
|
|
|
yellow_blue_transfer[GIMP_MIDTONES] =
|
|
|
|
(cbd->yellow_blue[GIMP_MIDTONES] > 0) ? midtones_add : midtones_sub;
|
|
|
|
yellow_blue_transfer[GIMP_HIGHLIGHTS] =
|
|
|
|
(cbd->yellow_blue[GIMP_HIGHLIGHTS] > 0) ? highlights_add : highlights_sub;
|
1999-02-01 08:22:18 +00:00
|
|
|
|
|
|
|
for (i = 0; i < 256; i++)
|
1999-11-20 18:08:41 +00:00
|
|
|
{
|
|
|
|
r_n = i;
|
|
|
|
g_n = i;
|
|
|
|
b_n = i;
|
|
|
|
|
2001-08-01 02:01:49 +00:00
|
|
|
r_n += cbd->cyan_red[GIMP_SHADOWS] * cyan_red_transfer[GIMP_SHADOWS][r_n];
|
1999-11-20 18:08:41 +00:00
|
|
|
r_n = CLAMP0255 (r_n);
|
2001-08-01 02:01:49 +00:00
|
|
|
r_n += cbd->cyan_red[GIMP_MIDTONES] * cyan_red_transfer[GIMP_MIDTONES][r_n];
|
1999-11-20 18:08:41 +00:00
|
|
|
r_n = CLAMP0255 (r_n);
|
2001-08-01 02:01:49 +00:00
|
|
|
r_n += cbd->cyan_red[GIMP_HIGHLIGHTS] * cyan_red_transfer[GIMP_HIGHLIGHTS][r_n];
|
1999-11-20 18:08:41 +00:00
|
|
|
r_n = CLAMP0255 (r_n);
|
|
|
|
|
2001-08-01 02:01:49 +00:00
|
|
|
g_n += cbd->magenta_green[GIMP_SHADOWS] * magenta_green_transfer[GIMP_SHADOWS][g_n];
|
1999-11-20 18:08:41 +00:00
|
|
|
g_n = CLAMP0255 (g_n);
|
2001-08-01 02:01:49 +00:00
|
|
|
g_n += cbd->magenta_green[GIMP_MIDTONES] * magenta_green_transfer[GIMP_MIDTONES][g_n];
|
1999-11-20 18:08:41 +00:00
|
|
|
g_n = CLAMP0255 (g_n);
|
2001-08-01 02:01:49 +00:00
|
|
|
g_n += cbd->magenta_green[GIMP_HIGHLIGHTS] * magenta_green_transfer[GIMP_HIGHLIGHTS][g_n];
|
1999-11-20 18:08:41 +00:00
|
|
|
g_n = CLAMP0255 (g_n);
|
|
|
|
|
2001-08-01 02:01:49 +00:00
|
|
|
b_n += cbd->yellow_blue[GIMP_SHADOWS] * yellow_blue_transfer[GIMP_SHADOWS][b_n];
|
1999-11-20 18:08:41 +00:00
|
|
|
b_n = CLAMP0255 (b_n);
|
2001-08-01 02:01:49 +00:00
|
|
|
b_n += cbd->yellow_blue[GIMP_MIDTONES] * yellow_blue_transfer[GIMP_MIDTONES][b_n];
|
1999-11-20 18:08:41 +00:00
|
|
|
b_n = CLAMP0255 (b_n);
|
2001-08-01 02:01:49 +00:00
|
|
|
b_n += cbd->yellow_blue[GIMP_HIGHLIGHTS] * yellow_blue_transfer[GIMP_HIGHLIGHTS][b_n];
|
1999-11-20 18:08:41 +00:00
|
|
|
b_n = CLAMP0255 (b_n);
|
|
|
|
|
|
|
|
cbd->r_lookup[i] = r_n;
|
|
|
|
cbd->g_lookup[i] = g_n;
|
|
|
|
cbd->b_lookup[i] = b_n;
|
|
|
|
}
|
1999-02-01 08:22:18 +00:00
|
|
|
}
|
|
|
|
|
1997-11-24 22:05:25 +00:00
|
|
|
static void
|
|
|
|
color_balance_preview (ColorBalanceDialog *cbd)
|
|
|
|
{
|
2001-07-07 17:36:00 +00:00
|
|
|
GimpTool *active_tool;
|
|
|
|
|
|
|
|
active_tool = tool_manager_get_active (the_gimp);
|
|
|
|
|
1997-11-24 22:05:25 +00:00
|
|
|
if (!cbd->image_map)
|
1999-11-22 11:14:29 +00:00
|
|
|
{
|
|
|
|
g_message ("color_balance_preview(): No image map");
|
|
|
|
return;
|
|
|
|
}
|
1999-11-20 18:08:41 +00:00
|
|
|
|
1998-03-31 07:23:50 +00:00
|
|
|
active_tool->preserve = TRUE;
|
1999-11-20 18:08:41 +00:00
|
|
|
color_balance_create_lookup_tables (cbd);
|
1997-11-24 22:05:25 +00:00
|
|
|
image_map_apply (cbd->image_map, color_balance, (void *) cbd);
|
1998-03-31 07:23:50 +00:00
|
|
|
active_tool->preserve = FALSE;
|
1997-11-24 22:05:25 +00:00
|
|
|
}
|
|
|
|
|
1999-11-22 11:14:29 +00:00
|
|
|
static void
|
|
|
|
color_balance_reset_callback (GtkWidget *widget,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
ColorBalanceDialog *cbd;
|
|
|
|
|
|
|
|
cbd = (ColorBalanceDialog *) data;
|
|
|
|
|
2002-03-20 19:25:14 +00:00
|
|
|
cbd->cyan_red[cbd->transfer_mode] = 0.0;
|
|
|
|
cbd->magenta_green[cbd->transfer_mode] = 0.0;
|
|
|
|
cbd->yellow_blue[cbd->transfer_mode] = 0.0;
|
1999-11-22 11:14:29 +00:00
|
|
|
|
|
|
|
color_balance_update (cbd, ALL);
|
|
|
|
|
|
|
|
if (cbd->preview)
|
|
|
|
color_balance_preview (cbd);
|
|
|
|
}
|
|
|
|
|
1997-11-24 22:05:25 +00:00
|
|
|
static void
|
|
|
|
color_balance_ok_callback (GtkWidget *widget,
|
1999-11-20 18:08:41 +00:00
|
|
|
gpointer data)
|
1997-11-24 22:05:25 +00:00
|
|
|
{
|
|
|
|
ColorBalanceDialog *cbd;
|
2001-07-07 17:36:00 +00:00
|
|
|
GimpTool *active_tool;
|
1997-11-24 22:05:25 +00:00
|
|
|
|
1999-11-20 18:08:41 +00:00
|
|
|
cbd = (ColorBalanceDialog *) data;
|
1997-11-24 22:05:25 +00:00
|
|
|
|
2001-10-17 11:33:43 +00:00
|
|
|
gtk_widget_hide (cbd->shell);
|
1998-03-31 07:23:50 +00:00
|
|
|
|
2001-07-07 17:36:00 +00:00
|
|
|
active_tool = tool_manager_get_active (the_gimp);
|
|
|
|
|
1998-03-31 07:23:50 +00:00
|
|
|
active_tool->preserve = TRUE;
|
1997-11-24 22:05:25 +00:00
|
|
|
|
|
|
|
if (!cbd->preview)
|
|
|
|
image_map_apply (cbd->image_map, color_balance, (void *) cbd);
|
|
|
|
|
|
|
|
if (cbd->image_map)
|
|
|
|
image_map_commit (cbd->image_map);
|
|
|
|
|
1998-03-31 07:23:50 +00:00
|
|
|
active_tool->preserve = FALSE;
|
|
|
|
|
1997-11-24 22:05:25 +00:00
|
|
|
cbd->image_map = NULL;
|
1999-06-26 11:16:47 +00:00
|
|
|
|
2000-12-31 04:07:42 +00:00
|
|
|
active_tool->gdisp = NULL;
|
1999-06-26 11:16:47 +00:00
|
|
|
active_tool->drawable = NULL;
|
1997-11-24 22:05:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
color_balance_cancel_callback (GtkWidget *widget,
|
1999-11-20 18:08:41 +00:00
|
|
|
gpointer data)
|
1997-11-24 22:05:25 +00:00
|
|
|
{
|
|
|
|
ColorBalanceDialog *cbd;
|
2001-07-07 17:36:00 +00:00
|
|
|
GimpTool *active_tool;
|
1997-11-24 22:05:25 +00:00
|
|
|
|
1999-11-20 18:08:41 +00:00
|
|
|
cbd = (ColorBalanceDialog *) data;
|
|
|
|
|
2001-10-17 11:33:43 +00:00
|
|
|
gtk_widget_hide (cbd->shell);
|
1997-11-24 22:05:25 +00:00
|
|
|
|
2001-07-07 17:36:00 +00:00
|
|
|
active_tool = tool_manager_get_active (the_gimp);
|
|
|
|
|
1997-11-24 22:05:25 +00:00
|
|
|
if (cbd->image_map)
|
|
|
|
{
|
1998-03-31 07:23:50 +00:00
|
|
|
active_tool->preserve = TRUE;
|
1997-11-24 22:05:25 +00:00
|
|
|
image_map_abort (cbd->image_map);
|
1998-03-31 07:23:50 +00:00
|
|
|
active_tool->preserve = FALSE;
|
1999-06-26 11:16:47 +00:00
|
|
|
|
1997-11-24 22:05:25 +00:00
|
|
|
gdisplays_flush ();
|
1999-06-26 11:16:47 +00:00
|
|
|
cbd->image_map = NULL;
|
1997-11-24 22:05:25 +00:00
|
|
|
}
|
|
|
|
|
2000-12-31 04:07:42 +00:00
|
|
|
active_tool->gdisp = NULL;
|
1999-06-26 11:16:47 +00:00
|
|
|
active_tool->drawable = NULL;
|
1997-11-24 22:05:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
1999-11-22 11:14:29 +00:00
|
|
|
color_balance_range_callback (GtkWidget *widget,
|
|
|
|
gpointer data)
|
1997-11-24 22:05:25 +00:00
|
|
|
{
|
2002-03-20 19:25:14 +00:00
|
|
|
ColorBalanceDialog *cbd = (ColorBalanceDialog *) data;
|
1999-11-20 18:08:41 +00:00
|
|
|
|
2002-03-20 19:25:14 +00:00
|
|
|
gimp_radio_button_update (widget, &cbd->transfer_mode);
|
1999-11-20 18:08:41 +00:00
|
|
|
|
1997-11-24 22:05:25 +00:00
|
|
|
color_balance_update (cbd, ALL);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
1999-11-20 18:08:41 +00:00
|
|
|
color_balance_preserve_update (GtkWidget *widget,
|
1997-11-24 22:05:25 +00:00
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
ColorBalanceDialog *cbd;
|
|
|
|
|
|
|
|
cbd = (ColorBalanceDialog *) data;
|
|
|
|
|
1999-11-20 18:08:41 +00:00
|
|
|
if (GTK_TOGGLE_BUTTON (widget)->active)
|
|
|
|
cbd->preserve_luminosity = TRUE;
|
1997-11-24 22:05:25 +00:00
|
|
|
else
|
1999-11-20 18:08:41 +00:00
|
|
|
cbd->preserve_luminosity = FALSE;
|
|
|
|
|
|
|
|
if (cbd->preview)
|
|
|
|
color_balance_preview (cbd);
|
1997-11-24 22:05:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
1999-11-20 18:08:41 +00:00
|
|
|
color_balance_preview_update (GtkWidget *widget,
|
1997-11-24 22:05:25 +00:00
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
ColorBalanceDialog *cbd;
|
2001-07-07 17:36:00 +00:00
|
|
|
GimpTool *active_tool;
|
1997-11-24 22:05:25 +00:00
|
|
|
|
|
|
|
cbd = (ColorBalanceDialog *) data;
|
|
|
|
|
1999-11-20 18:08:41 +00:00
|
|
|
if (GTK_TOGGLE_BUTTON (widget)->active)
|
1997-11-24 22:05:25 +00:00
|
|
|
{
|
|
|
|
cbd->preview = TRUE;
|
|
|
|
color_balance_preview (cbd);
|
|
|
|
}
|
|
|
|
else
|
2000-05-09 05:43:29 +00:00
|
|
|
{
|
|
|
|
cbd->preview = FALSE;
|
|
|
|
if (cbd->image_map)
|
|
|
|
{
|
2001-07-07 17:36:00 +00:00
|
|
|
active_tool = tool_manager_get_active (the_gimp);
|
|
|
|
|
2000-05-09 05:43:29 +00:00
|
|
|
active_tool->preserve = TRUE;
|
|
|
|
image_map_clear (cbd->image_map);
|
|
|
|
active_tool->preserve = FALSE;
|
|
|
|
gdisplays_flush ();
|
|
|
|
}
|
|
|
|
}
|
1997-11-24 22:05:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
1999-11-20 18:08:41 +00:00
|
|
|
color_balance_cr_adjustment_update (GtkAdjustment *adjustment,
|
|
|
|
gpointer data)
|
1997-11-24 22:05:25 +00:00
|
|
|
{
|
|
|
|
ColorBalanceDialog *cbd;
|
|
|
|
|
|
|
|
cbd = (ColorBalanceDialog *) data;
|
|
|
|
|
2002-03-20 19:25:14 +00:00
|
|
|
if (cbd->cyan_red[cbd->transfer_mode] != adjustment->value)
|
1997-11-24 22:05:25 +00:00
|
|
|
{
|
2002-03-20 19:25:14 +00:00
|
|
|
cbd->cyan_red[cbd->transfer_mode] = adjustment->value;
|
1997-11-24 22:05:25 +00:00
|
|
|
|
|
|
|
if (cbd->preview)
|
|
|
|
color_balance_preview (cbd);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
1999-11-20 18:08:41 +00:00
|
|
|
color_balance_mg_adjustment_update (GtkAdjustment *adjustment,
|
|
|
|
gpointer data)
|
1997-11-24 22:05:25 +00:00
|
|
|
{
|
|
|
|
ColorBalanceDialog *cbd;
|
|
|
|
|
|
|
|
cbd = (ColorBalanceDialog *) data;
|
|
|
|
|
2002-03-20 19:25:14 +00:00
|
|
|
if (cbd->magenta_green[cbd->transfer_mode] != adjustment->value)
|
1997-11-24 22:05:25 +00:00
|
|
|
{
|
2002-03-20 19:25:14 +00:00
|
|
|
cbd->magenta_green[cbd->transfer_mode] = adjustment->value;
|
1997-11-24 22:05:25 +00:00
|
|
|
|
|
|
|
if (cbd->preview)
|
|
|
|
color_balance_preview (cbd);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
1999-11-20 18:08:41 +00:00
|
|
|
color_balance_yb_adjustment_update (GtkAdjustment *adjustment,
|
|
|
|
gpointer data)
|
1997-11-24 22:05:25 +00:00
|
|
|
{
|
|
|
|
ColorBalanceDialog *cbd;
|
|
|
|
|
|
|
|
cbd = (ColorBalanceDialog *) data;
|
|
|
|
|
2002-03-20 19:25:14 +00:00
|
|
|
if (cbd->yellow_blue[cbd->transfer_mode] != adjustment->value)
|
1997-11-24 22:05:25 +00:00
|
|
|
{
|
2002-03-20 19:25:14 +00:00
|
|
|
cbd->yellow_blue[cbd->transfer_mode] = adjustment->value;
|
1997-11-24 22:05:25 +00:00
|
|
|
|
|
|
|
if (cbd->preview)
|
|
|
|
color_balance_preview (cbd);
|
|
|
|
}
|
|
|
|
}
|