Optical solid shaft encoder