rem: if (dalpha) { d = image->data + dy*image->width*4 + dx; dwi = (image->width - width)*4; } else { d = image->data + dy*image->width*3 + dx; dwi = (image->width - width)*3; }
context: RCombineAreaWithOpaqueness(RImage *image, RImage *src, int sx, int sy, 			   unsigned width, unsigned height, int dx, int dy,			   int opaqueness){    int x, y, dwi, swi;    int c_opaqueness;    unsigned char *d;    unsigned char *s;    int dalpha = HAS_ALPHA(image);    assert(dy <= image->height);    assert(dx <= image->width);    assert(sy <= height);    assert(sx <= width);    /* clip */    width -= sx;    height -= sy;    if (height > image->height - dy)	height = image->height - dy;        c_opaqueness = 255 - opaqueness;#define OP opaqueness    if (!HAS_ALPHA(src)) {#define COP c_opaqueness	s = src->data + sy*src->width*3;		swi = (src->width - width) * 3;		if (dalpha) {	    d = image->data + dy*image->width*4 + dx;	    dwi = (image->width - width)*4;	} else {	    d = image->data + dy*image->width*3 + dx;	    dwi = (image->width - width)*3;	}	for (y=0; y < height; y++) {	    for (x=0; x < width; x++) {		*d = (((int)*d *(int)COP) + ((int)*s *(int)OP))/256;		s++; d++;		*d = (((int)*d *(int)COP) + ((int)*s *(int)OP))/256;		s++; d++;		*d = (((int)*d *(int)COP) + ((int)*s *(int)OP))/256;		s++; d++;		if (dalpha)		    d++;	    }	    d += dwi; s += swi;	}#undef COP    } else {	int tmp;		for (y=0; y < height; y++) {	    for (x=0; x < width; x++) {	        tmp= (*(s+3) * opaqueness)/256;		*d = (((int)*d *(int)(255-tmp)) + ((int)*s *(int)tmp))/256;		d++; s++;		*d = (((int)*d *(int)(255-tmp)) + ((int)*s *(int)tmp))/256;		d++; s++;		*d = (((int)*d *(int)(255-tmp)) + ((int)*s *(int)tmp))/256;		d++; s++;		s++;		if (dalpha)		    d++;	    }	    d += dwi; s += swi;	}    }#undef OP}