~ubuntu-branches/ubuntu/quantal/gimp/quantal-updates

« back to all changes in this revision

Viewing changes to plug-ins/common/noise-randomize.c

  • Committer: Package Import Robot
  • Author(s): Micah Gersten
  • Date: 2012-05-20 19:21:01 UTC
  • mfrom: (1.1.26) (0.4.16 sid)
  • Revision ID: package-import@ubuntu.com-20120520192101-bs7zetx8ffoq2nfv
Tags: 2.8.0-2ubuntu1
* Merge from Debian unstable (LP: #908472). Remaining Changes:
  - debian/patches/02_help-message.patch,
    debian/patches/03_gimp.desktop.in.in.patch:
    + Update some strings for Ubuntu
  - debian/control:
    + Update description
  - debian/rules:
    + Set gettext domain and update translation templates
* Drop the following patches that were applied upstream:
  - debian/patches/ghost-cursor.patch: fix Wacom tablet cursor events
  - debian/patches/embed-page-setup-dialog.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
 *    ripple   (Copyright (C) 1997 Brian Degenhardt) and
11
11
 *    whirl    (Copyright (C) 1997 Federico Mena Quintero).
12
12
 *
13
 
 * This program is free software; you can redistribute it and/or modify
 
13
 * This program is free software: you can redistribute it and/or modify
14
14
 * it under the terms of the GNU General Public License as published by
15
 
 * the Free Software Foundation; either version 2 of the License, or
 
15
 * the Free Software Foundation; either version 3 of the License, or
16
16
 * (at your option) any later version.
17
17
 *
18
18
 * This program is distributed in the hope that it will be useful,
21
21
 * GNU General Public License for more details.
22
22
 *
23
23
 * You should have received a copy of the GNU General Public License
24
 
 * along with this program; if not, write to the Free Software
25
 
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
24
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
26
25
 *
27
26
 ****************************************************************************/
28
27
 
84
83
 ********************************/
85
84
 
86
85
#define PLUG_IN_BINARY "noise-randomize"
 
86
#define PLUG_IN_ROLE   "gimp-noise-randomize"
87
87
 
88
88
/*
89
89
 *  progress meter update frequency
147
147
 
148
148
static void query (void);
149
149
static void run   (const gchar      *name,
150
 
                   gint              nparams,
151
 
                   const GimpParam  *param,
152
 
                   gint             *nreturn_vals,
153
 
                   GimpParam       **return_vals);
 
150
                   gint              nparams,
 
151
                   const GimpParam  *param,
 
152
                   gint             *nreturn_vals,
 
153
                   GimpParam       **return_vals);
154
154
 
155
155
static void randomize                    (GimpDrawable *drawable,
156
156
                                          GimpPreview  *preview);
157
157
 
158
158
static inline void randomize_prepare_row (GimpPixelRgn *pixel_rgn,
159
 
                                          guchar       *data,
160
 
                                          gint          x,
161
 
                                          gint          y,
162
 
                                          gint          w);
 
159
                                          guchar       *data,
 
160
                                          gint          x,
 
161
                                          gint          y,
 
162
                                          gint          w);
163
163
 
164
164
static gboolean    randomize_dialog      (GimpDrawable *drawable);
165
165
 
189
189
{
190
190
  static const GimpParamDef args[] =
191
191
  {
192
 
    { GIMP_PDB_INT32,    "run_mode",    "Interactive, non-interactive" },
 
192
    { GIMP_PDB_INT32,    "run_mode",    "The run mode { RUN-INTERACTIVE (0), RUN-NONINTERACTIVE (1) }" },
193
193
    { GIMP_PDB_IMAGE,    "image",       "Input image (unused)" },
194
194
    { GIMP_PDB_DRAWABLE, "drawable",    "Input drawable" },
195
195
    { GIMP_PDB_FLOAT,    "rndm_pct",    "Randomization percentage (1.0 - 100.0)" },
196
196
    { GIMP_PDB_FLOAT,    "rndm_rcount", "Repeat count (1.0 - 100.0)" },
197
 
    { GIMP_PDB_INT32,    "randomize",   "Use random seed (TRUE, FALSE)" },
 
197
    { GIMP_PDB_INT32,    "randomize",   "Use random seed { TRUE, FALSE }" },
198
198
    { GIMP_PDB_INT32,    "seed",        "Seed value (used only if randomize is FALSE)" }
199
199
  };
200
200
 
225
225
  const gchar *copyright_date = "1995-1998";
226
226
 
227
227
  gimp_install_procedure (PLUG_IN_PROC[0],
228
 
                          hurl_blurb,
229
 
                          hurl_help,
230
 
                          author,
231
 
                          copyrights,
232
 
                          copyright_date,
233
 
                          N_("_Hurl..."),
234
 
                          "RGB*, GRAY*, INDEXED*",
235
 
                          GIMP_PLUGIN,
236
 
                          G_N_ELEMENTS (args), 0,
237
 
                          args, NULL);
 
228
                          hurl_blurb,
 
229
                          hurl_help,
 
230
                          author,
 
231
                          copyrights,
 
232
                          copyright_date,
 
233
                          N_("_Hurl..."),
 
234
                          "RGB*, GRAY*, INDEXED*",
 
235
                          GIMP_PLUGIN,
 
236
                          G_N_ELEMENTS (args), 0,
 
237
                          args, NULL);
238
238
 
239
239
  gimp_install_procedure (PLUG_IN_PROC[1],
240
 
                          pick_blurb,
241
 
                          pick_help,
242
 
                          author,
243
 
                          copyrights,
244
 
                          copyright_date,
245
 
                          N_("_Pick..."),
246
 
                          "RGB*, GRAY*, INDEXED*",
247
 
                          GIMP_PLUGIN,
248
 
                          G_N_ELEMENTS (args), 0,
249
 
                          args, NULL);
 
240
                          pick_blurb,
 
241
                          pick_help,
 
242
                          author,
 
243
                          copyrights,
 
244
                          copyright_date,
 
245
                          N_("_Pick..."),
 
246
                          "RGB*, GRAY*, INDEXED*",
 
247
                          GIMP_PLUGIN,
 
248
                          G_N_ELEMENTS (args), 0,
 
249
                          args, NULL);
250
250
 
251
251
  gimp_install_procedure (PLUG_IN_PROC[2],
252
 
                          slur_blurb,
253
 
                          slur_help,
254
 
                          author,
255
 
                          copyrights,
256
 
                          copyright_date,
257
 
                          N_("_Slur..."),
258
 
                          "RGB*, GRAY*, INDEXED*",
259
 
                          GIMP_PLUGIN,
260
 
                          G_N_ELEMENTS (args), 0,
261
 
                          args, NULL);
 
252
                          slur_blurb,
 
253
                          slur_help,
 
254
                          author,
 
255
                          copyrights,
 
256
                          copyright_date,
 
257
                          N_("_Slur..."),
 
258
                          "RGB*, GRAY*, INDEXED*",
 
259
                          GIMP_PLUGIN,
 
260
                          G_N_ELEMENTS (args), 0,
 
261
                          args, NULL);
262
262
 
263
263
  gimp_plugin_menu_register (PLUG_IN_PROC[0], "<Image>/Filters/Noise");
264
264
  gimp_plugin_menu_register (PLUG_IN_PROC[1], "<Image>/Filters/Noise");
318
318
      gimp_tile_cache_ntiles (2 * drawable->ntile_cols);
319
319
 
320
320
      switch (run_mode)
321
 
        {
322
 
          /*
323
 
           *  If we're running interactively, pop up the dialog box.
324
 
           */
325
 
        case GIMP_RUN_INTERACTIVE:
326
 
          gimp_get_data (PLUG_IN_PROC[rndm_type - 1], &pivals);
 
321
        {
 
322
          /*
 
323
           *  If we're running interactively, pop up the dialog box.
 
324
           */
 
325
        case GIMP_RUN_INTERACTIVE:
 
326
          gimp_get_data (PLUG_IN_PROC[rndm_type - 1], &pivals);
327
327
 
328
 
          if (! randomize_dialog (drawable)) /* return on Cancel */
329
 
            return;
330
 
          break;
331
 
          /*
332
 
           *  If we're not interactive (probably scripting), we
333
 
           *  get the parameters from the param[] array, since
334
 
           *  we don't use the dialog box.  Make sure they all
335
 
           *  parameters have legitimate values.
336
 
           */
337
 
        case GIMP_RUN_NONINTERACTIVE:
338
 
          if (nparams != 7)
339
 
            {
340
 
              status = GIMP_PDB_CALLING_ERROR;
341
 
            }
342
 
          else
343
 
            {
344
 
              pivals.rndm_pct    = (gdouble) param[3].data.d_float;
345
 
              pivals.rndm_rcount = (gdouble) param[4].data.d_float;
346
 
              pivals.randomize   = (gboolean) param[5].data.d_int32;
347
 
              pivals.seed        = (gint) param[6].data.d_int32;
 
328
          if (! randomize_dialog (drawable)) /* return on Cancel */
 
329
            return;
 
330
          break;
 
331
          /*
 
332
           *  If we're not interactive (probably scripting), we
 
333
           *  get the parameters from the param[] array, since
 
334
           *  we don't use the dialog box.  Make sure they all
 
335
           *  parameters have legitimate values.
 
336
           */
 
337
        case GIMP_RUN_NONINTERACTIVE:
 
338
          if (nparams != 7)
 
339
            {
 
340
              status = GIMP_PDB_CALLING_ERROR;
 
341
            }
 
342
          else
 
343
            {
 
344
              pivals.rndm_pct    = (gdouble) param[3].data.d_float;
 
345
              pivals.rndm_rcount = (gdouble) param[4].data.d_float;
 
346
              pivals.randomize   = (gboolean) param[5].data.d_int32;
 
347
              pivals.seed        = (gint) param[6].data.d_int32;
348
348
 
349
349
              if (pivals.randomize)
350
350
                pivals.seed = g_random_int ();
351
351
 
352
 
              if ((rndm_type != RNDM_PICK &&
353
 
                   rndm_type != RNDM_SLUR &&
354
 
                   rndm_type != RNDM_HURL) ||
355
 
                  (pivals.rndm_pct < 1.0 || pivals.rndm_pct > 100.0) ||
356
 
                  (pivals.rndm_rcount < 1.0 || pivals.rndm_rcount > 100.0))
357
 
                {
358
 
                  status = GIMP_PDB_CALLING_ERROR;
359
 
                }
360
 
            }
361
 
          break;
362
 
          /*
363
 
           *  If we're running with the last set of values, get those values.
364
 
           */
365
 
        case GIMP_RUN_WITH_LAST_VALS:
366
 
          gimp_get_data (PLUG_IN_PROC[rndm_type - 1], &pivals);
 
352
              if ((rndm_type != RNDM_PICK &&
 
353
                   rndm_type != RNDM_SLUR &&
 
354
                   rndm_type != RNDM_HURL) ||
 
355
                  (pivals.rndm_pct < 1.0 || pivals.rndm_pct > 100.0) ||
 
356
                  (pivals.rndm_rcount < 1.0 || pivals.rndm_rcount > 100.0))
 
357
                {
 
358
                  status = GIMP_PDB_CALLING_ERROR;
 
359
                }
 
360
            }
 
361
          break;
 
362
          /*
 
363
           *  If we're running with the last set of values, get those values.
 
364
           */
 
365
        case GIMP_RUN_WITH_LAST_VALS:
 
366
          gimp_get_data (PLUG_IN_PROC[rndm_type - 1], &pivals);
367
367
 
368
368
          if (pivals.randomize)
369
369
            pivals.seed = g_random_int ();
370
 
          break;
371
 
          /*
372
 
           *  Hopefully we never get here!
373
 
           */
374
 
        default:
375
 
          break;
 
370
          break;
 
371
          /*
 
372
           *  Hopefully we never get here!
 
373
           */
 
374
        default:
 
375
          break;
376
376
        }
377
377
 
378
378
      if (status == GIMP_PDB_SUCCESS)
379
 
        {
 
379
        {
380
380
          gimp_progress_init_printf ("%s", gettext (RNDM_NAME[rndm_type - 1]));
381
381
 
382
 
          /*
383
 
           *  Initialize the g_rand() function seed
384
 
           */
 
382
          /*
 
383
           *  Initialize the g_rand() function seed
 
384
           */
385
385
          g_rand_set_seed (gr, pivals.seed);
386
386
 
387
 
          randomize (drawable, NULL);
388
 
          /*
389
 
           *  If we ran interactively (even repeating) update the display.
390
 
           */
391
 
          if (run_mode != GIMP_RUN_NONINTERACTIVE)
392
 
            {
393
 
              gimp_displays_flush ();
 
387
          randomize (drawable, NULL);
 
388
          /*
 
389
           *  If we ran interactively (even repeating) update the display.
 
390
           */
 
391
          if (run_mode != GIMP_RUN_NONINTERACTIVE)
 
392
            {
 
393
              gimp_displays_flush ();
394
394
            }
395
 
          /*
396
 
           *  If we use the dialog popup, set the data for future use.
397
 
           */
398
 
          if (run_mode == GIMP_RUN_INTERACTIVE)
399
 
            {
400
 
              gimp_set_data (PLUG_IN_PROC[rndm_type - 1], &pivals,
 
395
          /*
 
396
           *  If we use the dialog popup, set the data for future use.
 
397
           */
 
398
          if (run_mode == GIMP_RUN_INTERACTIVE)
 
399
            {
 
400
              gimp_set_data (PLUG_IN_PROC[rndm_type - 1], &pivals,
401
401
                             sizeof (RandomizeVals));
402
402
            }
403
403
        }
430
430
 
431
431
static inline void
432
432
randomize_prepare_row (GimpPixelRgn *pixel_rgn,
433
 
                       guchar    *data,
434
 
                       int        x,
435
 
                       int        y,
436
 
                       int        w)
 
433
                       guchar    *data,
 
434
                       int        x,
 
435
                       int        y,
 
436
                       int        w)
437
437
{
438
438
  gint b;
439
439
 
480
480
  guchar *next_row, *nr;
481
481
  guchar *tmp;
482
482
  gint row, col;
483
 
  gint x1, y1, x2, y2;
 
483
  gint x, y;
484
484
  gint cnt;
485
 
  gint has_alpha, ind;
486
485
  gint i, j, k;
487
486
 
488
487
  if (preview)
489
488
    {
490
 
      gimp_preview_get_position (preview, &x1, &y1);
 
489
      gimp_preview_get_position (preview, &x, &y);
491
490
      gimp_preview_get_size (preview, &width, &height);
492
 
      x2 = x1 + width;
493
 
      y2 = y1 + height;
494
491
    }
495
492
  else
496
493
    {
497
 
      gimp_drawable_mask_bounds (drawable->drawable_id, &x1, &y1, &x2, &y2);
498
 
      width     = (x2 - x1);
499
 
      height    = (y2 - y1);
 
494
      if (! gimp_drawable_mask_intersect (drawable->drawable_id,
 
495
                                          &x, &y, &width, &height))
 
496
        return;
500
497
    }
501
498
 
502
499
  bytes = drawable->bpp;
503
 
  has_alpha = gimp_drawable_has_alpha(drawable->drawable_id);
504
500
 
505
501
  /*
506
502
   *  allocate row buffers
507
503
   */
508
 
  prev_row = g_new (guchar, (x2 - x1 + 2) * bytes);
509
 
  cur_row = g_new (guchar, (x2 - x1 + 2) * bytes);
510
 
  next_row = g_new (guchar, (x2 - x1 + 2) * bytes);
511
 
  dest = g_new (guchar, (x2 - x1) * bytes);
 
504
  prev_row = g_new (guchar, (width + 2) * bytes);
 
505
  cur_row = g_new (guchar, (width + 2) * bytes);
 
506
  next_row = g_new (guchar, (width + 2) * bytes);
 
507
  dest = g_new (guchar, width * bytes);
512
508
 
513
509
  /*
514
510
   *  initialize the pixel regions
515
511
   */
516
 
  gimp_pixel_rgn_init (&srcPR, drawable, x1, y1, width, height, FALSE, FALSE);
517
 
  gimp_pixel_rgn_init (&destPR, drawable, x1, y1, width, height, TRUE, TRUE);
518
 
  gimp_pixel_rgn_init (&destPR2, drawable, x1, y1, width, height, TRUE, TRUE);
 
512
  gimp_pixel_rgn_init (&srcPR, drawable, x, y, width, height, FALSE, FALSE);
 
513
  gimp_pixel_rgn_init (&destPR, drawable, x, y, width, height, TRUE, TRUE);
 
514
  gimp_pixel_rgn_init (&destPR2, drawable, x, y, width, height, TRUE, TRUE);
519
515
  sp = &srcPR;
520
516
  dp = &destPR;
521
517
  tp = NULL;
529
525
      /*
530
526
       *  prepare the first row and previous row
531
527
       */
532
 
      randomize_prepare_row (sp, pr, x1, y1 - 1, (x2 - x1));
533
 
      randomize_prepare_row (dp, cr, x1, y1, (x2 - x1));
 
528
      randomize_prepare_row (sp, pr, x, y - 1, width);
 
529
      randomize_prepare_row (sp, cr, x, y, width);
534
530
      /*
535
531
       *  loop through the rows, applying the selected convolution
536
532
       */
537
 
      for (row = y1; row < y2; row++)
538
 
        {
539
 
          /*  prepare the next row  */
540
 
          randomize_prepare_row (sp, nr, x1, row + 1, (x2 - x1));
 
533
      for (row = y; row < y + height; row++)
 
534
        {
 
535
          /*  prepare the next row  */
 
536
          randomize_prepare_row (sp, nr, x, row + 1, width);
541
537
 
542
 
          d = dest;
543
 
          ind = 0;
544
 
          for (col = 0; col < (x2 - x1); col++)
545
 
            {
546
 
              if (g_rand_int_range (gr, 0, 100) <= (gint) pivals.rndm_pct)
547
 
                {
548
 
                  switch (rndm_type)
549
 
                    {
550
 
                      /*
551
 
                       *  HURL
552
 
                       *      Just assign a random value.
553
 
                       */
554
 
                    case RNDM_HURL:
 
538
          d = dest;
 
539
          for (col = 0; col < width; col++)
 
540
            {
 
541
              if (g_rand_int_range (gr, 0, 100) <= (gint) pivals.rndm_pct)
 
542
                {
 
543
                  switch (rndm_type)
 
544
                    {
 
545
                      /*
 
546
                       *  HURL
 
547
                       *      Just assign a random value.
 
548
                       */
 
549
                    case RNDM_HURL:
555
550
                      for (j = 0; j < bytes; j++)
556
551
                        *d++ = g_rand_int_range (gr, 0, 256);
557
552
                      break;
558
 
                      /*
559
 
                       *  PICK
560
 
                       *      pick at random from a neighboring pixel.
561
 
                       */
562
 
                    case RNDM_PICK:
 
553
                      /*
 
554
                       *  PICK
 
555
                       *      pick at random from a neighboring pixel.
 
556
                       */
 
557
                    case RNDM_PICK:
563
558
                      k = g_rand_int_range (gr, 0, 9);
564
559
                      for (j = 0; j < bytes; j++)
565
560
                        {
598
593
                        }
599
594
                      break;
600
595
                      /*
601
 
                       *  SLUR
602
 
                       *      80% chance it's from directly above,
603
 
                       *      10% from above left,
604
 
                       *      10% from above right.
605
 
                       */
606
 
                    case RNDM_SLUR:
 
596
                       *  SLUR
 
597
                       *      80% chance it's from directly above,
 
598
                       *      10% from above left,
 
599
                       *      10% from above right.
 
600
                       */
 
601
                    case RNDM_SLUR:
607
602
                      k = g_rand_int_range (gr, 0, 10);
608
603
                      for (j = 0; j < bytes; j++)
609
604
                        {
626
621
                    }
627
622
                  /*
628
623
                   *  Otherwise, this pixel was not selected for randomization,
629
 
                   *  so use the current value.
630
 
                   */
 
624
                   *  so use the current value.
 
625
                   */
631
626
                }
632
 
              else
633
 
                {
 
627
              else
 
628
                {
634
629
                  for (j = 0; j < bytes; j++)
635
630
                    *d++ = (gint) cr[col*bytes + j];
636
631
                }
637
632
            }
638
 
          /*
639
 
           *  Save the modified row, shuffle the row pointers, and every
640
 
           *  so often, update the progress meter.
641
 
           */
642
 
          gimp_pixel_rgn_set_row (dp, dest, x1, row, (x2 - x1));
 
633
          /*
 
634
           *  Save the modified row, shuffle the row pointers, and every
 
635
           *  so often, update the progress meter.
 
636
           */
 
637
          gimp_pixel_rgn_set_row (dp, dest, x, row, width);
643
638
 
644
 
          tmp = pr;
645
 
          pr = cr;
646
 
          cr = nr;
647
 
          nr = tmp;
 
639
          tmp = pr;
 
640
          pr = cr;
 
641
          cr = nr;
 
642
          nr = tmp;
648
643
 
649
644
          if (! preview && PROG_UPDATE_TIME)
650
645
            {
651
646
              gdouble base = (gdouble) cnt / pivals.rndm_rcount;
652
 
              gdouble inc  = (gdouble) row / ((y2 - y1) * pivals.rndm_rcount);
 
647
              gdouble inc  = (gdouble) row / (height * pivals.rndm_rcount);
653
648
 
654
649
              gimp_progress_update (base + inc);
655
650
            }
659
654
       *  if we have more cycles to perform, swap the src and dest Pixel Regions
660
655
       */
661
656
      if (cnt < pivals.rndm_rcount)
662
 
        {
663
 
          if (tp != NULL)
664
 
            {
665
 
              tp = dp;
666
 
              dp = sp;
667
 
              sp = tp;
 
657
        {
 
658
          if (tp != NULL)
 
659
            {
 
660
              tp = dp;
 
661
              dp = sp;
 
662
              sp = tp;
668
663
            }
669
 
          else
670
 
            {
671
 
              tp = &srcPR;
672
 
              sp = &destPR;
673
 
              dp = &destPR2;
 
664
          else
 
665
            {
 
666
              tp = &srcPR;
 
667
              sp = &destPR;
 
668
              dp = &destPR2;
674
669
            }
675
670
        }
676
671
    }
690
685
    {
691
686
      gimp_drawable_flush (drawable);
692
687
      gimp_drawable_merge_shadow (drawable->drawable_id, TRUE);
693
 
      gimp_drawable_update (drawable->drawable_id, x1, y1, (x2 - x1), (y2 - y1));
 
688
      gimp_drawable_update (drawable->drawable_id, x, y, width, height);
694
689
    }
695
690
 
696
691
  /*
729
724
 
730
725
  gimp_ui_init (PLUG_IN_BINARY, FALSE);
731
726
 
732
 
  dlg = gimp_dialog_new (gettext (RNDM_NAME[rndm_type - 1]), PLUG_IN_BINARY,
 
727
  dlg = gimp_dialog_new (gettext (RNDM_NAME[rndm_type - 1]), PLUG_IN_ROLE,
733
728
                         NULL, 0,
734
 
                         gimp_standard_help_func, PLUG_IN_PROC[rndm_type - 1],
735
 
 
736
 
                         GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
737
 
                         GTK_STOCK_OK,     GTK_RESPONSE_OK,
738
 
 
739
 
                         NULL);
 
729
                         gimp_standard_help_func, PLUG_IN_PROC[rndm_type - 1],
 
730
 
 
731
                         GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
 
732
                         GTK_STOCK_OK,     GTK_RESPONSE_OK,
 
733
 
 
734
                         NULL);
740
735
 
741
736
  gtk_dialog_set_alternative_button_order (GTK_DIALOG (dlg),
742
737
                                           GTK_RESPONSE_OK,
745
740
 
746
741
  gimp_window_set_transient (GTK_WINDOW (dlg));
747
742
 
748
 
  main_vbox = gtk_vbox_new (FALSE, 12);
 
743
  main_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
749
744
  gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12);
750
 
  gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dlg)->vbox), main_vbox);
 
745
  gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dlg))),
 
746
                      main_vbox, TRUE, TRUE, 0);
751
747
  gtk_widget_show (main_vbox);
752
748
 
753
749
  preview = gimp_drawable_preview_new (drawable, NULL);
768
764
  /*  Random Seed  */
769
765
  seed_hbox = gimp_random_seed_new (&pivals.seed, &pivals.randomize);
770
766
  label = gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
771
 
                                     _("_Random seed:"), 0.0, 0.5,
772
 
                                     seed_hbox, 1, TRUE);
 
767
                                     _("_Random seed:"), 0.0, 0.5,
 
768
                                     seed_hbox, 1, TRUE);
773
769
  gtk_label_set_mnemonic_widget (GTK_LABEL (label),
774
 
                                 GIMP_RANDOM_SEED_SPINBUTTON (seed_hbox));
 
770
                                 GIMP_RANDOM_SEED_SPINBUTTON (seed_hbox));
775
771
 
776
772
  /*
777
773
   *  Randomization percentage label & scale (1 to 100)
778
774
   */
779
775
  adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
780
 
                              _("R_andomization (%):"), SCALE_WIDTH, 0,
781
 
                              pivals.rndm_pct, 1.0, 100.0, 1.0, 10.0, 0,
782
 
                              TRUE, 0, 0,
783
 
                              _("Percentage of pixels to be filtered"), NULL);
 
776
                              _("R_andomization (%):"), SCALE_WIDTH, 0,
 
777
                              pivals.rndm_pct, 1.0, 100.0, 1.0, 10.0, 0,
 
778
                              TRUE, 0, 0,
 
779
                              _("Percentage of pixels to be filtered"), NULL);
784
780
  g_signal_connect (adj, "value-changed",
785
781
                    G_CALLBACK (gimp_double_adjustment_update),
786
782
                    &pivals.rndm_pct);
792
788
   *  Repeat count label & scale (1 to 100)
793
789
   */
794
790
  adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 2,
795
 
                              _("R_epeat:"), SCALE_WIDTH, 0,
796
 
                              pivals.rndm_rcount, 1.0, 100.0, 1.0, 10.0, 0,
797
 
                              TRUE, 0, 0,
798
 
                              _("Number of times to apply filter"), NULL);
 
791
                              _("R_epeat:"), SCALE_WIDTH, 0,
 
792
                              pivals.rndm_rcount, 1.0, 100.0, 1.0, 10.0, 0,
 
793
                              TRUE, 0, 0,
 
794
                              _("Number of times to apply filter"), NULL);
799
795
  g_signal_connect (adj, "value-changed",
800
796
                    G_CALLBACK (gimp_double_adjustment_update),
801
797
                    &pivals.rndm_rcount);