mirror of https://github.com/GNOME/gimp.git
applied fix for the channel_bounds bug from Didier Gautheron
* app/channel.c: applied fix for the channel_bounds bug from Didier Gautheron <dgautheron@magic.fr>. (slightly modified)
This commit is contained in:
parent
4fb6b4981d
commit
3893b29588
|
@ -1,3 +1,8 @@
|
||||||
|
Thu May 27 22:04:49 1999 Jay Cox (jaycox@earthlink.net)
|
||||||
|
|
||||||
|
* app/channel.c: applied fix for the channel_bounds bug from
|
||||||
|
Didier Gautheron <dgautheron@magic.fr>. (slightly modified)
|
||||||
|
|
||||||
Thu May 27 22:00:58 BST 1999 Andy Thomas <alt@gimp.org>
|
Thu May 27 22:00:58 BST 1999 Andy Thomas <alt@gimp.org>
|
||||||
|
|
||||||
* app/transform_core.c
|
* app/transform_core.c
|
||||||
|
|
|
@ -602,7 +602,7 @@ int
|
||||||
channel_bounds (Channel *mask, int *x1, int *y1, int *x2, int *y2)
|
channel_bounds (Channel *mask, int *x1, int *y1, int *x2, int *y2)
|
||||||
{
|
{
|
||||||
PixelRegion maskPR;
|
PixelRegion maskPR;
|
||||||
unsigned char * data;
|
unsigned char *data, *data1;
|
||||||
int x, y;
|
int x, y;
|
||||||
int ex, ey;
|
int ex, ey;
|
||||||
void *pr;
|
void *pr;
|
||||||
|
@ -628,7 +628,7 @@ channel_bounds (Channel *mask, int *x1, int *y1, int *x2, int *y2)
|
||||||
pixel_region_init (&maskPR, GIMP_DRAWABLE(mask)->tiles, 0, 0, GIMP_DRAWABLE(mask)->width, GIMP_DRAWABLE(mask)->height, FALSE);
|
pixel_region_init (&maskPR, GIMP_DRAWABLE(mask)->tiles, 0, 0, GIMP_DRAWABLE(mask)->width, GIMP_DRAWABLE(mask)->height, FALSE);
|
||||||
for (pr = pixel_regions_register (1, &maskPR); pr != NULL; pr = pixel_regions_process (pr))
|
for (pr = pixel_regions_register (1, &maskPR); pr != NULL; pr = pixel_regions_process (pr))
|
||||||
{
|
{
|
||||||
data = maskPR.data;
|
data1 = data = maskPR.data;
|
||||||
ex = maskPR.x + maskPR.w;
|
ex = maskPR.x + maskPR.w;
|
||||||
ey = maskPR.y + maskPR.h;
|
ey = maskPR.y + maskPR.h;
|
||||||
/* only check the pixels if this tile is not fully within the currently
|
/* only check the pixels if this tile is not fully within the currently
|
||||||
|
@ -650,9 +650,9 @@ channel_bounds (Channel *mask, int *x1, int *y1, int *x2, int *y2)
|
||||||
ty2 = ey;
|
ty2 = ey;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
for (y = maskPR.y; y < ey; y++)
|
for (y = maskPR.y; y < ey; y++, data1 += maskPR.rowstride)
|
||||||
{
|
{
|
||||||
for (x = maskPR.x; x < ex; x++, data++)
|
for (x = maskPR.x, data = data1; x < ex; x++, data++)
|
||||||
if (*data)
|
if (*data)
|
||||||
{
|
{
|
||||||
minx = x;
|
minx = x;
|
||||||
|
|
|
@ -602,7 +602,7 @@ int
|
||||||
channel_bounds (Channel *mask, int *x1, int *y1, int *x2, int *y2)
|
channel_bounds (Channel *mask, int *x1, int *y1, int *x2, int *y2)
|
||||||
{
|
{
|
||||||
PixelRegion maskPR;
|
PixelRegion maskPR;
|
||||||
unsigned char * data;
|
unsigned char *data, *data1;
|
||||||
int x, y;
|
int x, y;
|
||||||
int ex, ey;
|
int ex, ey;
|
||||||
void *pr;
|
void *pr;
|
||||||
|
@ -628,7 +628,7 @@ channel_bounds (Channel *mask, int *x1, int *y1, int *x2, int *y2)
|
||||||
pixel_region_init (&maskPR, GIMP_DRAWABLE(mask)->tiles, 0, 0, GIMP_DRAWABLE(mask)->width, GIMP_DRAWABLE(mask)->height, FALSE);
|
pixel_region_init (&maskPR, GIMP_DRAWABLE(mask)->tiles, 0, 0, GIMP_DRAWABLE(mask)->width, GIMP_DRAWABLE(mask)->height, FALSE);
|
||||||
for (pr = pixel_regions_register (1, &maskPR); pr != NULL; pr = pixel_regions_process (pr))
|
for (pr = pixel_regions_register (1, &maskPR); pr != NULL; pr = pixel_regions_process (pr))
|
||||||
{
|
{
|
||||||
data = maskPR.data;
|
data1 = data = maskPR.data;
|
||||||
ex = maskPR.x + maskPR.w;
|
ex = maskPR.x + maskPR.w;
|
||||||
ey = maskPR.y + maskPR.h;
|
ey = maskPR.y + maskPR.h;
|
||||||
/* only check the pixels if this tile is not fully within the currently
|
/* only check the pixels if this tile is not fully within the currently
|
||||||
|
@ -650,9 +650,9 @@ channel_bounds (Channel *mask, int *x1, int *y1, int *x2, int *y2)
|
||||||
ty2 = ey;
|
ty2 = ey;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
for (y = maskPR.y; y < ey; y++)
|
for (y = maskPR.y; y < ey; y++, data1 += maskPR.rowstride)
|
||||||
{
|
{
|
||||||
for (x = maskPR.x; x < ex; x++, data++)
|
for (x = maskPR.x, data = data1; x < ex; x++, data++)
|
||||||
if (*data)
|
if (*data)
|
||||||
{
|
{
|
||||||
minx = x;
|
minx = x;
|
||||||
|
|
|
@ -602,7 +602,7 @@ int
|
||||||
channel_bounds (Channel *mask, int *x1, int *y1, int *x2, int *y2)
|
channel_bounds (Channel *mask, int *x1, int *y1, int *x2, int *y2)
|
||||||
{
|
{
|
||||||
PixelRegion maskPR;
|
PixelRegion maskPR;
|
||||||
unsigned char * data;
|
unsigned char *data, *data1;
|
||||||
int x, y;
|
int x, y;
|
||||||
int ex, ey;
|
int ex, ey;
|
||||||
void *pr;
|
void *pr;
|
||||||
|
@ -628,7 +628,7 @@ channel_bounds (Channel *mask, int *x1, int *y1, int *x2, int *y2)
|
||||||
pixel_region_init (&maskPR, GIMP_DRAWABLE(mask)->tiles, 0, 0, GIMP_DRAWABLE(mask)->width, GIMP_DRAWABLE(mask)->height, FALSE);
|
pixel_region_init (&maskPR, GIMP_DRAWABLE(mask)->tiles, 0, 0, GIMP_DRAWABLE(mask)->width, GIMP_DRAWABLE(mask)->height, FALSE);
|
||||||
for (pr = pixel_regions_register (1, &maskPR); pr != NULL; pr = pixel_regions_process (pr))
|
for (pr = pixel_regions_register (1, &maskPR); pr != NULL; pr = pixel_regions_process (pr))
|
||||||
{
|
{
|
||||||
data = maskPR.data;
|
data1 = data = maskPR.data;
|
||||||
ex = maskPR.x + maskPR.w;
|
ex = maskPR.x + maskPR.w;
|
||||||
ey = maskPR.y + maskPR.h;
|
ey = maskPR.y + maskPR.h;
|
||||||
/* only check the pixels if this tile is not fully within the currently
|
/* only check the pixels if this tile is not fully within the currently
|
||||||
|
@ -650,9 +650,9 @@ channel_bounds (Channel *mask, int *x1, int *y1, int *x2, int *y2)
|
||||||
ty2 = ey;
|
ty2 = ey;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
for (y = maskPR.y; y < ey; y++)
|
for (y = maskPR.y; y < ey; y++, data1 += maskPR.rowstride)
|
||||||
{
|
{
|
||||||
for (x = maskPR.x; x < ex; x++, data++)
|
for (x = maskPR.x, data = data1; x < ex; x++, data++)
|
||||||
if (*data)
|
if (*data)
|
||||||
{
|
{
|
||||||
minx = x;
|
minx = x;
|
||||||
|
|
|
@ -602,7 +602,7 @@ int
|
||||||
channel_bounds (Channel *mask, int *x1, int *y1, int *x2, int *y2)
|
channel_bounds (Channel *mask, int *x1, int *y1, int *x2, int *y2)
|
||||||
{
|
{
|
||||||
PixelRegion maskPR;
|
PixelRegion maskPR;
|
||||||
unsigned char * data;
|
unsigned char *data, *data1;
|
||||||
int x, y;
|
int x, y;
|
||||||
int ex, ey;
|
int ex, ey;
|
||||||
void *pr;
|
void *pr;
|
||||||
|
@ -628,7 +628,7 @@ channel_bounds (Channel *mask, int *x1, int *y1, int *x2, int *y2)
|
||||||
pixel_region_init (&maskPR, GIMP_DRAWABLE(mask)->tiles, 0, 0, GIMP_DRAWABLE(mask)->width, GIMP_DRAWABLE(mask)->height, FALSE);
|
pixel_region_init (&maskPR, GIMP_DRAWABLE(mask)->tiles, 0, 0, GIMP_DRAWABLE(mask)->width, GIMP_DRAWABLE(mask)->height, FALSE);
|
||||||
for (pr = pixel_regions_register (1, &maskPR); pr != NULL; pr = pixel_regions_process (pr))
|
for (pr = pixel_regions_register (1, &maskPR); pr != NULL; pr = pixel_regions_process (pr))
|
||||||
{
|
{
|
||||||
data = maskPR.data;
|
data1 = data = maskPR.data;
|
||||||
ex = maskPR.x + maskPR.w;
|
ex = maskPR.x + maskPR.w;
|
||||||
ey = maskPR.y + maskPR.h;
|
ey = maskPR.y + maskPR.h;
|
||||||
/* only check the pixels if this tile is not fully within the currently
|
/* only check the pixels if this tile is not fully within the currently
|
||||||
|
@ -650,9 +650,9 @@ channel_bounds (Channel *mask, int *x1, int *y1, int *x2, int *y2)
|
||||||
ty2 = ey;
|
ty2 = ey;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
for (y = maskPR.y; y < ey; y++)
|
for (y = maskPR.y; y < ey; y++, data1 += maskPR.rowstride)
|
||||||
{
|
{
|
||||||
for (x = maskPR.x; x < ex; x++, data++)
|
for (x = maskPR.x, data = data1; x < ex; x++, data++)
|
||||||
if (*data)
|
if (*data)
|
||||||
{
|
{
|
||||||
minx = x;
|
minx = x;
|
||||||
|
|
Loading…
Reference in New Issue