Ported brush.py's compositeAlpha to cython library core.cy,for efficiency