-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[Camera] Support setting exposure compensation to back and front camera (Both Android and iOS) #2524
Conversation
…on in the camera plugin.
…the camera plugin
…n addition to the back camera.
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here with What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
@googlebot I signed it! |
# Conflicts: # packages/camera/CHANGELOG.md # packages/camera/pubspec.yaml
Closing this PR as duplicate of #3346 |
Hi @mvanbeusekom |
Description
This PR will add support for setting exposure compensation in real-time while the image/video is streaming via camera viewport.
It has added three main methods to the camera plugin which are:
getMinExposureCompensation()
// minimum exposure compensation range for the current cameragetMinExposureCompensation()
// maximum exposure compensation range for the current cameraapplyExposureCompensation({int exposureValue = 0})
// apply the exposureValue to the current cameraWe can use the min and max values to know the range of our slider or any other UIs that we are going to use for setting the exposure compensation.
The initial value for the exposure compensation is 0.
If the input parameter of the
applyExposureCompensation
is lower than the minimum or higher than the maximum of the target bias, the value will be mapped to the nearest range value (min/max). So, it wouldn't be set to a value out of the supported range.I added a slider to the example app for setting exposure compensation value.
The main usage of this change would be for changing the brightness of the camera view.
Related Issues
Fixes flutter/flutter#24575
Fixes flutter/flutter#31225
Fixes flutter/flutter#41565
Checklist
///
).flutter analyze
) does not report any problems on my PR.Breaking Change
Does your PR require plugin users to manually update their apps to accommodate your change?