-
Notifications
You must be signed in to change notification settings - Fork 405
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support exposure compensation #194
Conversation
Hi @andrewcking the PR looks very nice! Thanks! I have 2 minor comments only which would be nice to solve before merging. |
@@ -44,6 +45,10 @@ private infix fun Int.applyInto(parameters: Camera.Parameters) { | |||
parameters.jpegQuality = this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This used to be the only Int.applyInto
but now needs to be called applyJpegQualityInto
to distinct it from the new one (applyExposureCompensationInto
)
/** | ||
* @return Selector function which always provides the default exposure. | ||
*/ | ||
fun autoExposure(): ExposureSelector = single(0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Under the hood it's auto for the camera, that's true but I as user I would think ok, I want to reset it back to default
so defaultExposure
sounds more explicit, usage friendly name.
Updated, I agree Regarding So if my understanding is correct then we don't need We could however let the step value be queried via |
Thanks for the explanation @andrewcking. Let's merge it as is. The plan is to make a beta release before a stable one so some of us can test that it's totally ok to ignore steps. If it's proven that we need EV steps, we can add a |
Hopefully this is more helpful than it is trouble. I am not entirely sure about my unit tests.
Since different devices will return a different IntRange for exposure compensation, I figured the best way to implement it would be with the typical highest, lowest and manual selectors.
In addition to those selectors I added an autoExposure selector which returns the exposure compensation back to the default zero. It isn’t strictly necessary since one could set it manually to zero themselves. I can remove it if you see fit.