An introduction to photonic crystals