X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=blobdiff_plain;f=lib%2Fpython%2Fimage.c;h=f178255b7151e92e2a52816d0e12c654ad860523;hp=8b390ebfa3f03d77672325e399f8d9a875db7149;hb=9944c67465d8c8c19908a1786412d90a7a59fd53;hpb=5cbe0e4e9b9c04322bd31e225ac9e95310a64755 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