Skip to content

Commit

Permalink
Add issue comment
Browse files Browse the repository at this point in the history
//CS304 Issue link: #190
  • Loading branch information
scp-WFZ committed May 29, 2022
1 parent 1f1eead commit 35d1645
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ public static float getDifferencePercent(BufferedImage img1, BufferedImage img2)
}
}
}
//CS304 Issue link: https://github.com/romankh3/image-comparison/issues/190
long maxDiff = (long) width * height;
return (float) (100.0 * diff / maxDiff);
}
Expand Down Expand Up @@ -182,6 +183,7 @@ public static int pixelDiff(int rgb1, int rgb2) {
* @param rgb2 the second rgb
* @return true If they are the same RGB pixel.
*/
//CS304 Issue link: https://github.com/romankh3/image-comparison/issues/190
public static boolean isDiffPixel(final int rgb1, final int rgb2) {
int r1 = (rgb1 >> TENSIX) & OFFSET;
int g1 = (rgb1 >> EIGHT) & OFFSET;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
@DisplayName("Unit-level testing for {@link ImageComparison} object.")
public class ImageComparisonUnitTest {

//CS304 (manually written) Issue link: https://github.com/romankh3/image-comparison/issues/190
@DisplayName("For issue#190, test the Percentage of Different Pixels of different images")
@Test
public void testDifferencePercent1() {
Expand All @@ -42,6 +43,7 @@ public void testDifferencePercent1() {
assertEquals(actualPercent, imageComparisonResult.getDifferencePercent());
}

//CS304 (manually written) Issue link: https://github.com/romankh3/image-comparison/issues/190
@DisplayName("For issue#190, test the Percentage of Different Pixels of the same images")
@Test
public void testDifferencePercent2() {
Expand Down

0 comments on commit 35d1645

Please sign in to comment.