mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-26 18:06:18 +03:00
Added braces
This commit is contained in:
parent
8256b9bb7f
commit
2b6c5a27a1
|
@ -34,45 +34,53 @@ ImagingGetBBox(Imaging im, int bbox[4], int alpha_only) {
|
|||
/* first stage: looking for any px from top */ \
|
||||
for (y = 0; y < im->ysize; y++) { \
|
||||
has_data = 0; \
|
||||
for (x = 0; x < im->xsize; x++) \
|
||||
for (x = 0; x < im->xsize; x++) { \
|
||||
if (im->image[y][x] & mask) { \
|
||||
has_data = 1; \
|
||||
bbox[0] = x; \
|
||||
bbox[1] = y; \
|
||||
break; \
|
||||
} \
|
||||
if (has_data) \
|
||||
} \
|
||||
if (has_data) { \
|
||||
break; \
|
||||
} \
|
||||
} \
|
||||
/* Check that we got a box */ \
|
||||
if (bbox[1] < 0) \
|
||||
if (bbox[1] < 0) { \
|
||||
return 0; /* no data */ \
|
||||
} \
|
||||
/* second stage: looking for any px from bottom */ \
|
||||
for (y = im->ysize - 1; y >= bbox[1]; y--) { \
|
||||
has_data = 0; \
|
||||
for (x = 0; x < im->xsize; x++) \
|
||||
for (x = 0; x < im->xsize; x++) { \
|
||||
if (im->image[y][x] & mask) { \
|
||||
has_data = 1; \
|
||||
if (x < bbox[0]) \
|
||||
if (x < bbox[0]) { \
|
||||
bbox[0] = x; \
|
||||
} \
|
||||
bbox[3] = y + 1; \
|
||||
break; \
|
||||
} \
|
||||
if (has_data) \
|
||||
} \
|
||||
if (has_data) { \
|
||||
break; \
|
||||
} \
|
||||
} \
|
||||
/* third stage: looking for left and right boundaries */ \
|
||||
for (y = bbox[1]; y < bbox[3]; y++) { \
|
||||
for (x = 0; x < bbox[0]; x++) \
|
||||
for (x = 0; x < bbox[0]; x++) { \
|
||||
if (im->image[y][x] & mask) { \
|
||||
bbox[0] = x; \
|
||||
break; \
|
||||
} \
|
||||
for (x = im->xsize - 1; x >= bbox[2]; x--) \
|
||||
} \
|
||||
for (x = im->xsize - 1; x >= bbox[2]; x--) { \
|
||||
if (im->image[y][x] & mask) { \
|
||||
bbox[2] = x + 1; \
|
||||
break; \
|
||||
} \
|
||||
} \
|
||||
}
|
||||
|
||||
if (im->image8) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user