Polarimetry and beam apodization using stress-engineered optical elements