The theory of diffuse X-ray scattering and its application to the study of point defects and their clusters