The concept of generalized Wannier functions, adopted from the electronic t
heory of solids, is used to build a localized representation of electromagn
etic waves in dielectric materials. For two-dimensional photonic crystals,
we demonstrate the existence of such a localized state basis, and we establ
ish an efficient computational method, allowing a tight-binding-like parame
ter free modelization of any dielectric structure deviating from periodicit
y. Numerical simulations of a T-shaped photonic crystal waveguide prove its
ability to deal with large-scale systems and complex structures.