Pulsed and cw confocal microscopy: a comparison of resolution and contrast