Mechanical and electronic shutter