spans_to_viscell function

Transform a vector of spans (with duplication) into a visibility vector