Analytical description of image contrast in HRTEM and application