From: kramm Date: Wed, 12 Oct 2005 18:27:59 +0000 (+0000) Subject: new function rgba_to_image() X-Git-Tag: xpdf-3-01~52 X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=commitdiff_plain;h=9944c67465d8c8c19908a1786412d90a7a59fd53 new function rgba_to_image() --- diff --git a/lib/python/image.c b/lib/python/image.c index 8b390eb..f178255 100644 --- a/lib/python/image.c +++ b/lib/python/image.c @@ -94,3 +94,33 @@ RGBA* image_toRGBA(PyObject*_image) PyErr_SetString(PyExc_Exception, setError("Unsupported image format: %s (try .convert(\"RGBA\")", image->image->mode)); return 0; } + +extern PyObject*PyImagingNew(Imaging imOut); + +PyObject* rgba_to_image(RGBA*rgba, int width, int height) +{ +#ifndef WIN32 + Imaging img = ImagingNew("RGBA", width, height); + int y; + if(!img->image32) { + fprintf(stderr, "No array allocated!\n"); + return 0; + } + for(y=0;yimage32[y]); + RGBA* src = &rgba[width*y]; + int x; + for(x=0;x