Brightness and coherence of radiation from undulators and high-gain free electron lasers