setExposureMode method

  1. @override
Future<void> setExposureMode(
  1. ExposureMode mode
)
override

Set the exposure mode for a device.

supportedExposureModes should be called before this.

Implementation

@override
Future<void> setExposureMode(ExposureMode mode) {
  verifyInitialized();
  verifyNotDisposed();
  device.device.lockForConfiguration();
  switch (mode) {
    case ExposureMode.locked:
      device.device.setExposureMode(CaptureExposureMode.locked);
      break;
    case ExposureMode.continuous:
      device.device.setExposureMode(
        CaptureExposureMode.continuousAutoExposure,
      );
      break;
  }
  return device.device.unlockForConfiguration();
}