Optical properties of layer antiferromagnets with K2NiF4 structure