1997-12-09 13:57:33 +08:00
|
|
|
/* The GIMP -- an image manipulation program
|
|
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
|
|
|
* Colorify. Changes the pixel's luminosity to a specified color
|
|
|
|
* Copyright (C) 1997 Francisco Bustamante
|
|
|
|
*
|
|
|
|
* 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-12-09 13:57:33 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
/* Changes:
|
|
|
|
|
|
|
|
1.1
|
|
|
|
-Corrected small bug when calling color selection dialog
|
|
|
|
-Added LUTs to speed things a little bit up
|
|
|
|
|
|
|
|
1.0
|
|
|
|
-First release */
|
|
|
|
|
2000-01-07 00:40:17 +08:00
|
|
|
#include "config.h"
|
|
|
|
|
1997-12-09 13:57:33 +08:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
2000-01-07 00:40:17 +08:00
|
|
|
|
|
|
|
#include <gtk/gtk.h>
|
|
|
|
|
2000-01-13 23:39:26 +08:00
|
|
|
#include <libgimp/gimp.h>
|
|
|
|
#include <libgimp/gimpui.h>
|
1997-12-09 13:57:33 +08:00
|
|
|
|
1999-05-30 00:35:47 +08:00
|
|
|
#include "libgimp/stdplugins-intl.h"
|
|
|
|
|
2000-05-01 05:03:44 +08:00
|
|
|
|
2000-01-26 07:11:20 +08:00
|
|
|
#define PLUG_IN_NAME "plug_in_colorify"
|
1997-12-09 13:57:33 +08:00
|
|
|
#define PLUG_IN_VERSION "1.1"
|
|
|
|
|
2000-01-26 07:11:20 +08:00
|
|
|
#define COLOR_SIZE 30
|
|
|
|
|
1997-12-09 13:57:33 +08:00
|
|
|
static void query (void);
|
2001-01-12 07:36:59 +08:00
|
|
|
static void run (gchar *name,
|
|
|
|
gint nparams,
|
|
|
|
GimpParam *param,
|
|
|
|
gint *nreturn_vals,
|
|
|
|
GimpParam **return_vals);
|
|
|
|
|
|
|
|
static void colorify (GimpDrawable *drawable);
|
|
|
|
static void colorify_row (guchar *row,
|
|
|
|
gint width,
|
|
|
|
gint bpp);
|
|
|
|
|
|
|
|
static gboolean colorify_dialog (GimpRGB *color);
|
|
|
|
static void colorify_ok_callback (GtkWidget *widget,
|
|
|
|
gpointer data);
|
|
|
|
static void predefined_color_callback (GtkWidget *widget,
|
|
|
|
gpointer data);
|
2000-01-13 23:39:26 +08:00
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
2001-01-12 07:36:59 +08:00
|
|
|
GimpRGB color;
|
1997-12-09 13:57:33 +08:00
|
|
|
} ColorifyVals;
|
|
|
|
|
2000-01-13 23:39:26 +08:00
|
|
|
typedef struct
|
|
|
|
{
|
2001-01-12 07:36:59 +08:00
|
|
|
gboolean run;
|
1997-12-09 13:57:33 +08:00
|
|
|
} ColorifyInterface;
|
|
|
|
|
|
|
|
static ColorifyInterface cint =
|
|
|
|
{
|
2000-01-13 23:39:26 +08:00
|
|
|
FALSE
|
1997-12-09 13:57:33 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
static ColorifyVals cvals =
|
|
|
|
{
|
2001-01-12 07:36:59 +08:00
|
|
|
{ 1.0, 1.0, 1.0, 1.0 }
|
1997-12-09 13:57:33 +08:00
|
|
|
};
|
|
|
|
|
2001-01-11 06:49:45 +08:00
|
|
|
static GimpRGB button_color[] =
|
1997-12-09 13:57:33 +08:00
|
|
|
{
|
2001-01-11 06:49:45 +08:00
|
|
|
{ 1.0, 0.0, 0.0, 1.0 },
|
|
|
|
{ 1.0, 1.0, 0.0, 1.0 },
|
|
|
|
{ 0.0, 1.0, 0.0, 1.0 },
|
|
|
|
{ 0.0, 1.0, 1.0, 1.0 },
|
|
|
|
{ 0.0, 0.0, 1.0, 1.0 },
|
|
|
|
{ 1.0, 0.0, 1.0, 1.0 },
|
|
|
|
{ 1.0, 1.0, 1.0, 1.0 },
|
1997-12-09 13:57:33 +08:00
|
|
|
};
|
|
|
|
|
2000-08-22 09:26:57 +08:00
|
|
|
GimpPlugInInfo PLUG_IN_INFO =
|
1997-12-09 13:57:33 +08:00
|
|
|
{
|
2000-01-13 23:39:26 +08:00
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
query,
|
|
|
|
run,
|
1997-12-09 13:57:33 +08:00
|
|
|
};
|
|
|
|
|
2000-05-01 05:03:44 +08:00
|
|
|
static gint sel_x1, sel_x2, sel_y1, sel_y2;
|
|
|
|
static gint sel_width, sel_height;
|
|
|
|
static GtkWidget *custum_color_button = NULL;
|
|
|
|
|
|
|
|
static gint lum_red_lookup[256];
|
|
|
|
static gint lum_green_lookup[256];
|
|
|
|
static gint lum_blue_lookup[256];
|
|
|
|
static gint final_red_lookup[256];
|
|
|
|
static gint final_green_lookup[256];
|
|
|
|
static gint final_blue_lookup[256];
|
|
|
|
|
1997-12-09 13:57:33 +08:00
|
|
|
|
|
|
|
MAIN ()
|
|
|
|
|
|
|
|
static void
|
2000-01-13 23:39:26 +08:00
|
|
|
query (void)
|
1997-12-09 13:57:33 +08:00
|
|
|
{
|
2000-08-22 09:26:57 +08:00
|
|
|
static GimpParamDef args[] =
|
2000-01-13 23:39:26 +08:00
|
|
|
{
|
2000-08-22 09:26:57 +08:00
|
|
|
{ GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" },
|
|
|
|
{ GIMP_PDB_IMAGE, "image", "Input image" },
|
|
|
|
{ GIMP_PDB_DRAWABLE, "drawable", "Input drawable" },
|
|
|
|
{ GIMP_PDB_COLOR, "color", "Color to apply"}
|
2000-01-13 23:39:26 +08:00
|
|
|
};
|
2000-05-01 05:03:44 +08:00
|
|
|
static gint nargs = sizeof (args) / sizeof (args[0]);
|
2000-01-13 23:39:26 +08:00
|
|
|
|
|
|
|
gimp_install_procedure ("plug_in_colorify",
|
2000-01-31 10:32:30 +08:00
|
|
|
"Similar to the \"Color\" mode for layers.",
|
2000-05-01 05:03:44 +08:00
|
|
|
"Makes an average of the RGB channels and uses it "
|
|
|
|
"to set the color",
|
2000-01-13 23:39:26 +08:00
|
|
|
"Francisco Bustamante",
|
|
|
|
"Francisco Bustamante",
|
|
|
|
"0.0.1",
|
|
|
|
N_("<Image>/Filters/Colors/Colorify..."),
|
|
|
|
"RGB*",
|
2000-08-22 09:26:57 +08:00
|
|
|
GIMP_PLUGIN,
|
2000-05-01 05:03:44 +08:00
|
|
|
nargs, 0,
|
|
|
|
args, NULL);
|
1997-12-09 13:57:33 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2001-01-12 07:36:59 +08:00
|
|
|
run (gchar *name,
|
|
|
|
gint nparams,
|
2000-08-22 09:26:57 +08:00
|
|
|
GimpParam *param,
|
2001-01-12 07:36:59 +08:00
|
|
|
gint *nreturn_vals,
|
2000-08-22 09:26:57 +08:00
|
|
|
GimpParam **return_vals)
|
1997-12-09 13:57:33 +08:00
|
|
|
{
|
2001-01-12 07:36:59 +08:00
|
|
|
GimpRunModeType run_mode;
|
|
|
|
GimpPDBStatusType status;
|
|
|
|
static GimpParam values[1];
|
|
|
|
GimpDrawable *drawable;
|
1999-05-30 00:35:47 +08:00
|
|
|
|
2000-01-13 23:39:26 +08:00
|
|
|
INIT_I18N_UI();
|
1997-12-09 13:57:33 +08:00
|
|
|
|
2000-08-22 09:26:57 +08:00
|
|
|
status = GIMP_PDB_SUCCESS;
|
2000-01-13 23:39:26 +08:00
|
|
|
run_mode = param[0].data.d_int32;
|
1997-12-09 13:57:33 +08:00
|
|
|
|
2000-08-22 09:26:57 +08:00
|
|
|
values[0].type = GIMP_PDB_STATUS;
|
2000-01-13 23:39:26 +08:00
|
|
|
values[0].data.d_status = status;
|
1997-12-09 13:57:33 +08:00
|
|
|
|
2000-01-13 23:39:26 +08:00
|
|
|
*nreturn_vals = 1;
|
|
|
|
*return_vals = values;
|
1997-12-09 13:57:33 +08:00
|
|
|
|
2000-01-13 23:39:26 +08:00
|
|
|
drawable = gimp_drawable_get (param[2].data.d_drawable);
|
1997-12-09 13:57:33 +08:00
|
|
|
|
2000-01-13 23:39:26 +08:00
|
|
|
gimp_drawable_mask_bounds (drawable->id, &sel_x1, &sel_y1, &sel_x2, &sel_y2);
|
1997-12-09 13:57:33 +08:00
|
|
|
|
2000-01-13 23:39:26 +08:00
|
|
|
sel_width = sel_x2 - sel_x1;
|
|
|
|
sel_height = sel_y2 - sel_y1;
|
1997-12-09 13:57:33 +08:00
|
|
|
|
2000-01-13 23:39:26 +08:00
|
|
|
switch (run_mode)
|
|
|
|
{
|
2000-08-22 09:26:57 +08:00
|
|
|
case GIMP_RUN_INTERACTIVE:
|
2000-01-13 23:39:26 +08:00
|
|
|
gimp_get_data (PLUG_IN_NAME, &cvals);
|
2001-01-12 07:36:59 +08:00
|
|
|
if (!colorify_dialog (&cvals.color))
|
2000-01-13 23:39:26 +08:00
|
|
|
return;
|
|
|
|
break;
|
1997-12-09 13:57:33 +08:00
|
|
|
|
2000-08-22 09:26:57 +08:00
|
|
|
case GIMP_RUN_NONINTERACTIVE:
|
2000-01-13 23:39:26 +08:00
|
|
|
if (nparams != 4)
|
2000-08-22 09:26:57 +08:00
|
|
|
status = GIMP_PDB_CALLING_ERROR;
|
1997-12-09 13:57:33 +08:00
|
|
|
|
2000-08-22 09:26:57 +08:00
|
|
|
if (status == GIMP_PDB_SUCCESS)
|
2001-01-25 09:20:05 +08:00
|
|
|
cvals.color = param[3].data.d_color;
|
2000-01-13 23:39:26 +08:00
|
|
|
break;
|
|
|
|
|
2000-08-22 09:26:57 +08:00
|
|
|
case GIMP_RUN_WITH_LAST_VALS:
|
2000-01-13 23:39:26 +08:00
|
|
|
/* Possibly retrieve data */
|
|
|
|
gimp_get_data (PLUG_IN_NAME, &cvals);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
1997-12-09 13:57:33 +08:00
|
|
|
|
2000-08-22 09:26:57 +08:00
|
|
|
if (status == GIMP_PDB_SUCCESS)
|
2000-01-13 23:39:26 +08:00
|
|
|
{
|
|
|
|
gimp_progress_init (_("Colorifying..."));
|
1997-12-09 13:57:33 +08:00
|
|
|
|
2000-01-13 23:39:26 +08:00
|
|
|
colorify (drawable);
|
1997-12-09 13:57:33 +08:00
|
|
|
|
2000-08-22 09:26:57 +08:00
|
|
|
if (run_mode == GIMP_RUN_INTERACTIVE)
|
2000-01-13 23:39:26 +08:00
|
|
|
gimp_set_data (PLUG_IN_NAME, &cvals, sizeof (ColorifyVals));
|
1997-12-09 13:57:33 +08:00
|
|
|
|
2000-08-22 09:26:57 +08:00
|
|
|
if (run_mode != GIMP_RUN_NONINTERACTIVE)
|
2000-01-13 23:39:26 +08:00
|
|
|
{
|
|
|
|
gimp_displays_flush ();
|
1997-12-09 13:57:33 +08:00
|
|
|
}
|
2000-01-13 23:39:26 +08:00
|
|
|
}
|
1997-12-09 13:57:33 +08:00
|
|
|
|
2000-01-13 23:39:26 +08:00
|
|
|
values[0].data.d_status = status;
|
1997-12-09 13:57:33 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2000-08-22 09:26:57 +08:00
|
|
|
colorify (GimpDrawable *drawable)
|
1997-12-09 13:57:33 +08:00
|
|
|
{
|
2001-01-12 07:36:59 +08:00
|
|
|
GimpPixelRgn source_region;
|
|
|
|
GimpPixelRgn dest_region;
|
2000-01-13 23:39:26 +08:00
|
|
|
guchar *row;
|
2001-01-12 07:36:59 +08:00
|
|
|
gint bpp;
|
|
|
|
gint y = 0;
|
|
|
|
gint i = 0;
|
|
|
|
gint progress = 0;
|
2000-01-13 23:39:26 +08:00
|
|
|
|
|
|
|
for (i = 0; i < 256; i ++)
|
|
|
|
{
|
2000-01-31 07:56:04 +08:00
|
|
|
lum_red_lookup[i] = i * INTENSITY_RED;
|
|
|
|
lum_green_lookup[i] = i * INTENSITY_GREEN;
|
|
|
|
lum_blue_lookup[i] = i * INTENSITY_BLUE;
|
2001-01-12 07:36:59 +08:00
|
|
|
final_red_lookup[i] = i * cvals.color.r;
|
|
|
|
final_green_lookup[i] = i * cvals.color.g;
|
|
|
|
final_blue_lookup[i] = i * cvals.color.b;
|
2000-01-13 23:39:26 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
bpp = gimp_drawable_bpp (drawable->id);
|
|
|
|
row = g_new (guchar, sel_width * bpp);
|
|
|
|
|
2000-01-26 03:11:57 +08:00
|
|
|
gimp_tile_cache_ntiles (2 * (sel_width / gimp_tile_width()) + 1);
|
|
|
|
|
2000-01-13 23:39:26 +08:00
|
|
|
gimp_pixel_rgn_init (&source_region, drawable,
|
|
|
|
sel_x1, sel_y1, sel_width, sel_height, FALSE, FALSE);
|
|
|
|
gimp_pixel_rgn_init (&dest_region, drawable,
|
|
|
|
sel_x1, sel_y1, sel_width, sel_height, TRUE, TRUE);
|
|
|
|
|
|
|
|
for (y = sel_y1; y < sel_y2; y++)
|
|
|
|
{
|
|
|
|
gimp_pixel_rgn_get_row (&source_region, row, sel_x1, y, sel_width);
|
|
|
|
|
|
|
|
colorify_row (row, sel_width, bpp);
|
|
|
|
|
|
|
|
gimp_pixel_rgn_set_row (&dest_region, row, sel_x1, y, sel_width);
|
2001-01-12 07:36:59 +08:00
|
|
|
gimp_progress_update ((gdouble) ++progress / (gdouble) sel_height);
|
2000-01-13 23:39:26 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
g_free (row);
|
|
|
|
|
|
|
|
gimp_drawable_flush (drawable);
|
|
|
|
gimp_drawable_merge_shadow (drawable->id, TRUE);
|
|
|
|
gimp_drawable_update (drawable->id, sel_x1, sel_y1, sel_width, sel_height);
|
1997-12-09 13:57:33 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
colorify_row (guchar *row,
|
2000-01-13 23:39:26 +08:00
|
|
|
gint width,
|
|
|
|
gint bpp)
|
1997-12-09 13:57:33 +08:00
|
|
|
{
|
2001-01-12 07:36:59 +08:00
|
|
|
gint cur_x;
|
|
|
|
gint lum; /* luminosity */
|
2000-01-13 23:39:26 +08:00
|
|
|
guchar *current = row;
|
|
|
|
|
|
|
|
for (cur_x = 0; cur_x < width; cur_x++)
|
|
|
|
{
|
|
|
|
lum = (lum_red_lookup[current[0]] +
|
|
|
|
lum_green_lookup[current[1]] +
|
|
|
|
lum_blue_lookup[current[2]]);
|
|
|
|
|
|
|
|
current[0] = final_red_lookup[lum];
|
|
|
|
current[1] = final_green_lookup[lum];
|
|
|
|
current[2] = final_blue_lookup[lum];
|
1997-12-09 13:57:33 +08:00
|
|
|
|
2000-01-13 23:39:26 +08:00
|
|
|
current += bpp;
|
|
|
|
}
|
1997-12-09 13:57:33 +08:00
|
|
|
}
|
|
|
|
|
2001-01-12 07:36:59 +08:00
|
|
|
static gboolean
|
|
|
|
colorify_dialog (GimpRGB *color)
|
1997-12-09 13:57:33 +08:00
|
|
|
{
|
2000-01-13 23:39:26 +08:00
|
|
|
GtkWidget *dialog;
|
|
|
|
GtkWidget *label;
|
|
|
|
GtkWidget *button;
|
|
|
|
GtkWidget *frame;
|
|
|
|
GtkWidget *table;
|
2001-01-11 06:49:45 +08:00
|
|
|
GtkWidget *color_area;
|
2001-01-12 07:36:59 +08:00
|
|
|
gint i;
|
2000-01-13 23:39:26 +08:00
|
|
|
|
2000-05-01 05:03:44 +08:00
|
|
|
gimp_ui_init ("colorify", TRUE);
|
2000-01-13 23:39:26 +08:00
|
|
|
|
|
|
|
dialog = gimp_dialog_new (_("Colorify"), "colorify",
|
2000-05-23 01:10:28 +08:00
|
|
|
gimp_standard_help_func, "filters/colorify.html",
|
2000-01-13 23:39:26 +08:00
|
|
|
GTK_WIN_POS_MOUSE,
|
|
|
|
FALSE, TRUE, FALSE,
|
|
|
|
|
|
|
|
_("OK"), colorify_ok_callback,
|
|
|
|
NULL, NULL, NULL, TRUE, FALSE,
|
|
|
|
_("Cancel"), gtk_widget_destroy,
|
|
|
|
NULL, 1, NULL, FALSE, TRUE,
|
1997-12-09 13:57:33 +08:00
|
|
|
|
|
|
|
NULL);
|
|
|
|
|
2000-01-13 23:39:26 +08:00
|
|
|
gtk_signal_connect (GTK_OBJECT (dialog), "destroy",
|
|
|
|
GTK_SIGNAL_FUNC (gtk_main_quit),
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
frame = gtk_frame_new (_("Color"));
|
|
|
|
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_ETCHED_IN);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (frame), 6);
|
|
|
|
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), frame, TRUE, TRUE, 0);
|
|
|
|
gtk_widget_show (frame);
|
|
|
|
|
|
|
|
table = gtk_table_new (2, 7, TRUE);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (table), 4);
|
|
|
|
gtk_container_add (GTK_CONTAINER (frame), table);
|
|
|
|
gtk_table_set_row_spacings (GTK_TABLE (table), 4);
|
|
|
|
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
|
|
|
|
gtk_widget_show (table);
|
|
|
|
|
|
|
|
label = gtk_label_new (_("Custom Color:"));
|
|
|
|
gtk_table_attach (GTK_TABLE (table), label, 4, 6, 0, 1,
|
|
|
|
GTK_FILL, GTK_FILL, 0, 0);
|
|
|
|
gtk_widget_show (label);
|
|
|
|
|
2000-01-26 07:11:20 +08:00
|
|
|
custum_color_button = gimp_color_button_new (_("Colorify Custom Color"),
|
|
|
|
COLOR_SIZE, COLOR_SIZE,
|
2001-01-15 14:24:24 +08:00
|
|
|
color,
|
|
|
|
GIMP_COLOR_AREA_FLAT);
|
2001-01-11 06:49:45 +08:00
|
|
|
gtk_signal_connect (GTK_OBJECT (custum_color_button), "color_changed",
|
2001-01-12 07:36:59 +08:00
|
|
|
GTK_SIGNAL_FUNC (gimp_color_button_get_color),
|
|
|
|
color);
|
2001-01-11 06:49:45 +08:00
|
|
|
|
2000-01-26 07:11:20 +08:00
|
|
|
gtk_table_attach (GTK_TABLE (table), custum_color_button, 6, 7, 0, 1,
|
2000-01-13 23:39:26 +08:00
|
|
|
GTK_FILL, GTK_FILL, 0, 0);
|
2000-01-26 07:11:20 +08:00
|
|
|
gtk_widget_show (custum_color_button);
|
|
|
|
|
2000-01-13 23:39:26 +08:00
|
|
|
for (i = 0; i < 7; i++)
|
|
|
|
{
|
2000-01-26 07:11:20 +08:00
|
|
|
button = gtk_button_new ();
|
2001-01-15 14:24:24 +08:00
|
|
|
color_area = gimp_color_area_new (&button_color[i],
|
|
|
|
GIMP_COLOR_AREA_FLAT,
|
2001-01-12 07:36:59 +08:00
|
|
|
GDK_BUTTON2_MASK);
|
2001-01-11 06:49:45 +08:00
|
|
|
gtk_widget_set_usize (GTK_WIDGET (color_area), COLOR_SIZE, COLOR_SIZE);
|
|
|
|
gtk_container_add (GTK_CONTAINER (button), color_area);
|
2000-01-13 23:39:26 +08:00
|
|
|
gtk_signal_connect (GTK_OBJECT (button), "clicked",
|
|
|
|
(GtkSignalFunc) predefined_color_callback,
|
2001-01-12 07:36:59 +08:00
|
|
|
color_area);
|
2001-01-11 06:49:45 +08:00
|
|
|
gtk_widget_show (color_area);
|
2000-01-13 23:39:26 +08:00
|
|
|
|
|
|
|
gtk_table_attach (GTK_TABLE (table), button, i, i + 1, 1, 2,
|
|
|
|
GTK_FILL, GTK_FILL, 0, 0);
|
|
|
|
gtk_widget_show (button);
|
|
|
|
}
|
|
|
|
|
|
|
|
gtk_widget_show (dialog);
|
|
|
|
|
|
|
|
gtk_main ();
|
|
|
|
gdk_flush ();
|
|
|
|
|
|
|
|
return cint.run;
|
1997-12-09 13:57:33 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
colorify_ok_callback (GtkWidget *widget,
|
2000-01-13 23:39:26 +08:00
|
|
|
gpointer data)
|
1997-12-09 13:57:33 +08:00
|
|
|
{
|
2000-01-13 23:39:26 +08:00
|
|
|
cint.run = TRUE;
|
|
|
|
|
|
|
|
gtk_widget_destroy (GTK_WIDGET (data));
|
1997-12-09 13:57:33 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
predefined_color_callback (GtkWidget *widget,
|
2000-01-13 23:39:26 +08:00
|
|
|
gpointer data)
|
1997-12-09 13:57:33 +08:00
|
|
|
{
|
2001-01-11 06:49:45 +08:00
|
|
|
GimpRGB color;
|
1997-12-09 13:57:33 +08:00
|
|
|
|
2001-01-12 07:36:59 +08:00
|
|
|
gimp_color_area_get_color (GIMP_COLOR_AREA (data), &color);
|
2001-01-11 06:49:45 +08:00
|
|
|
gimp_color_button_set_color (GIMP_COLOR_BUTTON (custum_color_button), &color);
|
|
|
|
}
|
2000-01-13 23:39:26 +08:00
|
|
|
|
1997-12-09 13:57:33 +08:00
|
|
|
|