-
Notifications
You must be signed in to change notification settings - Fork 154
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
solve issue 81 #99
solve issue 81 #99
Conversation
test cases written in BackgroundTest.java
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.
@apostlewang I like the direction but have a couple questions/suggestions.
If you can get those resolved I can merge in. If not, I don't mind making the changes and merging in.
Thanks for contribution and apologies for the huge delay!
* @param alpha The transparent index, should range from 0 to 10 | ||
* @throws IOException when fails to open file stream | ||
*/ | ||
public PixelBoundaryBackground(final InputStream imageInputStream, int alpha) throws Exception { |
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 alpha should just be a 0-255 value instead of clamping it between [0,10].
int imgHeight = srcImage.getHeight(); | ||
int imgWidth = srcImage.getWidth(); | ||
//get the pixel of left upper corner | ||
int c = srcImage.getRGB(3, 3); |
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 we should probably pass in an int backgroundColor
to the function instead of relying on pixel 3x3 which could be anything.
Sorry for too busy recently, much thanks if you can make the changes and merge them in~ |
test cases written in BackgroundTest.java