Commit ffa15c46 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann
Browse files

plug-ins/common/flarefx.c a more elegant way to update the preview when

2000-05-23  Sven Neumann  <sven@gimp.org>

* plug-ins/common/flarefx.c
* plug-ins/common/glasstile.c: a more elegant way to update
  the preview when parameters change.

* plug-ins/common/grid.c: if a selection is active, show the
  selected area in the preview.

* plug-ins/common/illusion.c: applied modified version of
  gimp-timecop-200005-7.illusion which adds a preview to the
  illusion plug-in.

* plug-ins/common/jigsaw.c: applied modified version of
  gimp-timecop-200005-8.jigsaw which adds a preview to the
  jigsaw plug-in.

* plug-ins/common/max_rgb.c: applied modified version of
  gimp-timecop-200005-9.max_rgb which adds a preview to the
  max_rgb plug-in.

* plug-ins/common/noisify.c: applied modified version of
  gimp-timecop-200005-10.noisify which adds a preview to the
  noisify plug-in.

* plug-ins/common/nova.c: applied modified version of
  gimp-timecop-200005-11.nova which adds a preview to the
  nova plug-in.
parent c60771af
2000-05-23 Sven Neumann <sven@gimp.org>
* plug-ins/common/flarefx.c
* plug-ins/common/glasstile.c: a more elegant way to update
the preview when parameters change.
* plug-ins/common/grid.c: if a selection is active, show the
selected area in the preview.
* plug-ins/common/illusion.c: applied modified version of
gimp-timecop-200005-7.illusion which adds a preview to the
illusion plug-in.
* plug-ins/common/jigsaw.c: applied modified version of
gimp-timecop-200005-8.jigsaw which adds a preview to the
jigsaw plug-in.
* plug-ins/common/max_rgb.c: applied modified version of
gimp-timecop-200005-9.max_rgb which adds a preview to the
max_rgb plug-in.
* plug-ins/common/noisify.c: applied modified version of
gimp-timecop-200005-10.noisify which adds a preview to the
noisify plug-in.
* plug-ins/common/nova.c: applied modified version of
gimp-timecop-200005-11.nova which adds a preview to the
nova plug-in.
2000-05-23 Sven Neumann <sven@gimp.org> 2000-05-23 Sven Neumann <sven@gimp.org>
   
