In this paper, a piecewise polynomial function is proposed as a generalized model for the nonlinear transfer characteristic of the transmitter for optical wireless communications (OWC). The two general multicarrier modulation formats for OWC based on orthogonal frequency-division multiplexing (OFDM), direct-current-biased optical OFDM (DCO-OFDM) and asymmetrically clipped optical OFDM (ACO-OFDM), are studied. The nonlinear distortion of the electrical signal-to-noise ratio (SNR) at the receiver is derived in closed form, and it is verified by means of a Monte Carlo simulation. This flexible and accurate model allows for the application of pre-distortion and linearization of the dynamic range of the transmitter between points of minimum and maximum radiated optical power. Through scaling and DC-biasing the transmitted signal is optimally conditioned in accord with the optical power constraints of the transmitter front-end, i.e., minimum, average and maximum radiated optical power. The mutual information of the optimized optical OFDM (O-OFDM) schemes is presented as a measure of the capacity of these OWC systems under an average electrical power constraint. When the additional DC bias power is neglected, DCO-OFDM is shown to achieve the Shannon capacity when the optimization is employed, while ACO-OFDM exhibits a 3-dB gap which grows with higher information rate targets. When the DC bias power is counted towards the signal power, DCO-OFDM outperforms ACO-OFDM for the majority of average optical power levels with the increase of the information rate target or the dynamic range. The results can be considered as a lower bound on the O-OFDM system capacity.