Energy-resolved x-ray imaging for magnetically confined fusion plasmas: measurement of impurity concentration and thermal and non-Maxwellian electron distributions