Are White Balance gains applied before or after ADC?

At which point in the image processing pipeline does iOS apply the white balance gains which can be set via AVCaptureDevice.setWhiteBalanceModeLocked(with:completionHandler:)?

Are those gains applied in the analog part of the camera pipeline, before the pixel voltage gets converted via the ADC to digital values? Or does the camera first convert the pixel voltages to digital values and then the gains are applied to the digital values?

Is this consistent across devices or can the behavior vary from device to device?

Are White Balance gains applied before or after ADC?
 
 
Q