We present the reconstruction of the Wigner function of some classical pulsed optical states obtained by direct measurement of the detected-photon probability distributions of the state displaced by a coherent field. We use a photodetector endowed with internal gain, which is operated in the non-photon-resolving regime. The measurements are performed up to mesoscopic intensities (up to more than 30 photons per pulse). The method can be applied to characterize nonclassical continuous-variable states.