Fixed handling of 1x1 selection and selection out of drawable.
2004-11-01 Simon Budig <simon@gimp.org> * plug-ins/common/plasma.c: Fixed handling of 1x1 selection and selection out of drawable.
This commit is contained in:
@ -1,3 +1,8 @@
|
|||||||
|
2004-11-01 Simon Budig <simon@gimp.org>
|
||||||
|
|
||||||
|
* plug-ins/common/plasma.c: Fixed handling of 1x1 selection and
|
||||||
|
selection out of drawable.
|
||||||
|
|
||||||
2004-10-31 Sven Neumann <sven@gimp.org>
|
2004-10-31 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
* plug-ins/gfig/Makefile.am (EXTRA_DIST): removed pix-data.h.
|
* plug-ins/gfig/Makefile.am (EXTRA_DIST): removed pix-data.h.
|
||||||
|
3
NEWS
3
NEWS
@ -54,7 +54,8 @@ Overview of Changes in GIMP 2.2.0-pre1
|
|||||||
Contributors:
|
Contributors:
|
||||||
|
|
||||||
Michael Natterer, Sven Neumann, David Odin, Manish Singh, Kevin Cozens,
|
Michael Natterer, Sven Neumann, David Odin, Manish Singh, Kevin Cozens,
|
||||||
Joao S. O. Bueno, Geert Jordaens, Yeti, Karine Proot
|
Joao S. O. Bueno, Geert Jordaens, Yeti, Karine Proot, Øyvind Kolås,
|
||||||
|
Simon Budig
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -386,21 +386,24 @@ plasma (GimpDrawable *drawable,
|
|||||||
|
|
||||||
pft = init_plasma (drawable, preview_mode, gr);
|
pft = init_plasma (drawable, preview_mode, gr);
|
||||||
|
|
||||||
/*
|
if (ix1 != ix2 && iy1 != iy2)
|
||||||
* This first time only puts in the seed pixels - one in each
|
|
||||||
* corner, and one in the center of each edge, plus one in the
|
|
||||||
* center of the image.
|
|
||||||
*/
|
|
||||||
|
|
||||||
do_plasma (pft, ix1, iy1, ix2 - 1, iy2 - 1, -1, 0, gr);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Now we recurse through the images, going further each time.
|
|
||||||
*/
|
|
||||||
depth = 1;
|
|
||||||
while (!do_plasma (pft, ix1, iy1, ix2 - 1, iy2 - 1, depth, 0, gr))
|
|
||||||
{
|
{
|
||||||
depth++;
|
/*
|
||||||
|
* This first time only puts in the seed pixels - one in each
|
||||||
|
* corner, and one in the center of each edge, plus one in the
|
||||||
|
* center of the image.
|
||||||
|
*/
|
||||||
|
|
||||||
|
do_plasma (pft, ix1, iy1, ix2 - 1, iy2 - 1, -1, 0, gr);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Now we recurse through the images, going further each time.
|
||||||
|
*/
|
||||||
|
depth = 1;
|
||||||
|
while (!do_plasma (pft, ix1, iy1, ix2 - 1, iy2 - 1, depth, 0, gr))
|
||||||
|
{
|
||||||
|
depth++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
end_plasma (drawable, pft, gr);
|
end_plasma (drawable, pft, gr);
|
||||||
@ -562,6 +565,9 @@ do_plasma (GimpPixelFetcher *pft,
|
|||||||
|
|
||||||
static gint count = 0;
|
static gint count = 0;
|
||||||
|
|
||||||
|
xm = (x1 + x2) / 2;
|
||||||
|
ym = (y1 + y2) / 2;
|
||||||
|
|
||||||
/* Initial pass through - no averaging. */
|
/* Initial pass through - no averaging. */
|
||||||
|
|
||||||
if (depth == -1)
|
if (depth == -1)
|
||||||
@ -575,15 +581,15 @@ do_plasma (GimpPixelFetcher *pft,
|
|||||||
random_rgb (gr, br);
|
random_rgb (gr, br);
|
||||||
put_pixel (pft, x2, y2, br);
|
put_pixel (pft, x2, y2, br);
|
||||||
random_rgb (gr, mm);
|
random_rgb (gr, mm);
|
||||||
put_pixel (pft, (x1 + x2) / 2, (y1 + y2) / 2, mm);
|
put_pixel (pft, xm, ym, mm);
|
||||||
random_rgb (gr, ml);
|
random_rgb (gr, ml);
|
||||||
put_pixel (pft, x1, (y1 + y2) / 2, ml);
|
put_pixel (pft, x1, ym, ml);
|
||||||
random_rgb (gr, mr);
|
random_rgb (gr, mr);
|
||||||
put_pixel (pft, x2, (y1 + y2) / 2, mr);
|
put_pixel (pft, x2, ym, mr);
|
||||||
random_rgb (gr, mt);
|
random_rgb (gr, mt);
|
||||||
put_pixel (pft, (x1 + x2) / 2, y1, mt);
|
put_pixel (pft, xm, y1, mt);
|
||||||
random_rgb (gr, mb);
|
random_rgb (gr, mb);
|
||||||
put_pixel (pft, (x1 + x2) / 2, y2, mb);
|
put_pixel (pft, xm, y2, mb);
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@ -595,7 +601,6 @@ do_plasma (GimpPixelFetcher *pft,
|
|||||||
if (depth == 0)
|
if (depth == 0)
|
||||||
{
|
{
|
||||||
gint ran;
|
gint ran;
|
||||||
gint xave, yave;
|
|
||||||
|
|
||||||
if (x1 == x2 && y1 == y2)
|
if (x1 == x2 && y1 == y2)
|
||||||
{
|
{
|
||||||
@ -609,33 +614,30 @@ do_plasma (GimpPixelFetcher *pft,
|
|||||||
|
|
||||||
ran = (gint) ((256.0 / (2.0 * scale_depth)) * pvals.turbulence);
|
ran = (gint) ((256.0 / (2.0 * scale_depth)) * pvals.turbulence);
|
||||||
|
|
||||||
xave = (x1 + x2) / 2;
|
if (xm != x1 || xm != x2)
|
||||||
yave = (y1 + y2) / 2;
|
|
||||||
|
|
||||||
if (xave != x1 || xave != x2)
|
|
||||||
{
|
{
|
||||||
/* Left. */
|
/* Left. */
|
||||||
average_pixel (ml, tl, bl, bpp);
|
average_pixel (ml, tl, bl, bpp);
|
||||||
add_random (gr, ml, ran);
|
add_random (gr, ml, ran);
|
||||||
put_pixel (pft, x1, yave, ml);
|
put_pixel (pft, x1, ym, ml);
|
||||||
|
|
||||||
if (x1 != x2)
|
if (x1 != x2)
|
||||||
{
|
{
|
||||||
/* Right. */
|
/* Right. */
|
||||||
average_pixel (mr, tr, br, bpp);
|
average_pixel (mr, tr, br, bpp);
|
||||||
add_random (gr, mr, ran);
|
add_random (gr, mr, ran);
|
||||||
put_pixel (pft, x2, yave, mr);
|
put_pixel (pft, x2, ym, mr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (yave != y1 || yave != y2)
|
if (ym != y1 || ym != y2)
|
||||||
{
|
{
|
||||||
if (x1 != xave || yave != y2)
|
if (x1 != xm || ym != y2)
|
||||||
{
|
{
|
||||||
/* Bottom. */
|
/* Bottom. */
|
||||||
average_pixel (mb, bl, br, bpp);
|
average_pixel (mb, bl, br, bpp);
|
||||||
add_random (gr, mb, ran);
|
add_random (gr, mb, ran);
|
||||||
put_pixel (pft, xave, y2, mb);
|
put_pixel (pft, xm, y2, mb);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (y1 != y2)
|
if (y1 != y2)
|
||||||
@ -643,7 +645,7 @@ do_plasma (GimpPixelFetcher *pft,
|
|||||||
/* Top. */
|
/* Top. */
|
||||||
average_pixel (mt, tl, tr, bpp);
|
average_pixel (mt, tl, tr, bpp);
|
||||||
add_random (gr, mt, ran);
|
add_random (gr, mt, ran);
|
||||||
put_pixel (pft, xave, y1, mt);
|
put_pixel (pft, xm, y1, mt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -655,7 +657,7 @@ do_plasma (GimpPixelFetcher *pft,
|
|||||||
average_pixel (mm, mm, tmp, bpp);
|
average_pixel (mm, mm, tmp, bpp);
|
||||||
|
|
||||||
add_random (gr, mm, ran);
|
add_random (gr, mm, ran);
|
||||||
put_pixel (pft, xave, yave, mm);
|
put_pixel (pft, xm, ym, mm);
|
||||||
}
|
}
|
||||||
|
|
||||||
count++;
|
count++;
|
||||||
@ -668,16 +670,21 @@ do_plasma (GimpPixelFetcher *pft,
|
|||||||
return x2 - x1 < 3 && y2 - y1 < 3;
|
return x2 - x1 < 3 && y2 - y1 < 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
xm = (x1 + x2) >> 1;
|
if (x1 < x2 || y1 < y2)
|
||||||
ym = (y1 + y2) >> 1;
|
{
|
||||||
|
/* Top left. */
|
||||||
|
do_plasma (pft, x1, y1, xm, ym, depth - 1, scale_depth + 1, gr);
|
||||||
|
/* Bottom left. */
|
||||||
|
do_plasma (pft, x1, ym, xm ,y2, depth - 1, scale_depth + 1, gr);
|
||||||
|
/* Top right. */
|
||||||
|
do_plasma (pft, xm, y1, x2 , ym, depth - 1, scale_depth + 1, gr);
|
||||||
|
/* Bottom right. */
|
||||||
|
return do_plasma (pft, xm, ym, x2, y2, depth - 1, scale_depth + 1, gr);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
/* Top left. */
|
|
||||||
do_plasma (pft, x1, y1, xm, ym, depth - 1, scale_depth + 1, gr);
|
|
||||||
/* Bottom left. */
|
|
||||||
do_plasma (pft, x1, ym, xm ,y2, depth - 1, scale_depth + 1, gr);
|
|
||||||
/* Top right. */
|
|
||||||
do_plasma (pft, xm, y1, x2 , ym, depth - 1, scale_depth + 1, gr);
|
|
||||||
/* Bottom right. */
|
|
||||||
return do_plasma (pft, xm, ym, x2, y2, depth - 1, scale_depth + 1, gr);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user