We theoretically introduce a new type of optical all-pass filter based on
guided resonance in coupled photonic crystal slabs. The filter exhibits
near-complete transmission for both on- and off-resonant frequencies and
yet generates large resonant group delay. We further show that such a
filter can be mechanically switched into a flat-top band rejection
filter. We also show that a single photonic crystal slab can also
function either as optical all-pass transmission or flattop reflection
filter for normally incident light. Both filter functions are synthesized
by designing the spectral properties of guided resonance in the slab. The
structure is extremely compact along the vertical direction.