rem: d = image->data + dy*(int)image->width*4 + dx; s = src->data + sy*(int)src->width*3 + sx;
add: s = src->data + (sy*(int)src->width + sx) * 3; d = image->data + (dy*(int)image->width + dx) * 4;
context: RCombineArea(RImage *image, RImage *src, int sx, int sy, unsigned width,	     unsigned height, int dx, int dy){    int x, y, dwi, swi;    unsigned char *d;    unsigned char *s;    int alpha, calpha;    assert(dy < image->height);    assert(dx < image->width);    assert(sy + height <= src->height);    assert(sx + width <= src->width);        if (height > image->height - dy)	height = image->height - dy;    if (!HAS_ALPHA(src)) {	if (!HAS_ALPHA(image)) {	    swi = (src->width - width) * 3;	    dwi = (image->width - width) * 3;	    d = image->data + dy*(int)image->width*3 + dx;	    s = src->data + sy*(int)src->width*3 + sx;	    for (y=0; y < height; y++) {		memcpy(d, s, width*3);		d += dwi;		s += swi;	    }	} else {	    swi = (src->width - width) * 3;	    dwi = (image->width - width) * 4;	    d = image->data + dy*(int)image->width*4 + dx;	    s = src->data + sy*(int)src->width*3 + sx;	    for (y=0; y < height; y++) {		for (x=0; x < width; x++) {		    *d++ = *s++;		    *d++ = *s++;		    *d++ = *s++;		    d++;		}		d += dwi;		s += swi;	    }	}    } else {	int dalpha = HAS_ALPHA(image);	swi = (src->width - width) * 4;	s = src->data + sy*(int)src->width*4 + sx;	if (!HAS_ALPHA(image)) {	    dwi = (image->width - width) * 3;	    d = image->data + (dy*(int)image->width+dx)*3;	} else {	    dwi = (image->width - width) * 4;	    d = image->data + (dy*(int)image->width+dx)*4;	}	for (y=0; y < height; y++) {	    for (x=0; x < width; x++) {		alpha = *(s+3);		calpha = 255 - alpha;		*d = (((int)*d * calpha) + ((int)*s * alpha))/256;		s++; d++;		*d = (((int)*d * calpha) + ((int)*s * alpha))/256;		s++; d++;		*d = (((int)*d * calpha) + ((int)*s * alpha))/256;		s++; d++;		s++;		if (dalpha)		    d++;	    }	    d += dwi;	    s += swi;	}    }}