Low energy switching of laser doughnut modes and pattern recognition