mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-07-08 22:03:09 +03:00
mixed 8ch tabs + spaces -> 4 space indent
This commit is contained in:
parent
1060a59de9
commit
ec6fd4d672
|
@ -54,7 +54,7 @@ ImagingNewPrologueSubtype(const char *mode, unsigned xsize, unsigned ysize,
|
||||||
|
|
||||||
im = (Imaging) calloc(1, size);
|
im = (Imaging) calloc(1, size);
|
||||||
if (!im)
|
if (!im)
|
||||||
return (Imaging) ImagingError_MemoryError();
|
return (Imaging) ImagingError_MemoryError();
|
||||||
|
|
||||||
/* Setup image descriptor */
|
/* Setup image descriptor */
|
||||||
im->xsize = xsize;
|
im->xsize = xsize;
|
||||||
|
@ -106,7 +106,7 @@ ImagingNewPrologueSubtype(const char *mode, unsigned xsize, unsigned ysize,
|
||||||
im->type = IMAGING_TYPE_INT32;
|
im->type = IMAGING_TYPE_INT32;
|
||||||
|
|
||||||
} else if (strcmp(mode, "I;16") == 0 || strcmp(mode, "I;16L") == 0 \
|
} else if (strcmp(mode, "I;16") == 0 || strcmp(mode, "I;16L") == 0 \
|
||||||
|| strcmp(mode, "I;16B") == 0 || strcmp(mode, "I;16N") == 0) {
|
|| strcmp(mode, "I;16B") == 0 || strcmp(mode, "I;16N") == 0) {
|
||||||
/* EXPERIMENTAL */
|
/* EXPERIMENTAL */
|
||||||
/* 16-bit raw integer images */
|
/* 16-bit raw integer images */
|
||||||
im->bands = 1;
|
im->bands = 1;
|
||||||
|
@ -203,8 +203,8 @@ ImagingNewPrologueSubtype(const char *mode, unsigned xsize, unsigned ysize,
|
||||||
ImagingSectionLeave(&cookie);
|
ImagingSectionLeave(&cookie);
|
||||||
|
|
||||||
if (!im->image) {
|
if (!im->image) {
|
||||||
free(im);
|
free(im);
|
||||||
return (Imaging) ImagingError_MemoryError();
|
return (Imaging) ImagingError_MemoryError();
|
||||||
}
|
}
|
||||||
|
|
||||||
ImagingNewCount++;
|
ImagingNewCount++;
|
||||||
|
@ -227,16 +227,16 @@ ImagingNewEpilogue(Imaging im)
|
||||||
assume that it couldn't allocate the required amount of
|
assume that it couldn't allocate the required amount of
|
||||||
memory. */
|
memory. */
|
||||||
if (!im->destroy)
|
if (!im->destroy)
|
||||||
return (Imaging) ImagingError_MemoryError();
|
return (Imaging) ImagingError_MemoryError();
|
||||||
|
|
||||||
/* Initialize alias pointers to pixel data. */
|
/* Initialize alias pointers to pixel data. */
|
||||||
switch (im->pixelsize) {
|
switch (im->pixelsize) {
|
||||||
case 1: case 2: case 3:
|
case 1: case 2: case 3:
|
||||||
im->image8 = (UINT8 **) im->image;
|
im->image8 = (UINT8 **) im->image;
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
im->image32 = (INT32 **) im->image;
|
im->image32 = (INT32 **) im->image;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return im;
|
return im;
|
||||||
|
@ -246,16 +246,16 @@ void
|
||||||
ImagingDelete(Imaging im)
|
ImagingDelete(Imaging im)
|
||||||
{
|
{
|
||||||
if (!im)
|
if (!im)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (im->palette)
|
if (im->palette)
|
||||||
ImagingPaletteDelete(im->palette);
|
ImagingPaletteDelete(im->palette);
|
||||||
|
|
||||||
if (im->destroy)
|
if (im->destroy)
|
||||||
im->destroy(im);
|
im->destroy(im);
|
||||||
|
|
||||||
if (im->image)
|
if (im->image)
|
||||||
free(im->image);
|
free(im->image);
|
||||||
|
|
||||||
free(im);
|
free(im);
|
||||||
}
|
}
|
||||||
|
@ -271,9 +271,9 @@ ImagingDestroyArray(Imaging im)
|
||||||
int y;
|
int y;
|
||||||
|
|
||||||
if (im->image)
|
if (im->image)
|
||||||
for (y = 0; y < im->ysize; y++)
|
for (y = 0; y < im->ysize; y++)
|
||||||
if (im->image[y])
|
if (im->image[y])
|
||||||
free(im->image[y]);
|
free(im->image[y]);
|
||||||
}
|
}
|
||||||
|
|
||||||
Imaging
|
Imaging
|
||||||
|
@ -287,24 +287,24 @@ ImagingNewArray(const char *mode, int xsize, int ysize)
|
||||||
|
|
||||||
im = ImagingNewPrologue(mode, xsize, ysize);
|
im = ImagingNewPrologue(mode, xsize, ysize);
|
||||||
if (!im)
|
if (!im)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
ImagingSectionEnter(&cookie);
|
ImagingSectionEnter(&cookie);
|
||||||
|
|
||||||
/* Allocate image as an array of lines */
|
/* Allocate image as an array of lines */
|
||||||
for (y = 0; y < im->ysize; y++) {
|
for (y = 0; y < im->ysize; y++) {
|
||||||
p = (char *) malloc(im->linesize);
|
p = (char *) malloc(im->linesize);
|
||||||
if (!p) {
|
if (!p) {
|
||||||
ImagingDestroyArray(im);
|
ImagingDestroyArray(im);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
im->image[y] = p;
|
im->image[y] = p;
|
||||||
}
|
}
|
||||||
|
|
||||||
ImagingSectionLeave(&cookie);
|
ImagingSectionLeave(&cookie);
|
||||||
|
|
||||||
if (y == im->ysize)
|
if (y == im->ysize)
|
||||||
im->destroy = ImagingDestroyArray;
|
im->destroy = ImagingDestroyArray;
|
||||||
|
|
||||||
return ImagingNewEpilogue(im);
|
return ImagingNewEpilogue(im);
|
||||||
}
|
}
|
||||||
|
@ -318,7 +318,7 @@ static void
|
||||||
ImagingDestroyBlock(Imaging im)
|
ImagingDestroyBlock(Imaging im)
|
||||||
{
|
{
|
||||||
if (im->block)
|
if (im->block)
|
||||||
free(im->block);
|
free(im->block);
|
||||||
}
|
}
|
||||||
|
|
||||||
Imaging
|
Imaging
|
||||||
|
@ -330,7 +330,7 @@ ImagingNewBlock(const char *mode, int xsize, int ysize)
|
||||||
|
|
||||||
im = ImagingNewPrologue(mode, xsize, ysize);
|
im = ImagingNewPrologue(mode, xsize, ysize);
|
||||||
if (!im)
|
if (!im)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
/* Use a single block */
|
/* Use a single block */
|
||||||
bytes = (Py_ssize_t) im->ysize * im->linesize;
|
bytes = (Py_ssize_t) im->ysize * im->linesize;
|
||||||
|
@ -344,12 +344,12 @@ ImagingNewBlock(const char *mode, int xsize, int ysize)
|
||||||
if (im->block) {
|
if (im->block) {
|
||||||
memset(im->block, 0, bytes);
|
memset(im->block, 0, bytes);
|
||||||
|
|
||||||
for (y = i = 0; y < im->ysize; y++) {
|
for (y = i = 0; y < im->ysize; y++) {
|
||||||
im->image[y] = im->block + i;
|
im->image[y] = im->block + i;
|
||||||
i += im->linesize;
|
i += im->linesize;
|
||||||
}
|
}
|
||||||
|
|
||||||
im->destroy = ImagingDestroyBlock;
|
im->destroy = ImagingDestroyBlock;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -360,9 +360,9 @@ ImagingNewBlock(const char *mode, int xsize, int ysize)
|
||||||
* Create a new, internally allocated, image.
|
* Create a new, internally allocated, image.
|
||||||
*/
|
*/
|
||||||
#if defined(IMAGING_SMALL_MODEL)
|
#if defined(IMAGING_SMALL_MODEL)
|
||||||
#define THRESHOLD 16384L
|
#define THRESHOLD 16384L
|
||||||
#else
|
#else
|
||||||
#define THRESHOLD (2048*2048*4L)
|
#define THRESHOLD (2048*2048*4L)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Imaging
|
Imaging
|
||||||
|
@ -418,6 +418,6 @@ ImagingCopyInfo(Imaging destination, Imaging source)
|
||||||
if (source->palette) {
|
if (source->palette) {
|
||||||
if (destination->palette)
|
if (destination->palette)
|
||||||
ImagingPaletteDelete(destination->palette);
|
ImagingPaletteDelete(destination->palette);
|
||||||
destination->palette = ImagingPaletteDuplicate(source->palette);
|
destination->palette = ImagingPaletteDuplicate(source->palette);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user