* plug-ins/common/flarefx.c * plug-ins/common/flarefx.c
......
...@@ -135,8 +135,6 @@ static GtkWidget *preview_widget (GDrawable *drawable); ...@@ -135,8 +135,6 @@ static GtkWidget *preview_widget (GDrawable *drawable);
static gint flare_dialog (GDrawable *drawable); static gint flare_dialog (GDrawable *drawable);
static void flare_ok_callback (GtkWidget *widget, static void flare_ok_callback (GtkWidget *widget,
gpointer data); gpointer data);
static void flare_show_cursor_callback (GtkWidget *widget,
gpointer data);
static GtkWidget * flare_center_create (GDrawable *drawable); static GtkWidget * flare_center_create (GDrawable *drawable);
static void flare_center_destroy (GtkWidget *widget, static void flare_center_destroy (GtkWidget *widget,
...@@ -320,7 +318,6 @@ flare_dialog (GDrawable *drawable) ...@@ -320,7 +318,6 @@ flare_dialog (GDrawable *drawable)
{ {
GtkWidget *dlg; GtkWidget *dlg;
GtkWidget *main_vbox; GtkWidget *main_vbox;
GtkWidget *toggle;
GtkWidget *frame; GtkWidget *frame;
FlareCenter *center; FlareCenter *center;
...@@ -355,18 +352,6 @@ flare_dialog (GDrawable *drawable) ...@@ -355,18 +352,6 @@ flare_dialog (GDrawable *drawable)
gtk_container_set_border_width (GTK_CONTAINER (frame), 6); gtk_container_set_border_width (GTK_CONTAINER (frame), 6);
gtk_box_pack_start (GTK_BOX (main_vbox), frame, TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (main_vbox), frame, TRUE, TRUE, 0);
/* show / hide cursor */
toggle = gtk_check_button_new_with_label (_("Show Cursor"));
gtk_container_set_border_width (GTK_CONTAINER (toggle), 6);
gtk_object_set_user_data (GTK_OBJECT (toggle), center);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle), show_cursor);
gtk_signal_connect (GTK_OBJECT (toggle), "toggled",
GTK_SIGNAL_FUNC (flare_show_cursor_callback),
&show_cursor);
gtk_box_pack_start (GTK_BOX (main_vbox), toggle, FALSE, FALSE, 0);
gtk_widget_show (toggle);
gtk_widget_show (frame); gtk_widget_show (frame);
gtk_widget_show (dlg); gtk_widget_show (dlg);
...@@ -386,17 +371,6 @@ flare_ok_callback (GtkWidget *widget, ...@@ -386,17 +371,6 @@ flare_ok_callback (GtkWidget *widget,
gtk_widget_destroy (GTK_WIDGET (data)); gtk_widget_destroy (GTK_WIDGET (data));
} }
static void
flare_show_cursor_callback (GtkWidget *widget,
gpointer data)
{
FlareCenter *center;
center = gtk_object_get_user_data (GTK_OBJECT (widget));
gimp_toggle_button_update (widget, data);
FlareFX (center->drawable, TRUE);
}
/* --- Filter functions --- */ /* --- Filter functions --- */
static void static void
FlareFX (GDrawable *drawable, FlareFX (GDrawable *drawable,
...@@ -417,12 +391,10 @@ FlareFX (GDrawable *drawable, ...@@ -417,12 +391,10 @@ FlareFX (GDrawable *drawable,
width = GTK_PREVIEW (preview)->buffer_width; width = GTK_PREVIEW (preview)->buffer_width;
height = GTK_PREVIEW (preview)->buffer_height; height = GTK_PREVIEW (preview)->buffer_height;
bytes = GTK_PREVIEW (preview)->bpp; bytes = GTK_PREVIEW (preview)->bpp;
gimp_drawable_mask_bounds (drawable->id, &x1, &y1, &x2, &y2);
xs = (gdouble)fvals.posx * preview_scale_x; xs = (gdouble)fvals.posx * preview_scale_x;
ys = (gdouble)fvals.posy * preview_scale_y; ys = (gdouble)fvals.posy * preview_scale_y;
/* now, we clobber the x1 x2 y1 y2 with the real sizes */
x1 = y1 = 0; x1 = y1 = 0;
x2 = width; x2 = width;
y2 = height; y2 = height;
...@@ -772,6 +744,7 @@ flare_center_create (GDrawable *drawable) ...@@ -772,6 +744,7 @@ flare_center_create (GDrawable *drawable)
GtkWidget *label; GtkWidget *label;
GtkWidget *pframe; GtkWidget *pframe;
GtkWidget *spinbutton; GtkWidget *spinbutton;
GtkWidget *check;
center = g_new (FlareCenter, 1); center = g_new (FlareCenter, 1);
center->drawable = drawable; center->drawable = drawable;
...@@ -794,7 +767,7 @@ flare_center_create (GDrawable *drawable) ...@@ -794,7 +767,7 @@ flare_center_create (GDrawable *drawable)
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_ETCHED_IN); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_ETCHED_IN);
gtk_container_set_border_width (GTK_CONTAINER (frame), 6); gtk_container_set_border_width (GTK_CONTAINER (frame), 6);
table = gtk_table_new (2, 4, FALSE); table = gtk_table_new (3, 4, FALSE);
gtk_table_set_col_spacings (GTK_TABLE (table), 4); gtk_table_set_col_spacings (GTK_TABLE (table), 4);
gtk_table_set_row_spacings (GTK_TABLE (table), 4); gtk_table_set_row_spacings (GTK_TABLE (table), 4);
gtk_table_set_col_spacing (GTK_TABLE (table), 1, 6); gtk_table_set_col_spacing (GTK_TABLE (table), 1, 6);
...@@ -860,11 +833,26 @@ flare_center_create (GDrawable *drawable) ...@@ -860,11 +833,26 @@ flare_center_create (GDrawable *drawable)
gtk_object_set_user_data (GTK_OBJECT (frame), center); gtk_object_set_user_data (GTK_OBJECT (frame), center);
gtk_widget_show (frame); gtk_widget_show (frame);
/* show / hide cursor */
check = gtk_check_button_new_with_label (_("Show Cursor"));
gtk_table_attach (GTK_TABLE (table), check, 0, 4, 2, 3,
GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), show_cursor);
gtk_signal_connect (GTK_OBJECT (check), "toggled",
GTK_SIGNAL_FUNC (gimp_toggle_button_update),
&show_cursor);
gtk_signal_connect_object (GTK_OBJECT (check), "toggled",
GTK_SIGNAL_FUNC (FlareFX),
(gpointer)drawable);
gtk_widget_show (check);
flare_center_cursor_update (center); flare_center_cursor_update (center);
center->cursor = FALSE; /* Make sure that the cursor has not been drawn */ center->cursor = FALSE; /* Make sure that the cursor has not been drawn */
center->in_call = FALSE; /* End of initialization */ center->in_call = FALSE; /* End of initialization */
FlareFX(drawable, 1);
FlareFX (drawable, TRUE);
DEBUG1 ("fvals center=%d,%d\n", fvals.posx, fvals.posy); DEBUG1 ("fvals center=%d,%d\n", fvals.posx, fvals.posy);
DEBUG1 ("center cur=%d,%d\n", center->curx, center->cury); DEBUG1 ("center cur=%d,%d\n", center->curx, center->cury);
......
...@@ -71,8 +71,6 @@ static void run (gchar *name, ...@@ -71,8 +71,6 @@ static void run (gchar *name,
GParam **return_vals); GParam **return_vals);
static gint glass_dialog (GDrawable *drawable); static gint glass_dialog (GDrawable *drawable);
static void tile_int_adjustment_update (GtkAdjustment *adj,
gpointer data);
static void glass_ok_callback (GtkWidget *widget, static void glass_ok_callback (GtkWidget *widget,
gpointer data); gpointer data);
...@@ -302,10 +300,12 @@ glass_dialog (GDrawable *drawable) ...@@ -302,10 +300,12 @@ glass_dialog (GDrawable *drawable)
gtvals.xblock, 10, 50, 2, 10, 0, gtvals.xblock, 10, 50, 2, 10, 0,
TRUE, 0, 0, TRUE, 0, 0,
NULL, NULL); NULL, NULL);
gtk_object_set_data (GTK_OBJECT (adj), "drawable", drawable);
gtk_signal_connect (GTK_OBJECT (adj), "value_changed", gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
GTK_SIGNAL_FUNC (tile_int_adjustment_update), GTK_SIGNAL_FUNC (gimp_int_adjustment_update),
&gtvals.xblock); &gtvals.xblock);
gtk_signal_connect_object (GTK_OBJECT (adj), "value_changed",
GTK_SIGNAL_FUNC (glasstile),
(gpointer)drawable);
/* Horizontal scale - Height */ /* Horizontal scale - Height */
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 1, adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
...@@ -315,8 +315,11 @@ glass_dialog (GDrawable *drawable) ...@@ -315,8 +315,11 @@ glass_dialog (GDrawable *drawable)
NULL, NULL); NULL, NULL);
gtk_object_set_data (GTK_OBJECT (adj), "drawable", drawable); gtk_object_set_data (GTK_OBJECT (adj), "drawable", drawable);
gtk_signal_connect (GTK_OBJECT (adj), "value_changed", gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
GTK_SIGNAL_FUNC (tile_int_adjustment_update), GTK_SIGNAL_FUNC (gimp_int_adjustment_update),
&gtvals.yblock); &gtvals.yblock);
gtk_signal_connect_object (GTK_OBJECT (adj), "value_changed",
GTK_SIGNAL_FUNC (glasstile),
(gpointer)drawable);
gtk_widget_show (frame); gtk_widget_show (frame);
gtk_widget_show (table); gtk_widget_show (table);
...@@ -329,17 +332,6 @@ glass_dialog (GDrawable *drawable) ...@@ -329,17 +332,6 @@ glass_dialog (GDrawable *drawable)
return gt_int.run; return gt_int.run;
} }
static void
tile_int_adjustment_update (GtkAdjustment *adj,
gpointer data)
{
GDrawable *drawable;
gimp_int_adjustment_update (adj, data);
drawable = gtk_object_get_data (GTK_OBJECT (adj), "drawable");
glasstile (drawable, TRUE);
}
static void static void
glass_ok_callback (GtkWidget *widget, glass_ok_callback (GtkWidget *widget,
gpointer data) gpointer data)
...@@ -362,6 +354,7 @@ preview_widget (GDrawable *drawable) ...@@ -362,6 +354,7 @@ preview_widget (GDrawable *drawable)
(GTK_PREVIEW (preview)->bpp); (GTK_PREVIEW (preview)->bpp);
preview_bits = g_malloc (size); preview_bits = g_malloc (size);
memcpy (preview_bits, GTK_PREVIEW (preview)->buffer, size); memcpy (preview_bits, GTK_PREVIEW (preview)->buffer, size);
return preview; return preview;
} }
......
...@@ -1000,6 +1000,7 @@ fill_preview (GtkWidget *widget, ...@@ -1000,6 +1000,7 @@ fill_preview (GtkWidget *widget,
GPixelRgn srcPR; GPixelRgn srcPR;
gint width; gint width;
gint height; gint height;
gint x1, x2, y1, y2;
gint bpp; gint bpp;
gint x, y; gint x, y;
guchar *src; guchar *src;
...@@ -1008,16 +1009,24 @@ fill_preview (GtkWidget *widget, ...@@ -1008,16 +1009,24 @@ fill_preview (GtkWidget *widget,
guchar *p0, *p1; guchar *p0, *p1;
guchar *even, *odd; guchar *even, *odd;
width = MIN (gimp_drawable_width (drawable->id), PREVIEW_SIZE); gimp_drawable_mask_bounds (drawable->id, &x1, &y1, &x2, &y2);
height = MIN (gimp_drawable_height (drawable->id), PREVIEW_SIZE);
bpp = gimp_drawable_bpp (drawable->id); if (x2 - x1 > PREVIEW_SIZE)
x2 = x1 + PREVIEW_SIZE;
if (y2 - y1 > PREVIEW_SIZE)
y2 = y1 + PREVIEW_SIZE;
width = x2 - x1;
height = y2 - y1;
bpp = gimp_drawable_bpp (drawable->id);
if (width < 1 || height < 1) if (width < 1 || height < 1)
return; return;
gtk_preview_size (GTK_PREVIEW (widget), width, height); gtk_preview_size (GTK_PREVIEW (widget), width, height);
gimp_pixel_rgn_init (&srcPR, drawable, 0, 0, width, height, FALSE, FALSE); gimp_pixel_rgn_init (&srcPR, drawable, x1, y1, x2, y2, FALSE, FALSE);
even = g_malloc (width * 3); even = g_malloc (width * 3);
odd = g_malloc (width * 3); odd = g_malloc (width * 3);
...@@ -1025,7 +1034,7 @@ fill_preview (GtkWidget *widget, ...@@ -1025,7 +1034,7 @@ fill_preview (GtkWidget *widget,
for (y = 0; y < height; y++) for (y = 0; y < height; y++)
{ {
gimp_pixel_rgn_get_row (&srcPR, src, 0, y, width); gimp_pixel_rgn_get_row (&srcPR, src, x1, y + y1, width);
p0 = even; p0 = even;
p1 = odd; p1 = odd;
......
/******************************************************************************* /*
* illusion.c -- This is a plug-in for the GIMP 1.0
illusion.c -- This is a plug-in for the GIMP 1.0 *
* Copyright (C) 1997 Hirotsuna Mizuno
Copyright (C) 1997 Hirotsuna Mizuno * s1041150@u-aizu.ac.jp
s1041150@u-aizu.ac.jp *
* Preview and new mode added May 2000 by tim copperfield
This program is free software; you can redistribute it and/or modify it * timecop@japan.co.jp
under the terms of the GNU General Public License as published by the Free * http://www.ne.jp/asahi/linux/timecop
Software Foundation; either version 2 of the License, or (at your option) *
any later version. * 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
This program is distributed in the hope that it will be useful, but WITHOUT * Software Foundation; either version 2 of the License, or (at your option)
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * any later version.
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for *
more details. * This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
You should have received a copy of the GNU General Public License along with * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
this program; if not, write to the Free Software Foundation, Inc., * more details.
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
* 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.
*
*/
#include "config.h" #include "config.h"
...@@ -35,7 +38,9 @@ ...@@ -35,7 +38,9 @@
#define PLUG_IN_NAME "plug_in_illusion" #define PLUG_IN_NAME "plug_in_illusion"
#define PLUG_IN_VERSION "v0.7 (Dec. 25 1997)" #define PLUG_IN_VERSION "v0.8 (May 14 2000)"
#define PREVIEW_SIZE 128
/******************************************************************************/ /******************************************************************************/
...@@ -46,15 +51,20 @@ static void run (gchar *name, ...@@ -46,15 +51,20 @@ static void run (gchar *name,
gint *nreturn_vals, gint *nreturn_vals,
GParam **return_vals); GParam **return_vals);
static void filter (GDrawable *drawable); static void filter (GDrawable *drawable);
static gboolean dialog (void); static void filter_preview (void);
static void fill_preview_with_thumb (GtkWidget *preview_widget,
gint32 drawable_ID);
static gboolean dialog (GDrawable *drawable);
/******************************************************************************/ /******************************************************************************/
typedef struct typedef struct
{ {
gint32 division; gint32 division;
} parameter_t; gint type1;
gint type2;
} IllValues;
/******************************************************************************/ /******************************************************************************/
...@@ -63,26 +73,19 @@ GPlugInInfo PLUG_IN_INFO = ...@@ -63,26 +73,19 @@ GPlugInInfo PLUG_IN_INFO =
NULL, /* init_proc */ NULL, /* init_proc */
NULL, /* quit_proc */ NULL, /* quit_proc */
query, /* query_proc */ query, /* query_proc */
run, /* run_proc */ run /* run_proc */
}; };
static parameter_t parameters = static IllValues parameters =
{ {
8 8, /* division */
1, /* type 1 */
0 /* type 2 */
}; };
static gint image_width;
static gint image_height; static guchar *preview_bits;
static gint image_bpp; static GtkWidget *preview;
static gint image_has_alpha;
static gint select_x1;
static gint select_y1;
static gint select_x2;
static gint select_y2;
static gint select_width;
static gint select_height;
static gdouble center_x;
static gdouble center_y;
/******************************************************************************/ /******************************************************************************/
...@@ -135,16 +138,6 @@ run (gchar *name, ...@@ -135,16 +138,6 @@ run (gchar *name,
*return_vals = returnv; *return_vals = returnv;
/* get the drawable info */ /* get the drawable info */
image_width = gimp_drawable_width (drawable->id);
image_height = gimp_drawable_height (drawable->id);
image_bpp = gimp_drawable_bpp (drawable->id);
image_has_alpha = gimp_drawable_has_alpha (drawable->id);
gimp_drawable_mask_bounds (drawable->id,
&select_x1, &select_y1, &select_x2, &select_y2);
select_width = select_x2 - select_x1;
select_height = select_y2 - select_y1;
center_x = select_x1 + (gdouble)select_width / 2;
center_y = select_y1 + (gdouble)select_height / 2;
/* switch the run mode */ /* switch the run mode */
switch (run_mode) switch (run_mode)
...@@ -152,19 +145,22 @@ run (gchar *name, ...@@ -152,19 +145,22 @@ run (gchar *name,
case RUN_INTERACTIVE: case RUN_INTERACTIVE:
INIT_I18N_UI(); INIT_I18N_UI();
gimp_get_data (PLUG_IN_NAME, &parameters); gimp_get_data (PLUG_IN_NAME, &parameters);
if (! dialog()) if (! dialog(drawable))
return; return;
gimp_set_data (PLUG_IN_NAME, &parameters, sizeof (parameter_t)); gimp_set_data (PLUG_IN_NAME, &parameters, sizeof (IllValues));
g_free(preview_bits);
break; break;
case RUN_NONINTERACTIVE: case RUN_NONINTERACTIVE:
if (nparams != 4) if (nparams != 6)
{ {
status = STATUS_CALLING_ERROR; status = STATUS_CALLING_ERROR;
} }
else else
{ {
parameters.division = params[3].data.d_int32; parameters.division = params[3].data.d_int32;
parameters.type1 = params[4].data.d_int32;
parameters.type2 = params[5].data.d_int32;
} }
break; break;
...@@ -179,6 +175,7 @@ run (gchar *name, ...@@ -179,6 +175,7 @@ run (gchar *name,
gimp_drawable_is_gray (drawable->id)) gimp_drawable_is_gray (drawable->id))
{ {
gimp_tile_cache_ntiles (2 * (drawable->width / gimp_tile_width() + 1)); gimp_tile_cache_ntiles (2 * (drawable->width / gimp_tile_width() + 1));
gimp_progress_init (_("Illusion..."));
filter (drawable); filter (drawable);
if (run_mode != RUN_NONINTERACTIVE) if (run_mode != RUN_NONINTERACTIVE)
gimp_displays_flush (); gimp_displays_flush ();
...@@ -203,72 +200,303 @@ filter (GDrawable *drawable) ...@@ -203,72 +200,303 @@ filter (GDrawable *drawable)
GPixelRgn srcPR, destPR; GPixelRgn srcPR, destPR;
guchar **pixels; guchar **pixels;
guchar **destpixels; guchar **destpixels;
gint image_width;
gint image_height;
gint image_bpp;
gint image_has_alpha;
gint x1;
gint y1;
gint x2;
gint y2;
gint select_width;
gint select_height;
gdouble center_x;
gdouble center_y;
gint x, y, b; gint x, y, b;
gint xx, yy; gint xx = 0;
gint yy = 0;
gdouble scale, radius, cx, cy, angle, offset; gdouble scale, radius, cx, cy, angle, offset;
image_width = gimp_drawable_width (drawable->id);
image_height = gimp_drawable_height (drawable->id);
image_bpp = gimp_drawable_bpp (drawable->id);
image_has_alpha = gimp_drawable_has_alpha (drawable->id);
gimp_drawable_mask_bounds (drawable->id,&x1, &y1, &x2, &y2);
select_width = x2 - x1;
select_height = y2 - y1;
center_x = x1 + (gdouble)select_width / 2;
center_y = y1 + (gdouble)select_height / 2;
gimp_pixel_rgn_init (&srcPR, drawable, gimp_pixel_rgn_init (&srcPR, drawable,
0, 0, image_width, image_height, FALSE, FALSE); 0, 0, image_width, image_height, FALSE, FALSE);
gimp_pixel_rgn_init (&destPR, drawable, gimp_pixel_rgn_init (&destPR, drawable,
0, 0, image_width, image_height, TRUE, TRUE); 0, 0, image_width, image_height, TRUE, TRUE);
pixels = (guchar **) g_malloc (image_height * sizeof (guchar *)); pixels = g_new (guchar *, image_height);
destpixels = (guchar **) g_malloc (image_height * sizeof (guchar *)); destpixels = g_new (guchar *, image_height);
for (y = 0; y < image_height; y++) for (y = 0; y < image_height; y++)
{ {
pixels[y] = (guchar *) g_malloc (image_width * image_bpp); pixels[y] = g_new (guchar, image_width * image_bpp);
destpixels[y] = (guchar *) g_malloc (image_width * image_bpp); destpixels[y] = g_new (guchar, image_width * image_bpp);
gimp_pixel_rgn_get_row (&srcPR, pixels[y], 0, y, image_width); gimp_pixel_rgn_get_row (&srcPR, pixels[y], 0, y, image_width);
} }
/*
for( y = select_y1; y < select_y2; y++ ){
for( x = select_x1; x < select_x2; x++ ){
for( b = 0; b < image_bpp; b++ ){