Scattering resonances in two-dimensional crystals with application to graphene