Renamed variable

This commit is contained in:
Andrew Murray 2023-04-29 19:11:02 +10:00
parent ebd3c47425
commit 96bdbc4afe
3 changed files with 6 additions and 6 deletions

View File

@ -2163,12 +2163,12 @@ static PyObject *
_getbbox(ImagingObject *self, PyObject *args) { _getbbox(ImagingObject *self, PyObject *args) {
int bbox[4]; int bbox[4];
int consider_alpha = 1; int alpha_only = 1;
if (!PyArg_ParseTuple(args, "|i", &consider_alpha)) { if (!PyArg_ParseTuple(args, "|i", &alpha_only)) {
return NULL; return NULL;
} }
if (!ImagingGetBBox(self->image, bbox, consider_alpha)) { if (!ImagingGetBBox(self->image, bbox, alpha_only)) {
Py_INCREF(Py_None); Py_INCREF(Py_None);
return Py_None; return Py_None;
} }

View File

@ -19,7 +19,7 @@
#include "Imaging.h" #include "Imaging.h"
int int
ImagingGetBBox(Imaging im, int bbox[4], int consider_alpha) { ImagingGetBBox(Imaging im, int bbox[4], int alpha_only) {
/* Get the bounding box for any non-zero data in the image.*/ /* Get the bounding box for any non-zero data in the image.*/
int x, y; int x, y;
@ -58,7 +58,7 @@ ImagingGetBBox(Imaging im, int bbox[4], int consider_alpha) {
INT32 mask = 0xffffffff; INT32 mask = 0xffffffff;
if (im->bands == 3) { if (im->bands == 3) {
((UINT8 *)&mask)[3] = 0; ((UINT8 *)&mask)[3] = 0;
} else if (consider_alpha && ( } else if (alpha_only && (
strcmp(im->mode, "RGBa") == 0 || strcmp(im->mode, "RGBA") == 0 || strcmp(im->mode, "RGBa") == 0 || strcmp(im->mode, "RGBA") == 0 ||
strcmp(im->mode, "La") == 0 || strcmp(im->mode, "LA") == 0 || strcmp(im->mode, "La") == 0 || strcmp(im->mode, "LA") == 0 ||
strcmp(im->mode, "PA") == 0 strcmp(im->mode, "PA") == 0

View File

@ -317,7 +317,7 @@ ImagingMerge(const char *mode, Imaging bands[4]);
extern int extern int
ImagingSplit(Imaging im, Imaging bands[4]); ImagingSplit(Imaging im, Imaging bands[4]);
extern int extern int
ImagingGetBBox(Imaging im, int bbox[4], int consider_alpha); ImagingGetBBox(Imaging im, int bbox[4], int alpha_only);
typedef struct { typedef struct {
int x, y; int x, y;
INT32 count; INT32 count;