Low-emittance electron-beam generation with laser pulse shaping in photocathode radio-frequency gun