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