A fully integrated CMOS sensor for optical tracking