Any organism that can synthesize its food from inorganic substances, using heat or light as a source of energy.