mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-13 18:56:17 +03:00
Merge pull request #2655 from python-pillow/fast-allocation
Fast image allocation
This commit is contained in:
commit
9c4535bc82
14
_imaging.c
14
_imaging.c
|
@ -599,7 +599,7 @@ _fill(PyObject* self, PyObject* args)
|
||||||
if (!PyArg_ParseTuple(args, "s|(ii)O", &mode, &xsize, &ysize, &color))
|
if (!PyArg_ParseTuple(args, "s|(ii)O", &mode, &xsize, &ysize, &color))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
im = ImagingNew(mode, xsize, ysize);
|
im = ImagingNewDirty(mode, xsize, ysize);
|
||||||
if (!im)
|
if (!im)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
@ -874,7 +874,7 @@ _gaussian_blur(ImagingObject* self, PyObject* args)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
imIn = self->image;
|
imIn = self->image;
|
||||||
imOut = ImagingNew(imIn->mode, imIn->xsize, imIn->ysize);
|
imOut = ImagingNewDirty(imIn->mode, imIn->xsize, imIn->ysize);
|
||||||
if (!imOut)
|
if (!imOut)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
@ -1539,7 +1539,7 @@ _resize(ImagingObject* self, PyObject* args)
|
||||||
a[0] = (double) imIn->xsize / xsize;
|
a[0] = (double) imIn->xsize / xsize;
|
||||||
a[4] = (double) imIn->ysize / ysize;
|
a[4] = (double) imIn->ysize / ysize;
|
||||||
|
|
||||||
imOut = ImagingNew(imIn->mode, xsize, ysize);
|
imOut = ImagingNewDirty(imIn->mode, xsize, ysize);
|
||||||
|
|
||||||
imOut = ImagingTransform(
|
imOut = ImagingTransform(
|
||||||
imOut, imIn, IMAGING_TRANSFORM_AFFINE,
|
imOut, imIn, IMAGING_TRANSFORM_AFFINE,
|
||||||
|
@ -1665,12 +1665,12 @@ _transpose(ImagingObject* self, PyObject* args)
|
||||||
case 0: /* flip left right */
|
case 0: /* flip left right */
|
||||||
case 1: /* flip top bottom */
|
case 1: /* flip top bottom */
|
||||||
case 3: /* rotate 180 */
|
case 3: /* rotate 180 */
|
||||||
imOut = ImagingNew(imIn->mode, imIn->xsize, imIn->ysize);
|
imOut = ImagingNewDirty(imIn->mode, imIn->xsize, imIn->ysize);
|
||||||
break;
|
break;
|
||||||
case 2: /* rotate 90 */
|
case 2: /* rotate 90 */
|
||||||
case 4: /* rotate 270 */
|
case 4: /* rotate 270 */
|
||||||
case 5: /* transpose */
|
case 5: /* transpose */
|
||||||
imOut = ImagingNew(imIn->mode, imIn->ysize, imIn->xsize);
|
imOut = ImagingNewDirty(imIn->mode, imIn->ysize, imIn->xsize);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
PyErr_SetString(PyExc_ValueError, "No such transpose operation");
|
PyErr_SetString(PyExc_ValueError, "No such transpose operation");
|
||||||
|
@ -1715,7 +1715,7 @@ _unsharp_mask(ImagingObject* self, PyObject* args)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
imIn = self->image;
|
imIn = self->image;
|
||||||
imOut = ImagingNew(imIn->mode, imIn->xsize, imIn->ysize);
|
imOut = ImagingNewDirty(imIn->mode, imIn->xsize, imIn->ysize);
|
||||||
if (!imOut)
|
if (!imOut)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
@ -1738,7 +1738,7 @@ _box_blur(ImagingObject* self, PyObject* args)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
imIn = self->image;
|
imIn = self->image;
|
||||||
imOut = ImagingNew(imIn->mode, imIn->xsize, imIn->ysize);
|
imOut = ImagingNewDirty(imIn->mode, imIn->xsize, imIn->ysize);
|
||||||
if (!imOut)
|
if (!imOut)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ ImagingAlphaComposite(Imaging imDst, Imaging imSrc)
|
||||||
imDst->ysize != imSrc->ysize)
|
imDst->ysize != imSrc->ysize)
|
||||||
return ImagingError_Mismatch();
|
return ImagingError_Mismatch();
|
||||||
|
|
||||||
imOut = ImagingNew(imDst->mode, imDst->xsize, imDst->ysize);
|
imOut = ImagingNewDirty(imDst->mode, imDst->xsize, imDst->ysize);
|
||||||
if (!imOut)
|
if (!imOut)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ ImagingGetBand(Imaging imIn, int band)
|
||||||
if (imIn->bands == 2 && band == 1)
|
if (imIn->bands == 2 && band == 1)
|
||||||
band = 3;
|
band = 3;
|
||||||
|
|
||||||
imOut = ImagingNew("L", imIn->xsize, imIn->ysize);
|
imOut = ImagingNewDirty("L", imIn->xsize, imIn->ysize);
|
||||||
if (!imOut)
|
if (!imOut)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ ImagingBlend(Imaging imIn1, Imaging imIn2, float alpha)
|
||||||
else if (alpha == 1.0)
|
else if (alpha == 1.0)
|
||||||
return ImagingCopy(imIn2);
|
return ImagingCopy(imIn2);
|
||||||
|
|
||||||
imOut = ImagingNew(imIn1->mode, imIn1->xsize, imIn1->ysize);
|
imOut = ImagingNewDirty(imIn1->mode, imIn1->xsize, imIn1->ysize);
|
||||||
if (!imOut)
|
if (!imOut)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
|
|
@ -265,7 +265,7 @@ ImagingBoxBlur(Imaging imOut, Imaging imIn, float radius, int n)
|
||||||
strcmp(imIn->mode, "La") == 0))
|
strcmp(imIn->mode, "La") == 0))
|
||||||
return ImagingError_ModeError();
|
return ImagingError_ModeError();
|
||||||
|
|
||||||
imTransposed = ImagingNew(imIn->mode, imIn->ysize, imIn->xsize);
|
imTransposed = ImagingNewDirty(imIn->mode, imIn->ysize, imIn->xsize);
|
||||||
if (!imTransposed)
|
if (!imTransposed)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
|
|
@ -1035,7 +1035,7 @@ frompalette(Imaging imOut, Imaging imIn, const char *mode)
|
||||||
else
|
else
|
||||||
return (Imaging) ImagingError_ValueError("conversion not supported");
|
return (Imaging) ImagingError_ValueError("conversion not supported");
|
||||||
|
|
||||||
imOut = ImagingNew2(mode, imOut, imIn);
|
imOut = ImagingNew2Dirty(mode, imOut, imIn);
|
||||||
if (!imOut)
|
if (!imOut)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
@ -1073,7 +1073,7 @@ topalette(Imaging imOut, Imaging imIn, ImagingPalette inpalette, int dither)
|
||||||
if (!palette)
|
if (!palette)
|
||||||
return (Imaging) ImagingError_ValueError("no palette");
|
return (Imaging) ImagingError_ValueError("no palette");
|
||||||
|
|
||||||
imOut = ImagingNew2("P", imOut, imIn);
|
imOut = ImagingNew2Dirty("P", imOut, imIn);
|
||||||
if (!imOut) {
|
if (!imOut) {
|
||||||
if (palette != inpalette)
|
if (palette != inpalette)
|
||||||
ImagingPaletteDelete(palette);
|
ImagingPaletteDelete(palette);
|
||||||
|
@ -1211,7 +1211,7 @@ tobilevel(Imaging imOut, Imaging imIn, int dither)
|
||||||
if (strcmp(imIn->mode, "L") != 0 && strcmp(imIn->mode, "RGB") != 0)
|
if (strcmp(imIn->mode, "L") != 0 && strcmp(imIn->mode, "RGB") != 0)
|
||||||
return (Imaging) ImagingError_ValueError("conversion not supported");
|
return (Imaging) ImagingError_ValueError("conversion not supported");
|
||||||
|
|
||||||
imOut = ImagingNew2("1", imOut, imIn);
|
imOut = ImagingNew2Dirty("1", imOut, imIn);
|
||||||
if (!imOut)
|
if (!imOut)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
@ -1344,7 +1344,7 @@ convert(Imaging imOut, Imaging imIn, const char *mode,
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
imOut = ImagingNew2(mode, imOut, imIn);
|
imOut = ImagingNew2Dirty(mode, imOut, imIn);
|
||||||
if (!imOut)
|
if (!imOut)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
@ -1407,7 +1407,7 @@ ImagingConvertTransparent(Imaging imIn, const char *mode,
|
||||||
g = b = r;
|
g = b = r;
|
||||||
}
|
}
|
||||||
|
|
||||||
imOut = ImagingNew2(mode, imOut, imIn);
|
imOut = ImagingNew2Dirty(mode, imOut, imIn);
|
||||||
if (!imOut){
|
if (!imOut){
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@ _copy(Imaging imOut, Imaging imIn)
|
||||||
if (!imIn)
|
if (!imIn)
|
||||||
return (Imaging) ImagingError_ValueError(NULL);
|
return (Imaging) ImagingError_ValueError(NULL);
|
||||||
|
|
||||||
imOut = ImagingNew2(imIn->mode, imOut, imIn);
|
imOut = ImagingNew2Dirty(imIn->mode, imOut, imIn);
|
||||||
if (!imOut)
|
if (!imOut)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@ ImagingCrop(Imaging imIn, int sx0, int sy0, int sx1, int sy1)
|
||||||
if (ysize < 0)
|
if (ysize < 0)
|
||||||
ysize = 0;
|
ysize = 0;
|
||||||
|
|
||||||
imOut = ImagingNew(imIn->mode, xsize, ysize);
|
imOut = ImagingNewDirty(imIn->mode, xsize, ysize);
|
||||||
if (!imOut)
|
if (!imOut)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
|
|
@ -68,7 +68,7 @@ ImagingFillLinearGradient(const char *mode)
|
||||||
return (Imaging) ImagingError_ModeError();
|
return (Imaging) ImagingError_ModeError();
|
||||||
}
|
}
|
||||||
|
|
||||||
im = ImagingNew(mode, 256, 256);
|
im = ImagingNewDirty(mode, 256, 256);
|
||||||
if (!im) {
|
if (!im) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -91,7 +91,7 @@ ImagingFillRadialGradient(const char *mode)
|
||||||
return (Imaging) ImagingError_ModeError();
|
return (Imaging) ImagingError_ModeError();
|
||||||
}
|
}
|
||||||
|
|
||||||
im = ImagingNew(mode, 256, 256);
|
im = ImagingNewDirty(mode, 256, 256);
|
||||||
if (!im) {
|
if (!im) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -159,7 +159,8 @@ struct ImagingPaletteInstance {
|
||||||
extern int ImagingNewCount;
|
extern int ImagingNewCount;
|
||||||
|
|
||||||
extern Imaging ImagingNew(const char* mode, int xsize, int ysize);
|
extern Imaging ImagingNew(const char* mode, int xsize, int ysize);
|
||||||
extern Imaging ImagingNew2(const char* mode, Imaging imOut, Imaging imIn);
|
extern Imaging ImagingNewDirty(const char* mode, int xsize, int ysize);
|
||||||
|
extern Imaging ImagingNew2Dirty(const char* mode, Imaging imOut, Imaging imIn);
|
||||||
extern void ImagingDelete(Imaging im);
|
extern void ImagingDelete(Imaging im);
|
||||||
|
|
||||||
extern Imaging ImagingNewBlock(const char* mode, int xsize, int ysize);
|
extern Imaging ImagingNewBlock(const char* mode, int xsize, int ysize);
|
||||||
|
|
|
@ -32,7 +32,7 @@ ImagingConvertMatrix(Imaging im, const char *mode, float m[])
|
||||||
|
|
||||||
if (strcmp(mode, "L") == 0 && im->bands == 3) {
|
if (strcmp(mode, "L") == 0 && im->bands == 3) {
|
||||||
|
|
||||||
imOut = ImagingNew("L", im->xsize, im->ysize);
|
imOut = ImagingNewDirty("L", im->xsize, im->ysize);
|
||||||
if (!imOut)
|
if (!imOut)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ ImagingConvertMatrix(Imaging im, const char *mode, float m[])
|
||||||
|
|
||||||
} else if (strlen(mode) == 3 && im->bands == 3) {
|
} else if (strlen(mode) == 3 && im->bands == 3) {
|
||||||
|
|
||||||
imOut = ImagingNew(mode, im->xsize, im->ysize);
|
imOut = ImagingNewDirty(mode, im->xsize, im->ysize);
|
||||||
if (!imOut)
|
if (!imOut)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ ImagingNegative(Imaging im)
|
||||||
if (!im)
|
if (!im)
|
||||||
return (Imaging) ImagingError_ModeError();
|
return (Imaging) ImagingError_ModeError();
|
||||||
|
|
||||||
imOut = ImagingNew(im->mode, im->xsize, im->ysize);
|
imOut = ImagingNewDirty(im->mode, im->xsize, im->ysize);
|
||||||
if (!imOut)
|
if (!imOut)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ ImagingOffset(Imaging im, int xoffset, int yoffset)
|
||||||
if (!im)
|
if (!im)
|
||||||
return (Imaging) ImagingError_ModeError();
|
return (Imaging) ImagingError_ModeError();
|
||||||
|
|
||||||
imOut = ImagingNew(im->mode, im->xsize, im->ysize);
|
imOut = ImagingNewDirty(im->mode, im->xsize, im->ysize);
|
||||||
if (!imOut)
|
if (!imOut)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
|
|
@ -256,7 +256,7 @@ ImagingResampleHorizontal_8bpc(Imaging imIn, int xsize, struct filter *filterp)
|
||||||
return (Imaging) ImagingError_MemoryError();
|
return (Imaging) ImagingError_MemoryError();
|
||||||
}
|
}
|
||||||
|
|
||||||
imOut = ImagingNew(imIn->mode, xsize, imIn->ysize);
|
imOut = ImagingNewDirty(imIn->mode, xsize, imIn->ysize);
|
||||||
if ( ! imOut) {
|
if ( ! imOut) {
|
||||||
free(kk);
|
free(kk);
|
||||||
free(xbounds);
|
free(xbounds);
|
||||||
|
@ -358,7 +358,7 @@ ImagingResampleVertical_8bpc(Imaging imIn, int ysize, struct filter *filterp)
|
||||||
return (Imaging) ImagingError_MemoryError();
|
return (Imaging) ImagingError_MemoryError();
|
||||||
}
|
}
|
||||||
|
|
||||||
imOut = ImagingNew(imIn->mode, imIn->xsize, ysize);
|
imOut = ImagingNewDirty(imIn->mode, imIn->xsize, ysize);
|
||||||
if ( ! imOut) {
|
if ( ! imOut) {
|
||||||
free(kk);
|
free(kk);
|
||||||
free(xbounds);
|
free(xbounds);
|
||||||
|
@ -452,7 +452,7 @@ ImagingResampleHorizontal_32bpc(Imaging imIn, int xsize, struct filter *filterp)
|
||||||
return (Imaging) ImagingError_MemoryError();
|
return (Imaging) ImagingError_MemoryError();
|
||||||
}
|
}
|
||||||
|
|
||||||
imOut = ImagingNew(imIn->mode, xsize, imIn->ysize);
|
imOut = ImagingNewDirty(imIn->mode, xsize, imIn->ysize);
|
||||||
if ( ! imOut) {
|
if ( ! imOut) {
|
||||||
free(kk);
|
free(kk);
|
||||||
free(xbounds);
|
free(xbounds);
|
||||||
|
@ -512,7 +512,7 @@ ImagingResampleVertical_32bpc(Imaging imIn, int ysize, struct filter *filterp)
|
||||||
return (Imaging) ImagingError_MemoryError();
|
return (Imaging) ImagingError_MemoryError();
|
||||||
}
|
}
|
||||||
|
|
||||||
imOut = ImagingNew(imIn->mode, imIn->xsize, ysize);
|
imOut = ImagingNewDirty(imIn->mode, imIn->xsize, ysize);
|
||||||
if ( ! imOut) {
|
if ( ! imOut) {
|
||||||
free(kk);
|
free(kk);
|
||||||
free(xbounds);
|
free(xbounds);
|
||||||
|
|
|
@ -277,7 +277,7 @@ ImagingDestroyArray(Imaging im)
|
||||||
}
|
}
|
||||||
|
|
||||||
Imaging
|
Imaging
|
||||||
ImagingAllocateArray(Imaging im)
|
ImagingAllocateArray(Imaging im, int dirty)
|
||||||
{
|
{
|
||||||
ImagingSectionCookie cookie;
|
ImagingSectionCookie cookie;
|
||||||
|
|
||||||
|
@ -289,7 +289,11 @@ ImagingAllocateArray(Imaging im)
|
||||||
/* 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++) {
|
||||||
/* malloc check linesize checked in prologue */
|
/* malloc check linesize checked in prologue */
|
||||||
p = (char *) calloc(1, im->linesize);
|
if (dirty) {
|
||||||
|
p = (char *) malloc(im->linesize);
|
||||||
|
} else {
|
||||||
|
p = (char *) calloc(1, im->linesize);
|
||||||
|
}
|
||||||
if (!p) {
|
if (!p) {
|
||||||
ImagingDestroyArray(im);
|
ImagingDestroyArray(im);
|
||||||
break;
|
break;
|
||||||
|
@ -321,7 +325,7 @@ ImagingDestroyBlock(Imaging im)
|
||||||
}
|
}
|
||||||
|
|
||||||
Imaging
|
Imaging
|
||||||
ImagingAllocateBlock(Imaging im)
|
ImagingAllocateBlock(Imaging im, int dirty)
|
||||||
{
|
{
|
||||||
Py_ssize_t y, i;
|
Py_ssize_t y, i;
|
||||||
|
|
||||||
|
@ -341,8 +345,13 @@ ImagingAllocateBlock(Imaging im)
|
||||||
platforms */
|
platforms */
|
||||||
im->block = (char *) malloc(1);
|
im->block = (char *) malloc(1);
|
||||||
} else {
|
} else {
|
||||||
/* malloc check ok, overflow check above */
|
if (dirty) {
|
||||||
im->block = (char *) calloc(im->ysize, im->linesize);
|
/* malloc check ok, overflow check above */
|
||||||
|
im->block = (char *) malloc(im->ysize * im->linesize);
|
||||||
|
} else {
|
||||||
|
/* malloc check ok, overflow check above */
|
||||||
|
im->block = (char *) calloc(im->ysize, im->linesize);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ! im->block) {
|
if ( ! im->block) {
|
||||||
|
@ -369,7 +378,7 @@ ImagingAllocateBlock(Imaging im)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Imaging
|
Imaging
|
||||||
ImagingNew(const char* mode, int xsize, int ysize)
|
ImagingNewInternal(const char* mode, int xsize, int ysize, int dirty)
|
||||||
{
|
{
|
||||||
Imaging im;
|
Imaging im;
|
||||||
|
|
||||||
|
@ -382,14 +391,14 @@ ImagingNew(const char* mode, int xsize, int ysize)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (im->ysize && im->linesize <= THRESHOLD / im->ysize) {
|
if (im->ysize && im->linesize <= THRESHOLD / im->ysize) {
|
||||||
if (ImagingAllocateBlock(im)) {
|
if (ImagingAllocateBlock(im, dirty)) {
|
||||||
return im;
|
return im;
|
||||||
}
|
}
|
||||||
/* assume memory error; try allocating in array mode instead */
|
/* assume memory error; try allocating in array mode instead */
|
||||||
ImagingError_Clear();
|
ImagingError_Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ImagingAllocateArray(im)) {
|
if (ImagingAllocateArray(im, dirty)) {
|
||||||
return im;
|
return im;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -397,6 +406,18 @@ ImagingNew(const char* mode, int xsize, int ysize)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Imaging
|
||||||
|
ImagingNew(const char* mode, int xsize, int ysize)
|
||||||
|
{
|
||||||
|
return ImagingNewInternal(mode, xsize, ysize, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
Imaging
|
||||||
|
ImagingNewDirty(const char* mode, int xsize, int ysize)
|
||||||
|
{
|
||||||
|
return ImagingNewInternal(mode, xsize, ysize, 1);
|
||||||
|
}
|
||||||
|
|
||||||
Imaging
|
Imaging
|
||||||
ImagingNewBlock(const char* mode, int xsize, int ysize)
|
ImagingNewBlock(const char* mode, int xsize, int ysize)
|
||||||
{
|
{
|
||||||
|
@ -406,7 +427,7 @@ ImagingNewBlock(const char* mode, int xsize, int ysize)
|
||||||
if ( ! im)
|
if ( ! im)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (ImagingAllocateBlock(im)) {
|
if (ImagingAllocateBlock(im, 0)) {
|
||||||
return im;
|
return im;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -415,7 +436,7 @@ ImagingNewBlock(const char* mode, int xsize, int ysize)
|
||||||
}
|
}
|
||||||
|
|
||||||
Imaging
|
Imaging
|
||||||
ImagingNew2(const char* mode, Imaging imOut, Imaging imIn)
|
ImagingNew2Dirty(const char* mode, Imaging imOut, Imaging imIn)
|
||||||
{
|
{
|
||||||
/* allocate or validate output image */
|
/* allocate or validate output image */
|
||||||
|
|
||||||
|
@ -428,7 +449,7 @@ ImagingNew2(const char* mode, Imaging imOut, Imaging imIn)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* create new image */
|
/* create new image */
|
||||||
imOut = ImagingNew(mode, imIn->xsize, imIn->ysize);
|
imOut = ImagingNewDirty(mode, imIn->xsize, imIn->ysize);
|
||||||
if (!imOut)
|
if (!imOut)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user