+ memset(i->clipbuf->data, 255, sizeof(U32)*i->bitwidth*i->height2);
+}
+
+static void store_image(internal_t*i, internal_result_t*ir)
+{
+ ir->img.data = (gfxcolor_t*)malloc(i->width*i->height*sizeof(gfxcolor_t));
+ ir->img.width = i->width;
+ ir->img.height = i->height;
+
+ gfxcolor_t*dest = ir->img.data;
+
+ if(i->antialize <= 1) /* no antializing */ {
+ int y;
+ for(y=0;y<i->height;y++) {
+ RGBA*line = &i->img[y*i->width];
+ memcpy(&dest[y*i->width], line, sizeof(RGBA)*i->width);
+ }
+ } else {
+ RGBA**lines = (RGBA**)rfx_calloc(sizeof(RGBA*)*i->antialize);
+ int q = i->antialize*i->antialize;
+ int ypos = 0;
+ int y;
+ int y2=0;
+ for(y=0;y<i->height2;y++) {
+ int n;
+ ypos = y % i->antialize;
+ lines[ypos] = &i->img[y*i->width2];
+ if(ypos == i->antialize-1) {
+ RGBA*out = &dest[(y2++)*i->width];
+ int x;
+ int r,g,b,a;
+ for(x=0;x<i->width;x++) {
+ int xpos = x*i->antialize;
+ int yp;
+ U32 r=0,g=0,b=0,a=0;
+ for(yp=0;yp<i->antialize;yp++) {
+ RGBA*lp = &lines[yp][xpos];
+ int xp;
+ for(xp=0;xp<i->antialize;xp++) {
+ RGBA*p = &lp[xp];
+ r += p->r;
+ g += p->g;
+ b += p->b;
+ a += p->a;
+ }
+ }
+ out[x].r = r / q;
+ out[x].g = g / q;
+ out[x].b = b / q;
+ out[x].a = a / q;
+ }
+ }
+ }
+ rfx_free(lines);
+ }