Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

[Camera] Support setting exposure compensation to back and front camera (Both Android and iOS) #2524

Closed
wants to merge 12 commits into from

Conversation

iNima
Copy link

@iNima iNima commented Feb 13, 2020

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 camera
getMinExposureCompensation() // maximum exposure compensation range for the current camera
applyExposureCompensation({int exposureValue = 0}) // apply the exposureValue to the current camera

We 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

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • My PR includes unit or integration tests for all changed/updated/fixed behaviors (See Contributor Guide).
  • All existing and new tests are passing.
  • I updated/added relevant documentation (doc comments with ///).
  • The analyzer (flutter analyze) does not report any problems on my PR.
  • I read and followed the Flutter Style Guide.
  • The title of the PR starts with the name of the plugin surrounded by square brackets, e.g. [shared_preferences]
  • I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy.
  • I updated CHANGELOG.md to add a description of the change.
  • I signed the CLA.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Does your PR require plugin users to manually update their apps to accommodate your change?

  • Yes, this is a breaking change (please indicate a breaking change in CHANGELOG.md and increment major revision).
  • No, this is not a breaking change.

@googlebot
Copy link

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 @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@mklim mklim removed their request for review February 14, 2020 21:58
@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@iNima
Copy link
Author

iNima commented Feb 18, 2020

@googlebot I signed it!

# Conflicts:
#	packages/camera/CHANGELOG.md
#	packages/camera/pubspec.yaml
@iNima iNima changed the title Support setting exposure compensation to back and front camera (Both Android and iOS) [Camera] Support setting exposure compensation to back and front camera (Both Android and iOS) Feb 26, 2020
@mvanbeusekom
Copy link
Contributor

Closing this PR as duplicate of #3346

@iNima
Copy link
Author

iNima commented Jan 7, 2021

Hi @mvanbeusekom
I don't know why it is considered as a duplicate to #3346.
This PR is related to set the exposure compensation regardless of the region or point which works similarly to change the brightness of the camera preview to a specific value. It is not auto exposure or based on the region or point.

@mvanbeusekom
Copy link
Contributor

Hi @iNima,

Thank you for reaching out. PR #3346 also implements methods for setting the exposure compensation and checking the code base it is implemented similar to this PR. Are you missing any specific things? Am I overlooking something?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
3 participants