Skip to content
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

Add the ability to implement your own SizeSelector #44

Closed
iAlex97 opened this issue Jun 23, 2017 · 1 comment
Closed

Add the ability to implement your own SizeSelector #44

iAlex97 opened this issue Jun 23, 2017 · 1 comment
Assignees

Comments

@iAlex97
Copy link

iAlex97 commented Jun 23, 2017

If you'd like to use other resolution than the provided biggestSize() and smallestSize() you can't or at least it's not documented. I'd like to do some JNI image processing and for that I need to find a sweet spot between the max and min resolutin.

@dmitry-zaitsev
Copy link
Member

biggsetSize() and smallestSize() are actually returning an implementation of SelectorFunction. That is the interface which provides you with a list of available items (sizes in this case) and asks you to pick one of them.

SelectorFunction is public, so you can just provide your own implementation where you would normally call biggestSize().

Here are some examples of implementation:
https://github.com/Fotoapparat/Fotoapparat/blob/master/fotoapparat/src/main/java/io/fotoapparat/parameter/selector/SizeSelectors.java

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants