-
-
Notifications
You must be signed in to change notification settings - Fork 49
Add the ability to choose the interpolation mode when resizing an image #1057
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
base: main
Are you sure you want to change the base?
Conversation
Hi @jSdCool Thank you for the contribution, a few things of note:
|
Hi @jSdCool. You'll want to There’s a guide here if you need it: https://www.atlassian.com/git/tutorials/rewriting-history/git-rebase |
Thanks that was helpful, did I do it right? |
Hi @jSdCool. You're close but this still doesn’t look quite right. Please make a fresh clone of the new repository and reapply your changes there. That will make sure everything is clean and ready to review. Thanks for your efforts! |
OK, should be clean now |
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.
All good, with one quick fix but not necessarily blocking
* @see PImage#get(int, int, int, int) | ||
*/ | ||
public void resize(int w, int h) { // ignore | ||
resize(w, h, 1); |
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.
I think it would be good if you used the constant that you defined here for clarity
Added the ability to choose witch interpolation mode to use when resizing an image.
To do this there is a new overload for PImage.resize() that takes 3 ints (width, height, interpolation mode) there are also 3 new PConstants for the mode they are: NEAREST_NEIGHBOR, BILINEAR, and BICUBIC. They have a value of 0 1 and 2 respectively.
This has been accomplished by utilizing the different interpolation modes provided by the java awt library that was already used for resizing images.