  In this paper, We have presented a new general function photonic crystals
(GFPCs), which refractive indexes are line functions of space position in two
mediums $A$ and $B$, and obtain new results: (1) when the line function of
refractive indexes is up or down, the transmissivity can be far larger or
smaller than 1. (2) when the refractive indexes function increase or decrease
along the direction of incident light, the light intensity should be magnified
or weaken, which can be made optical magnifier or attenuator. (3) The GFPCs can
be made optical diode when the light positive and negative incident the GFPCs.
