Compact CMOS analog readout circuit for photon counting applications